CN112632410A - Environment adaptive positioning method and system - Google Patents
Environment adaptive positioning method and system Download PDFInfo
- Publication number
- CN112632410A CN112632410A CN202011550091.8A CN202011550091A CN112632410A CN 112632410 A CN112632410 A CN 112632410A CN 202011550091 A CN202011550091 A CN 202011550091A CN 112632410 A CN112632410 A CN 112632410A
- Authority
- CN
- China
- Prior art keywords
- positioning
- environment
- operating environment
- preset
- user
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S19/00—Satellite radio beacon positioning systems; Determining position, velocity or attitude using signals transmitted by such systems
- G01S19/38—Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system
- G01S19/39—Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system the satellite radio beacon positioning system transmitting time-stamped messages, e.g. GPS [Global Positioning System], GLONASS [Global Orbiting Navigation Satellite System] or GALILEO
- G01S19/42—Determining position
- G01S19/45—Determining position by combining measurements of signals from the satellite radio beacon positioning system with a supplementary measurement
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Remote Sensing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention provides an environment adaptive positioning method, which comprises the following steps: identifying a user agent of a host running a preset page in request information sent by a terminal so as to determine the running environment of the preset page according to an identification result; acquiring a positioning mode corresponding to the operating environment according to the operating environment, and positioning the position of the user through the positioning mode to acquire positioning result data in the operating environment; judging whether the operation environment is a target operation environment specified by a preset page or not, wherein the accuracy of the positioning result of the preset page in the target operation environment is greater than a preset value; and when the operation environment is not the preset operation environment, converting the coordinate system of the positioning result data in the operation environment, and sending the target position information obtained after conversion to the terminal. The method and the device can obtain accurate positioning results in different environments, and position information output by different operating environments is the same, so that accurate data recommendation is provided for users, and better user experience is provided for the users.
Description
Technical Field
The embodiment of the invention relates to the technical field of big data, in particular to a positioning method and a positioning system for environment adaptation.
Background
A page link can be opened in a number of ways, such as: WeChat, banking Application (APP), or other unknown environments. However, in the prior art, a specific page has a high success rate of positioning only when running in a specified environment, for example: the success rate of operation and positioning is the highest only in the WeChat, and the positioning effect that a plurality of environments operate and have high success rate and high accuracy cannot be realized.
Therefore, the invention aims to solve the problem of how to improve the positioning success rate and accuracy of one page in the operation of various environments.
Disclosure of Invention
In view of the above, there is a need to provide an environment adaptive positioning method, system, computer device and computer readable storage medium, which can solve the problem in the prior art how to improve the positioning success rate and accuracy of a page when running in multiple environments.
In order to achieve the above object, an embodiment of the present invention provides an environment-adaptive positioning method, where the method includes:
receiving request information which is sent by a terminal and represents that a user requests to open a preset page, identifying a user agent of a host used for operating the preset page in the request information, and determining an operating environment of the preset page according to the identified user agent;
acquiring a positioning mode corresponding to the operating environment according to the operating environment, and positioning the position of the user through the positioning mode to acquire positioning result data in the operating environment;
judging whether the operation environment is a target operation environment specified by the preset page, wherein the accuracy of the positioning result of the preset page in the target operation environment is greater than a preset value; and
and when the operating environment is not the preset operating environment, converting the coordinate system of the positioning result data in the operating environment, and sending the target position information obtained after conversion to the terminal so as to enable the terminal to display the target position information.
Optionally, the identifying a user agent of a host in the request information, where the host is used to run the preset page, and determining a running environment of the preset page according to the identified user agent includes:
carrying out capital-lower conversion on the user agent, and extracting corresponding character string keywords from a preset position of a conversion result;
and determining the running environment pointed by the character string keywords as the running environment of the preset page.
Optionally, the determining, as the running environment of the preset page, the running environment pointed by the character string keyword includes:
identifying the character string keywords in a regular matching mode to obtain an identification result;
and matching the recognition result with a preset keyword environment mapping table to obtain an operating environment corresponding to the recognition result, wherein the preset keyword environment mapping table stores preset keywords and the operating environment corresponding to the keywords.
Optionally, the operating environment includes a bank application, and the positioning the location of the user in the positioning manner to obtain positioning result data in the operating environment includes:
when the running environment is the bank application program, positioning through a global positioning system and an Internet protocol positioning method to obtain a positioning result;
saving the positioning result locally;
and acquiring the positioning result data from the local area in a bridging mode.
Optionally, the operating environment further includes a WeChat, and the positioning the location of the user in the positioning manner to obtain positioning result data in the operating environment includes:
and when the operating environment is the WeChat, positioning in a software development kit mode to obtain the positioning result data.
Optionally, the operating environment further includes an unknown environment, and the positioning the position of the user in the positioning manner to obtain positioning result data in the operating environment includes:
and when the operating environment is the unknown environment, positioning by an accurate Internet protocol positioning method, a browser positioning method or the software development kit positioning method to obtain the positioning result data.
Optionally, the method further comprises:
and caching the target position information and uploading the target position information to a block chain.
In order to achieve the above object, an embodiment of the present invention further provides an environment-adaptive positioning system, where the system includes:
the identification module is used for acquiring request information which is sent by a terminal and indicates that a user requests to open a preset page, identifying a user agent of a host used for operating the preset page in the request information, and determining the operating environment of the preset page according to the identified user agent;
the positioning module is used for acquiring a positioning mode corresponding to the operating environment according to the operating environment and positioning the position of the user through the positioning mode so as to acquire positioning result data in the operating environment;
the judging module is used for judging whether the running environment is a target running environment specified by the preset page, wherein the accuracy of the positioning result of the preset page in the target running environment is greater than a preset value; and
and the output module is used for converting the coordinate system of the positioning result data in the operating environment and sending the target position information obtained after conversion to the terminal so as to enable the terminal to display the target position information when the operating environment is not the preset operating environment.
To achieve the above object, an embodiment of the present invention further provides a computer device, a memory of the computer device, a processor, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the environment-adapted positioning method as described above.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the environment-adapted positioning method as described above.
The environment adaptive positioning method, system, computer device and computer readable storage medium provided by the embodiment of the invention, judging whether the operation environment is a preset environment or not by identifying the operation environment of a preset page and positioning the position of a user according to a positioning mode corresponding to the operation environment to obtain positioning result data under the operation environment, and when the operating environment is not the preset environment, converting the coordinate system and sending the converted target position information to the terminal, so that the terminal can display the target position information and can obtain accurate positioning results in different environments, and the positioning result data under different operating environments are converted into coordinate systems, so that the position information output by different operating environments is the same, accurate data recommendation is provided for users, and better user experience is provided for the users. The embodiment of the invention can also complete the access of the positioning system through a few codes, greatly reduces the development workload and improves the development efficiency.
Drawings
FIG. 1 is a diagram of an application environment of a positioning method for environment adaptation according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of an environment adaptive positioning method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating an exemplary step of identifying a user agent in the request information for operating a host of the preset page in step S101 in fig. 2, and determining an operating environment of the preset page according to the identified user agent;
FIG. 4 is a flowchart illustrating an exemplary step of step S202 shown in FIG. 3;
FIG. 5 is a block diagram of a positioning system adapted to environment according to an embodiment of the present invention;
FIG. 6 is a diagram of a hardware architecture of a computer device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Referring to fig. 1, an exemplary application environment diagram of the environment-adaptive positioning method according to the embodiment of the present invention is shown. In fig. 1, when it is detected that a user opens a preset page, an operating environment of the preset page is opened by calling a positioning system adapted to the environment, for example, the operating environment is identified as a bank APP, a WeChat or an unknown environment, a corresponding positioning method is called according to an identification result, and a positioning result is returned to the page and cached.
Example one
Referring to fig. 2, a flow chart of the steps of the environment adaptive positioning method of the embodiment of the invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. It should be noted that the present embodiment is exemplarily described with a server as an execution subject. The method specifically comprises the following steps:
step S101: receiving request information which is sent by a terminal and represents that a User requests to open a preset page, identifying a User Agent (UA) of a host used for operating the preset page in the request information, and determining an operating environment of the preset page according to the identified UA. The operating environment may include: WeChat, bank APP, or unknown environment.
It should be noted that the user agent is a user identifier in the HTTP request, and is a special character string, so that the server can identify an operating system and a version used by the client, a Central Processing Unit (CPU) type, a browser and a version, a browser rendering engine, a browser language, a browser plug-in, and the like. When the terminal where the user is located detects an operation instruction of opening the preset page by the user, the terminal sends request information indicating that the user requests to open the preset page to the server. And then the server receives request information which is sent by the terminal and represents that the user requests to open the preset page, wherein the request information comprises a user agent of a host of the preset page. Because the user agent is marked with information such as a browser and a version of the terminal where the user is located, the operating environment of the terminal where the user is located for opening the preset page can be obtained by identifying the user agent.
In a specific embodiment, when it is detected that the user enters the preset page, a NEST-tools development framework needs to be loaded during positioning, and then a location acquisition (getLocation) method is called to implement positioning.
In an exemplary embodiment, as shown in fig. 3, the identifying, in the step S101, a user agent of a host in the request information for running the preset page, and determining a running environment of the preset page according to the identified user agent may include:
step S201: carrying out capital-lower conversion on the user agent, and extracting corresponding character string keywords from a preset position of a conversion result;
step S202: and determining the running environment pointed by the character string keywords as the running environment of the preset page.
Specifically, since the user agent includes upper and lower case letters, the format of the user agent is unified by converting the user agent into lower case in its entirety. The user agent is a long string of character strings, and each position of the character strings is marked with corresponding terminal information. For example: and the position of the running environment of the preset page opened by the user at the terminal in the user agent is fixed or preset. Corresponding character strings can be directly extracted from the converted preset position of the user agent, and the character strings extracted from the preset position represent the running environment of the preset page. Referring to fig. 1, the operating environment is determined to be a bank APP, WeChat or unknown environment.
In an exemplary embodiment, as shown in fig. 4, the step S202 may include:
step S301: identifying the character string keywords in a regular matching mode to obtain an identification result;
step S302: and matching the recognition result with a preset keyword environment mapping table to obtain an operating environment corresponding to the recognition result, wherein the preset keyword environment mapping table stores preset keywords and the operating environment corresponding to the keywords.
Specifically, for example, the keyword of the character string is MicroMessenger, and the MicroMessenger is identified by regular matching. The preset keyword environment mapping table stores the mapping relation between the micro messenger and the WeChat, the mapping relation between the paebank and the pocket APP of the safe bank, the mapping relation between the banka and the pocket banker and the mapping relation between the pars and the gold manager. And matching the MicroMessenger with a preset keyword environment mapping table to obtain that the operating environment of the MicroMessenger is WeChat. And if the character string keyword is paebank, identifying that the running environment is a safe bank pocket APP. And if the character string keyword is banka, identifying that the running environment is a pocket banker. And if the keyword of the character string is pars, identifying that the running environment is a gold housekeeper.
Step S102: and acquiring a positioning mode corresponding to the operating environment according to the operating environment, and positioning the position of the user through the positioning mode to acquire positioning result data in the operating environment.
It should be noted that, according to different operating environments and different positioning methods adopted by the operating environments, coordinate systems in which the positioning result data are located also differ. That is, when the same page is opened at the same position through different operating environments, the obtained positioning result data are different. Therefore, different operating environments may have inaccurate positioning.
In an exemplary embodiment, when the operating environment is the bank application, Positioning is performed by a Global Positioning System (GPS) and Internet Protocol (IP) Positioning method to obtain a Positioning result, the Positioning result is stored locally, and the Positioning result data is obtained locally in a bridging manner. For example, positioning is performed by the GPS and the IP positioning method, then latitude and longitude data obtained by positioning is stored locally, and then the latitude and longitude data is obtained locally. The user location information includes a city name, a city ID, a street name, and the like. It should be noted that, in practical application, the positioning method may be used for positioning at the same time, and positioning result data in the operating environment may be obtained only by successfully positioning one of the positioning methods.
In another exemplary embodiment, when the operating environment is the WeChat, the positioning result data is obtained through a Software Development Kit (SDK). For example: and if the coordinate system used in the WeChat positioning method is a GCJ-02 coordinate system, the positioning result data acquired by the SDK is longitude and latitude data under the GCJ-02 coordinate system.
In another exemplary embodiment, when the operating environment is an unknown environment, the positioning is performed by using a precision IP positioning method, a browser positioning method, and an SDK positioning method. For example: when the user is positioned, if the accurate IP positioning method cannot be successfully positioned, the user can be positioned by a browser positioning method, and if the browser positioning method cannot be positioned, the user can be positioned by an SDK positioning method. Of course, in practical application, the positioning methods can be used for positioning at the same time, and positioning result data in the operating environment can be acquired only by successfully positioning one of the positioning methods.
Step S103: and judging whether the operation environment is a target operation environment specified by the preset page, wherein the accuracy of the positioning result of the preset page in the target operation environment is greater than a preset value.
Because the coordinate systems of the positioning result data acquired under different operating environments are different, whether the positioning result data acquired under the operating environment needs to be converted is judged by judging whether the operating environment is a preset operating environment.
Step S104: and when the operating environment is not the preset operating environment, converting the coordinate system of the positioning result data in the operating environment, and sending the target position information obtained after conversion to the terminal so as to enable the terminal to display the target position information.
The target location information may include: city name, city ID, and street.
Illustratively, for example, the coordinate system of the positioning method corresponding to the wechat operating environment is a GCJ-02 coordinate system, the target position information is obtained by converting the obtained longitude and latitude data under the GCJ-02 coordinate system into target longitude and latitude data under a hundred-degree coordinate system, and then converting address information according to the target longitude and latitude data. In other embodiments, the target location information may further include the target longitude and latitude data, so as to send the target longitude and latitude data, the city name, the city ID, the street, and other information to the user terminal.
In an exemplary embodiment, the target location information is cached to avoid wasting resources. Specifically, after the target position information is acquired, the target position information is cached in a memory. In the process of moving the user, because the moving distance of the user is short in a short time and the position of the user is not changed greatly, the target position information cached in the memory is continuously displayed on a display interface of the user terminal within a preset time. And when the preset time is exceeded, repositioning the user and caching again. For example: and updating the positioning information every 10 minutes, and using the last positioning information in the 10 minutes and displaying the positioning information on a display interface of the user terminal. By caching the target position information, directly acquiring the target position information within preset time and displaying the target position information on a display interface of the user terminal, the situation of always positioning can be avoided, the waste of computer resources is avoided, the processing performance of a computer is improved, and the positioning success rate is increased.
In an exemplary embodiment, the method further comprises: and uploading the target position information to a block chain. The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
In an exemplary embodiment, the method further comprises: and when the positioning is abnormal or fails, sending the information of the positioning abnormality or the positioning failure to the log and sending alarm information to the user terminal. The positioning exception or positioning failure may include identifying a positioning timeout, positioning unauthorized return of specified information. By sending the positioning abnormity or the positioning failure information to the log, the positioning abnormity can be monitored and managed, and the normal operation of positioning is ensured.
In an exemplary embodiment, the method further comprises: the method comprises the steps of obtaining address position information input by a user, and converting the address position information into longitude and latitude data under a preset coordinate system. For example: the method comprises the steps of obtaining an urban name and a street name input by a user number, and converting the urban name and the street name into longitude and latitude data under a hundred-degree coordinate system. By converting the address position information into longitude and latitude data under the preset coordinate system, the cost and the time for business personnel to input the coordinate system are greatly saved.
According to the environment adaptive positioning method provided by the embodiment of the invention, the operation environment of the preset page is identified, the position of the user is positioned according to the positioning mode corresponding to the operation environment to obtain the positioning result data under the operation environment, whether the operation environment is the preset environment is judged, the coordinate system is converted when the operation environment is not the preset environment, the converted target position information is sent to the terminal, so that the terminal displays the target position information, the accurate positioning result can be obtained in different environments, and the coordinate system conversion is carried out on the positioning result data under different operation environments, so that the position information output by different operation environments is the same, the accurate data recommendation is provided for the user, and the better user experience is provided for the user. The embodiment of the invention can also complete the access of the positioning system through a few codes, greatly reduces the development workload and improves the development efficiency.
Example two
Referring to fig. 5, a schematic diagram of program modules of an environment adaptive positioning system according to an embodiment of the present invention is shown. The environment-adapted positioning system 20 may be applied to the server in the first embodiment. In the embodiment, the environment-adapted positioning system 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and implement the environment-adapted positioning method. The program modules referred to in the embodiments of the present invention refer to a series of computer program instruction segments capable of performing specific functions, and are more suitable than the program itself for describing the execution process of the environment-adaptive positioning system 20 in the storage medium. The following description will specifically describe the functions of the program modules of the present embodiment:
the identifying module 201 is configured to receive request information indicating that a User requests to open a preset page, which is sent by a terminal, identify a User Agent (UA) in the request information, which is used for operating a host of the preset page, and determine an operating environment of the preset page according to the identified UA. The operating environment may include: WeChat, bank APP, or unknown environment.
It should be noted that the user agent is a user identifier in the HTTP request, and is a special character string, so that the server can identify an operating system and a version used by the client, a Central Processing Unit (CPU) type, a browser and a version, a browser rendering engine, a browser language, a browser plug-in, and the like. When the terminal where the user is located detects an operation instruction of opening the preset page by the user, the terminal sends request information indicating that the user requests to open the preset page to the server. Then, the identification module 201 receives request information indicating that the user requests to open the preset page, where the request information includes a user agent of a host of the preset page, and the request information is sent by the terminal. Since the user agent is identified with information such as a browser and a version of the terminal where the user is located, the identification module 201 can obtain the operating environment of the terminal where the user is located for opening the preset page by identifying the user agent.
In a specific embodiment, when it is detected that the user enters the preset page, a NEST-tools development framework needs to be loaded during positioning, and then a location acquisition (getLocation) method is called to implement positioning.
In an exemplary embodiment, the identification module 201 may specifically include a conversion module, an extraction module, and a determination module:
the conversion module is used for converting the case of the user agent to obtain a converted user agent;
the extraction module is used for extracting corresponding character string keywords from the converted preset position of the user agent;
and the determining module is used for determining the running environment pointed by the character string keywords as the running environment of the preset page.
Specifically, since the user agent includes upper and lower case letters, the conversion module unifies the format of the user agent by converting the user agent into lower case in its entirety. The user agent is a long string of character strings, and each position of the character strings is marked with corresponding terminal information. For example: and the position of the running environment of the preset page opened by the user at the terminal in the user agent is fixed or preset. The extraction module can directly extract the corresponding character string from the converted preset position of the user agent, and the character string extracted from the preset position represents the running environment of the preset page. As shown in fig. 1, the determination module determines the operating environment to be a bank APP, a WeChat or an unknown environment.
In an exemplary embodiment, the determining module may include a recognizing unit and a matching unit:
the identification unit is used for identifying the character string keywords in a regular matching mode to obtain an identification result;
and the matching unit is used for matching the recognition result with a preset keyword environment mapping table to obtain an operating environment corresponding to the recognition result, wherein the preset keyword environment mapping table stores preset keywords and the operating environment corresponding to the keywords.
Specifically, for example, the keyword of the character string is MicroMessenger, and the identifying unit identifies the MicroMessenger by regular matching. The preset keyword environment mapping table stores the mapping relation between the micro messenger and the WeChat, the mapping relation between the paebank and the pocket APP of the safe bank, the mapping relation between the banka and the pocket banker and the mapping relation between the pars and the gold manager. The matching unit matches the MicroMessenger with a preset keyword environment mapping table to obtain that the operating environment of the MicroMessenger is WeChat. And if the character string keyword is paebank, identifying that the running environment is a safe bank pocket APP. And if the character string keyword is banka, identifying that the running environment is a pocket banker. And if the keyword of the character string is pars, identifying that the running environment is a gold housekeeper.
And the positioning module 202 is configured to obtain a positioning manner corresponding to the operating environment according to the operating environment, and position the position of the user in the positioning manner, so as to obtain positioning result data in the operating environment.
It should be noted that, according to different operating environments and different positioning methods adopted by the operating environments, coordinate systems in which the positioning result data are located also differ. That is, when the same page is opened at the same position through different operating environments, the obtained positioning result data are different. Therefore, different operating environments may have inaccurate positioning.
In an exemplary embodiment, when the operating environment is the bank application, the Positioning module 202 performs Positioning by using a Global Positioning System (GPS) and Internet Protocol (IP) Positioning method to obtain a Positioning result, stores the Positioning result in the local, and obtains the Positioning result data from the local in a bridging manner. For example, positioning is performed by the GPS and the IP positioning method, then latitude and longitude data obtained by positioning is stored locally, and then the latitude and longitude data is obtained locally. The user location information includes a city name, a city ID, a street name, and the like. It should be noted that, in practical application, the positioning method may be used for positioning at the same time, and positioning result data in the operating environment may be obtained only by successfully positioning one of the positioning methods.
In another exemplary embodiment, when the operating environment is the WeChat, the positioning module 202 obtains the positioning result data through a Software Development Kit (SDK). For example: and if the coordinate system used in the WeChat positioning method is a GCJ-02 coordinate system, the positioning result data acquired by the SDK is longitude and latitude data under the GCJ-02 coordinate system.
In another exemplary embodiment, when the operation environment is an unknown environment, the positioning module 202 performs positioning by using a precision IP positioning method, a browser positioning method, and an SDK positioning method. For example: when the user is positioned, if the accurate IP positioning method cannot be successfully positioned, the user can be positioned by a browser positioning method, and if the browser positioning method cannot be positioned, the user can be positioned by an SDK positioning method. Of course, in practical application, the positioning methods can be used for positioning at the same time, and positioning result data in the operating environment can be acquired only by successfully positioning one of the positioning methods.
The determining module 203 is configured to determine whether the operating environment is a target operating environment specified by the preset page, where accuracy of a positioning result of the preset page in the target operating environment is greater than a preset value.
Because the coordinate systems of the positioning result data acquired under different operating environments are different, whether the positioning result data acquired under the operating environment needs to be converted is judged by judging whether the operating environment is a preset operating environment.
And the output module 204 is configured to, when the operating environment is not the preset operating environment, perform coordinate system conversion on the positioning result data in the operating environment, and send target position information obtained after the conversion to the terminal, so that the terminal displays the target position information.
The target location information may include: city name, city ID, and street.
Illustratively, a coordinate system of the positioning method corresponding to the wechat operating environment is a GCJ-02 coordinate system, and the target position information is obtained by converting the acquired longitude and latitude data under the GCJ-02 coordinate system into target longitude and latitude data under a hundred-degree coordinate system and then converting address information according to the target longitude and latitude data. In other embodiments, the target location information may further include the target longitude and latitude data, so as to send the target longitude and latitude data, the city name, the city ID, the street, and other information to the user terminal.
In an exemplary embodiment, the environment-adapted positioning system 20 may further include a caching module for caching the target location information to avoid resource waste. Specifically, after the target location information is acquired, the cache module caches the target location information in a memory. In the process of moving the user, because the moving distance of the user is short in a short time and the position of the user is not changed greatly, the target position information cached in the memory is continuously displayed on a display interface of the user terminal within a preset time. And when the preset time is exceeded, repositioning the user and caching again. For example: and updating the positioning information every 10 minutes, and using the last positioning information in the 10 minutes and displaying the positioning information on a display interface of the user terminal. By caching the target position information, directly acquiring the target position information within preset time and displaying the target position information on a display interface of the user terminal, the situation of always positioning can be avoided, the waste of computer resources is avoided, the processing performance of a computer is improved, and the positioning success rate is increased.
In an exemplary embodiment, the environment-adapted positioning system 20 further comprises an upload module for uploading the target location information into a blockchain. The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
In an exemplary embodiment, the environment-adapted positioning system 20 further includes a sending module, configured to send, when positioning is abnormal or fails, information of the positioning abnormality or the positioning failure to a log, and send an alarm message to the user terminal. The positioning exception or positioning failure may include identifying a positioning timeout, positioning unauthorized return of specified information. By sending the positioning abnormity or the positioning failure information to the log, the positioning abnormity can be monitored and managed, and the normal operation of positioning is ensured.
In an exemplary embodiment, the environment-adapted positioning system 20 may further comprise a conversion module for: the method comprises the steps of obtaining address position information input by a user, and converting the address position information into longitude and latitude data under a preset coordinate system. For example: the method comprises the steps of obtaining an urban name and a street name input by a user number, and converting the urban name and the street name into longitude and latitude data under a hundred-degree coordinate system. By converting the address position information into longitude and latitude data under the preset coordinate system, the cost and the time for business personnel to input the coordinate system are greatly saved.
The environment-adaptive positioning system provided by the embodiment of the invention identifies the operating environment of the preset page, positions the position of the user according to the positioning mode corresponding to the operating environment to obtain the positioning result data under the operating environment, judges whether the operating environment is the preset environment, converts the coordinate system when the operating environment is not the preset environment, and sends the converted target position information to the terminal, so that the terminal displays the target position information, can obtain accurate positioning results in different environments, and converts the coordinate system of the positioning result data under different operating environments, so that the position information output by different operating environments is the same, accurate data recommendation is provided for the user, and better user experience is provided for the user. The embodiment of the invention can also complete the access of the positioning system through a few codes, greatly reduces the development workload and improves the development efficiency.
EXAMPLE III
Referring to fig. 6, a hardware architecture diagram of a computer device according to a third embodiment of the present invention is shown. The computer device 2 includes, but is not limited to, a memory 21, a processor 22, and a network interface 23 communicatively coupled to each other via a system bus, and FIG. 6 illustrates only the computer device 2 having components 21-23, but it is to be understood that not all of the illustrated components are required and that more or fewer components may alternatively be implemented. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a preset or stored instruction. For example, a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of servers) that can execute programs, and the like.
The memory 21 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 2. Of course, the memory 21 may also comprise both an internal storage unit of the computer device 2 and an external storage device thereof. In this embodiment, the memory 21 is generally used for storing an operating system installed in the computer device 2 and various types of application software, such as a program code of the environment-adaptive positioning system 20. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to execute the program code stored in the memory 21 or process data, for example, execute the environment-adapted positioning system 20.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the computer device 2 and other electronic devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 6 only shows the computer device 2 with components 21-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
Example four
The present embodiments also provide a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, realizes the steps of the environment-adapted positioning method of the embodiments.
In this embodiment, the computer-readable storage medium includes a Flash memory, a hard disk, a multimedia Card, a Card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., and in other embodiments, the computer-readable storage medium may also be an external storage device of the computer apparatus, such as a plug-in hard disk equipped on the computer apparatus, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program code of the environment-adaptive positioning method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011550091.8A CN112632410A (en) | 2020-12-24 | 2020-12-24 | Environment adaptive positioning method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011550091.8A CN112632410A (en) | 2020-12-24 | 2020-12-24 | Environment adaptive positioning method and system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN112632410A true CN112632410A (en) | 2021-04-09 |
Family
ID=75324393
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011550091.8A Pending CN112632410A (en) | 2020-12-24 | 2020-12-24 | Environment adaptive positioning method and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112632410A (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| BR0112016A (en) * | 2000-06-30 | 2003-05-13 | Nokia Corp | Method for determining terminal device position using one or more of the positioning methods, terminal device, and, computer program |
| CN103516665A (en) * | 2012-06-18 | 2014-01-15 | 上海博泰悦臻电子设备制造有限公司 | User data generation method and system, client side and server |
| CN110321507A (en) * | 2019-07-09 | 2019-10-11 | 中国工商银行股份有限公司 | Browser cross-domain communication method and device |
| CN112073462A (en) * | 2020-08-05 | 2020-12-11 | 长沙市到家悠享网络科技有限公司 | Positioning method and device |
-
2020
- 2020-12-24 CN CN202011550091.8A patent/CN112632410A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| BR0112016A (en) * | 2000-06-30 | 2003-05-13 | Nokia Corp | Method for determining terminal device position using one or more of the positioning methods, terminal device, and, computer program |
| CN103516665A (en) * | 2012-06-18 | 2014-01-15 | 上海博泰悦臻电子设备制造有限公司 | User data generation method and system, client side and server |
| CN110321507A (en) * | 2019-07-09 | 2019-10-11 | 中国工商银行股份有限公司 | Browser cross-domain communication method and device |
| CN112073462A (en) * | 2020-08-05 | 2020-12-11 | 长沙市到家悠享网络科技有限公司 | Positioning method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108427705B (en) | Electronic device, distributed system log query method and storage medium | |
| CN112491602B (en) | Behavior data monitoring method and device, computer equipment and medium | |
| CN112162965B (en) | Log data processing method, device, computer equipment and storage medium | |
| CN110086658B (en) | Interface switching method and device and computer readable storage medium | |
| CN109617647B (en) | Message conversion method and device, computer equipment and computer readable storage medium | |
| CN112860662B (en) | Automatic production data blood relationship establishment method, device, computer equipment and storage medium | |
| CN112613917A (en) | Information pushing method, device and equipment based on user portrait and storage medium | |
| CN110851748A (en) | Short link generation method, server, storage medium and computer equipment | |
| CN114095567B (en) | Data access request processing method and device, computer equipment and medium | |
| CN115562992B (en) | File detection method, device, electronic device and storage medium | |
| CN111291345A (en) | Voiceprint data processing method, device, computer equipment and storage medium | |
| CN114185804B (en) | Interface testing method and device and terminal equipment | |
| CN109656592B (en) | Card management method, device, terminal and computer-readable storage medium | |
| CN112527780B (en) | Redis cluster creation and management method, system, computer equipment and storage medium | |
| CN114218191A (en) | System function migration method and device, computer equipment and storage medium | |
| CN113722225A (en) | Page testing method and device, computer equipment and storage medium | |
| CN105978722A (en) | User attribute mining method and device | |
| CN114461652A (en) | An information collection method, device, equipment and storage medium | |
| CN112632410A (en) | Environment adaptive positioning method and system | |
| CN111782244A (en) | Configuration file update method, device, computer equipment and storage medium | |
| CN111917556B (en) | Interactive file detection method, device, terminal and storage medium | |
| CN115827047A (en) | Request processing method and device, computer equipment and storage medium | |
| CN115934204A (en) | Instance management method based on specific coding and related equipment thereof | |
| CN110413644B (en) | Data caching method, electronic device and computer readable storage medium | |
| CN115080045A (en) | Link generation method and device, computer equipment and storage medium |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210409 |
|
| RJ01 | Rejection of invention patent application after publication |