CN114268662A - Position information acquisition method, device, equipment and medium - Google Patents

Position information acquisition method, device, equipment and medium Download PDF

Info

Publication number
CN114268662A
CN114268662A CN202111572475.4A CN202111572475A CN114268662A CN 114268662 A CN114268662 A CN 114268662A CN 202111572475 A CN202111572475 A CN 202111572475A CN 114268662 A CN114268662 A CN 114268662A
Authority
CN
China
Prior art keywords
request
position information
current
information
time
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
Application number
CN202111572475.4A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202111572475.4A priority Critical patent/CN114268662A/en
Publication of CN114268662A publication Critical patent/CN114268662A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention discloses a position information acquisition method, a position information acquisition device, position information acquisition equipment and a position information acquisition medium, wherein the method comprises the following steps: acquiring a current position information request and determining the request type of the current position information request; reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region according to the request type; and when the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data is smaller than the preset time threshold corresponding to the request type, using the position information caching data as feedback data of the current position information request, and caching the feedback data into a preset position information caching area. The method and the device realize reduction of the number of times of calling the interface of the satellite positioning function module, improve the efficiency of acquiring the geographical position of the application program and reduce the overall power consumption of the application program.

Description

Position information acquisition method, device, equipment and medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a position information acquisition method, a position information acquisition device, position information acquisition equipment and position information acquisition media.
Background
In the process of running a plurality of Application (APP) clients of a mobile terminal, it is usually necessary to obtain a current address of a user to provide personalized services for the user, such as services for recommending restaurants or scenic spots around the user's location. The APP client side obtains the geographic position information by performing a position request to a system of the mobile terminal and obtaining the geographic position information through a satellite positioning function module in the mobile terminal.
However, in the process of implementing the present invention, at least the following technical problems are found in the prior art: frequent acquisition of the geographic position information by the APP client is time-consuming and high in power consumption, so that the power consumption of the mobile terminal is too high, and the acquisition mode of the geographic position information needs to be optimized to reduce the power consumption of the application program during use.
Disclosure of Invention
The embodiment of the invention provides a position information acquisition method, a position information acquisition device, position information acquisition equipment and a position information acquisition medium, which are used for reducing the number of times of calling a satellite positioning function module interface, improving the efficiency of acquiring a geographical position by an application program and reducing the overall power consumption of the application program.
In a first aspect, an embodiment of the present invention provides a location information obtaining method, which is applied to a client, and the method includes:
acquiring a current position information request and determining the request type of the current position information request;
according to the request type, reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region, wherein the preset position information cache region caches position information acquired based on the previous position information request;
and when the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data is smaller than the preset time threshold corresponding to the request type, using the position information caching data as feedback data of the current position information request.
In a second aspect, an embodiment of the present invention further provides a location information obtaining method, which is applied to a server, and the method includes:
acquiring a service request of a client, and analyzing request information of the service request;
when the request information contains an IP address, acquiring geographical position information corresponding to the IP address;
and feeding back the geographical position information and the service data related to the service request to the client side together so that the client side caches the geographical position information as the position information of a request for acquiring the position information based on a network request to a preset position information cache region.
In a third aspect, an embodiment of the present invention further provides a location information obtaining apparatus, configured at a client, where the apparatus includes:
a request type determining module, configured to obtain a current location information request and determine a request type of the current location information request;
a location cache information obtaining module, configured to read, according to the request type, location information cache data that corresponds to the request type and has a cache time closest to a time at which the current location information request is obtained, in a preset location information cache region, where location information obtained based on a previous location information request is cached in the preset location information cache region;
and the position information feedback module is used for taking the position information cache data as feedback data of the current position information request when the time interval between the time of acquiring the current position information request and the cache request time corresponding to the position information cache data is less than a preset time threshold corresponding to the request type.
In a fourth aspect, an embodiment of the present invention further provides a location information obtaining apparatus, configured at a server, where the apparatus includes:
the request information analysis module is used for acquiring a service request of a client and analyzing request information of the service request;
the position information acquisition module is used for acquiring geographical position information corresponding to the IP address when the request information contains the IP address;
and the position information feedback module is used for feeding back the geographical position information and the service data related to the service request to the client side together so that the client side caches the geographical position information as the position information of the request for acquiring the position information based on the network request to a preset position information cache region.
In a fifth aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement a location information acquisition method applied to a client according to any embodiment of the present invention.
In a sixth aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement a location information obtaining method applied to a server according to any embodiment of the present invention.
In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a location information obtaining method applied to a client or a server as provided in any embodiment of the present invention.
The embodiment of the invention has the following advantages or beneficial effects:
in the embodiment of the invention, based on the classification of the position information request, when the current position information request is obtained, the request category of the current position information request is determined; according to the corresponding position information request category, position information cache data which correspond to the request category and have the cache time closest to the time of acquiring the current position information request are read in a preset position information cache region, when the time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data is smaller than a preset time threshold value corresponding to the request category, the position information cache data are used as feedback data of the current position information request and are cached in the preset position information cache region, and therefore a satellite positioning function module does not need to be called every time to acquire the current geographic position. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
Drawings
Fig. 1 is a flowchart of a location information obtaining method applied to a client according to an embodiment of the present invention;
fig. 2 is a flowchart of a location information obtaining method applied to a client according to a second embodiment of the present invention;
fig. 3 is a flowchart of a location information obtaining method applied to a client according to a third embodiment of the present invention;
fig. 4 is an overall flowchart of a location information obtaining method applied to a client according to a third embodiment of the present invention;
fig. 5 is a flowchart of a location information obtaining method applied to a client according to a fourth embodiment of the present invention;
fig. 6 is a flowchart of a location information obtaining method applied to a server according to a fifth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a location information obtaining apparatus configured at a client according to a sixth embodiment of the present invention;
fig. 8 is a schematic structural diagram of a location information obtaining apparatus configured at a server according to a seventh embodiment of the present invention;
fig. 9 is a schematic structural diagram of a computer device according to an eighth embodiment of the present invention;
fig. 10 is a schematic structural diagram of a server device according to a ninth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a location information obtaining method applied to a client according to an embodiment of the present invention, which is applicable to a situation of obtaining local pre-administration location information of a terminal. The method can be executed by a position information acquisition device configured at the client, and the device can be realized by software and/or hardware and is integrated in a computer device with an application development function.
As shown in fig. 1, the location information acquiring method applied to the client includes the following steps:
s110, acquiring the current position information request, and determining the request type of the current position information request.
Generally, when a client needs to acquire current geographic position information, a request is sent to a terminal where the client is located, and a satellite positioning function module is directly called to acquire specific geographic position information. The satellite Positioning function module is a function module which is arranged in a terminal where the client is located, and can be used for accessing satellite signals such as a GPS (Global Positioning System), a Beidou, a Glonass or a Galileo to perform Positioning according to the intensity of the satellite signals when the Positioning is needed. In the present application, in consideration of other manners of obtaining geographic location information, the category of the current location information request needs to be identified first, and the target geographic location information is obtained in the process of obtaining location information according to the corresponding category.
Specifically, the request category of the current location information request includes a first type location request and a second type location request. The first type of location request is a request for acquiring location information based on a network request, and corresponding geographic location information is acquired through a current network IP address of a client; the second type of location request is a request for location information based on a satellite positioning function. As to which location request method is used, it depends on the accuracy of the geographical location information. When more accurate geographical position information needs to be acquired, the current position information request carries a corresponding request identifier, and the request is the geographical position information acquired by the satellite positioning module. And when the requirement on the accuracy of the geographic position information is not high, the current position information request does not carry a corresponding identifier, and the request obtains the geographic position information acquired through the network request.
And S120, according to the request type, reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region.
The preset position information cache region caches position information acquired based on a previous position information request. The previous location information request may be the location information acquired by the first type location request, or may be the location information acquired by the second type location request. The position information obtained by the previous first-type position request and the position information obtained by the previous second-type position request are cached in the preset position information cache region.
Reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region, namely reading position information cache data acquired by the previous first type position request if the current position information request is the first type position request; and if the current position information request is the second type position request, reading the position information cache data obtained by the previous second type position request.
And S130, when the time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data is smaller than the preset time threshold corresponding to the request type, using the position information cache data as the feedback data of the current position information request.
In this step, the objective is to compare the time interval between the time when the current location information request is acquired and the cache time of the read location information cache data, so as to determine the validity of the location information cache data according to the value of the time interval. If the result is positive, the read position information cache data is used as the feedback information of the current position information request.
Wherein, the threshold value for judging whether the time interval is valid is different according to different types of the position request. When the request type is the first type of location request, the preset time threshold for determining the validity of the time interval may be set to any value within 1 minute to 10 minutes. The first type of location request is based on the network request to obtain the geographical location information, which is matched according to the IP address, is a large range, and does not change greatly in a short time. When the request category is the second category of location request, the preset time threshold for determining the validity of the time interval may be set within 10 seconds. The reason is that the position information acquired by the satellite positioning function module is specific latitude and longitude information, is more accurate geographical position information, and has a higher possibility of information change in a short time.
Specifically, the current location information request is a first type of request, and when the time for obtaining the current location information request and the caching time interval of the location information caching data corresponding to the previous first type of request in the preset location information caching area are smaller than the preset time interval threshold corresponding to the first type of location request, the location information caching data corresponding to the previous first type of request are used as feedback data of the current location information request. The current position information request is a second type of request, and the same is true. Therefore, the client does not need to send a network request to the server again to acquire the geographical position information, and does not need to call the satellite positioning function module to acquire the geographical position information each time, so that the power consumption of a client program can be reduced, and meanwhile, the response speed of the current position information request can be improved by reading data in the cache region to acquire the position information.
According to the technical scheme of the embodiment, based on the classification of the position information request, when the current position information request is acquired, the request type of the current position information request is determined; according to the corresponding position information request category, position information cache data which correspond to the request category and have the cache time closest to the time of acquiring the current position information request are read in a preset position information cache region, when the time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data is smaller than a preset time threshold value corresponding to the request category, the position information cache data are used as feedback data of the current position information request and are cached in the preset position information cache region, and therefore a satellite positioning function module does not need to be called every time to acquire the current geographic position. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
Example two
Fig. 2 is a flowchart of a location information obtaining method applied to a client according to a second embodiment of the present invention, where this embodiment and the location information obtaining method in the foregoing embodiments belong to the same inventive concept, and further describe a process of obtaining location information when a request type of a current location information request is a first type location request. The method can be executed by a position information acquisition device configured at the client, and the device can be realized by software and/or hardware and is integrated in a computer device with an application development function.
As shown in fig. 2, the position information acquisition method includes the steps of:
s210, acquiring the current position information request, and determining the request type of the current position information request.
In this embodiment, through the identification of the current location information request data, it is determined that the request type of the current location information request is the first type of location request, that is, the request for obtaining location information based on the network request, and the location request with low accuracy requirement on the geographical location information.
And S220, when the request type of the current position information request is a first-class position request and the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data of the previous first-class position request is greater than or equal to a preset time threshold corresponding to the first-class position request, reading the caching time of the position caching data of a second-class position request which is before the current position information request and is closest to the time of acquiring the current position information request.
The time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data of the previous first-class position request is greater than or equal to the preset time threshold corresponding to the first-class position request, namely, the current position information request is the first-class position request, but the position information cache data of the previous first-column position request is invalid and inaccurate, and cannot be directly used as the feedback information of the current position information request. Then, in this embodiment, the validity of the location information cache data corresponding to the second type of location request in the preset location information cache region is further considered. If the location cache data of the second-class location request closest to the time of acquiring the current location information request is valid, the geographic location request does not need to be sent to the server.
And S230, when the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the second type of position request is smaller than a preset time threshold corresponding to the first type of position request, using the position caching data of the second type of position request as feedback data of the current position information request.
When the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the second type of position request is smaller than the preset time threshold corresponding to the first type of position request, the position caching data of the second type of position request is indicated to be effective and can be used as feedback data of the current position information request, and the process of the current position information request is ended.
When the location cache data of the second type location request is invalid data, then step S240 and step S250 are further executed.
And S240, when the time interval between the time of obtaining the current position information request and the caching time of the position caching data of the second type of position request is larger than a preset time threshold corresponding to the first type of position request, requesting the geographic position information from the server according to the current IP address of the client, and taking the geographic position information fed back by the server as the feedback data of the current position information request.
When the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the second type of position request is greater than the preset time threshold corresponding to the first type of position request, the position caching data of the second type of position request is invalid, and the caching data in the preset position information caching area can not be used as the feedback data of the current position information request. A network request needs to be sent to the server again to acquire real-time geographic location information.
Specifically, the client sends the current IP address to the server as data of the geographic location request. And the server side feeds back the geographical position information corresponding to the IP address to the client side according to the IP address obtained by analyzing the request data. Therefore, the client side obtains effective current geographic position information.
And S250, caching the feedback data of the current position information request into the preset position information caching area.
The current geographic position information acquired by the client is the latest feedback data of the server, so that the current geographic position information can be cached in a preset position information cache region to update the cache information.
Therefore, in this embodiment, request types of the location information request are distinguished, and if the location request is a first type of location request, even if data in the preset location information cache region fails, the satellite positioning function module does not need to be called to obtain the current geographic location information, and the current location information can be obtained through one-time interaction between the client and the server, so that the number of calling times of the satellite positioning function module is reduced, and thus the power consumption of the client program is reduced.
According to the technical scheme of the embodiment, when the request type of the current position information request is the first type position request and the position cache data of the first type position request in the preset position information cache region is invalid, whether the latest position information cache data of the second type position request is invalid is verified. If the latest location information cache data of the second type location request is not invalid, the latest location information cache data of the second type location request can be used as feedback information of the current location information request, and if the latest location information cache data of the second type location request is also invalid, the server side is requested to acquire real-time geographic location information in a network request mode and the geographic location information is updated to a preset location information cache area. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
EXAMPLE III
Fig. 3 is a flowchart of a location information obtaining method applied to a client according to a third embodiment of the present invention, where this embodiment and the location information obtaining method in the foregoing embodiments belong to the same inventive concept, and further describe a process of obtaining location information when a request type of a current location information request is a second type of location request. The method can be executed by a position information acquisition device configured at the client, and the device can be realized by software and/or hardware and is integrated in a computer device with an application development function.
As shown in fig. 3, the position information acquisition method includes the steps of:
s310, acquiring the current position information request, and determining the request type of the current position information request.
In this embodiment, through the identification of the current location information request data, it is determined that the request category of the current location information request is the second category of location request, that is, the location request with higher accuracy requirement on the geographical location information.
And S320, when the request type of the current position information request is the second type position request and the time interval between the time of obtaining the current position information request and the caching time of the position information caching data of the previous second type position request is greater than or equal to a preset time threshold corresponding to the second type position request, calling a satellite positioning function module to obtain the current geographical position information, using the current geographical position information as the feedback information of the current position information request, and caching the current geographical position information into the preset position information caching area.
In this step, when it is determined that the location information cache data of the previous second-type location request is invalid, the satellite positioning function module is invoked to acquire the current geographic location information. And when the satellite positioning function module is successfully called, ending the current position information request process, and caching the obtained current geographical position information into a preset position information cache region for information reference of a subsequent position information request.
If the satellite positioning function module call is not successful, step S330 is performed.
S330, when the current geographic position information is failed to be acquired by calling the satellite positioning function module, acquiring the feedback information of the current position information request in the first type of position request mode, and caching the feedback information into the preset position information cache region.
If the current geographical position information acquired by calling the satellite positioning function module fails to be acquired, which indicates that the accurate geographical position information cannot be acquired temporarily, the requirement on the accuracy of the geographical position information is reduced, and the position information acquired by the first type of position request mode is used as the feedback information of the current position information request.
Specifically, it is first determined whether the location information cache region of the latest first-type location information request in the preset location information cache region is valid, that is, the cache time of the location cache data of the first-type location request that is before the current location information request and closest to the time of acquiring the current location information request is read; and judging whether the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the first-class position request is smaller than a preset time threshold corresponding to the first-class position request. If so, the position cache data requested by the latest first-class position is used as the feedback data requested by the current position information. Otherwise, requesting the geographic position information from the server according to the current IP address of the client, and using the geographic position information fed back by the server as feedback data of the current position information request. And finally, caching the geographical position information fed back by the server into the preset position information caching area.
According to the technical scheme of the embodiment, when the request type of the current position information request is the second type position request and the position information cache data corresponding to the second type position request in the preset position information cache region is not invalid, the position information cache data corresponding to the second type position request in the preset position information cache region is used as the feedback of the current position information request, and if the position information cache data corresponding to the second type position request in the preset position information cache region is invalid, the satellite positioning function module is called to obtain the latest and accurate geographical position information and cache the latest and accurate geographical position information in the preset position information cache region. Further, when the satellite positioning function module fails to be called, the feedback information of the current position information is acquired by adopting a first type position information request mode. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
Further, in a specific embodiment, the overall process of acquiring the location information may refer to the flowchart shown in fig. 4. In fig. 4, first, the client acquires the current geographic position information request, then determines the request category of the current geographic position information request, and acquires the final position information as the feedback information of the current position information request by adopting different steps for the current geographic position information acquisition requests of different categories, so that the number of times of calling the satellite positioning function module is reduced, and the power consumption of the client program is effectively reduced.
Example four
Fig. 5 is a flowchart of a location information obtaining method applied to a client according to a fourth embodiment of the present invention, where this embodiment and the location information obtaining method in the foregoing embodiments belong to the same inventive concept, and further describe a process of obtaining and updating geographic location data obtained based on a network request mode in a process of service interaction between the client and a server. The method can be executed by a position information acquisition device configured at the client, and the device can be realized by software and/or hardware and is integrated in a computer device with an application development function.
S410, when a service request is sent to a service end, writing the current IP address of the client end into service request information, so that when the service end feeds back service data according to the service request, the current geographic position information determined according to the current IP address is fed back.
The current geographical location information is obtained based on a network request mode, and an IP address is sent to a server side, so that the server side feeds back the corresponding geographical location information according to the IP address, and the current geographical location information is actually one-time interaction between a client side and the server side. In this embodiment, in order to keep the geographical location information based on the network request cached in the preset location information caching area at a high updating frequency, an IP address may be added in the conventional interaction process between the client and the server, so that the server feeds back the corresponding geographical location information according to the IP address.
The conventional interaction refers to interaction between the client and the server, which is not aimed at acquiring geographic position information, in the using process of the client. For example, the client requests data under a certain connection from the server, or requests page refresh and other interactions. That is, the current IP address of the client is added to the request initiated to the server, regardless of the target of the client's interaction with the server. When the server side feeds back the request of the client side, the geographic position information corresponding to the IP address is fed back to the client side as long as the request content is analyzed to contain the IP address.
And S420, reading the current geographical position information from the service data fed back by the server, and caching the current geographical position information into the preset position information cache region as position information of a request for acquiring the position information based on a network request.
In the service data fed back by the server, the current geographic position information corresponding to the current IP address can be analyzed, and the current geographic position information is cached in a preset position information caching area, so that the caching information of the geographic position information acquired based on a network request mode is updated. The validity and the real-time performance of the cache information in the preset position information cache region can be ensured to a certain extent, so that the position information feedback can be carried out on the subsequently acquired position information request.
S430, when the current position information request is acquired, determining the request type of the current position information request.
And S440, according to the request type, reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region.
The preset position information cache region caches position information acquired based on a previous position information request.
And S450, when the time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data is smaller than the preset time threshold corresponding to the request type, using the position information cache data as the feedback data of the current position information request.
According to the technical scheme of the embodiment, the current geographic position information corresponding to the current IP address is obtained in one-time interaction between the client and the server, and the current geographic position information is cached in the preset position information caching area, so that the caching information of the geographic position information obtained based on a network request mode is updated. The validity and the real-time performance of the cache information in the preset position information cache region can be ensured to a certain extent, so that the position information feedback can be carried out on the subsequently acquired position information request. Then, based on the classification of the position information request, when the current position information request is obtained, determining the request category of the current position information request; according to the corresponding position information request category, position information cache data which correspond to the request category and have the cache time closest to the time of acquiring the current position information request are read in a preset position information cache region, when the time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data is smaller than a preset time threshold value corresponding to the request category, the position information cache data are used as feedback data of the current position information request and are cached in the preset position information cache region, and therefore a satellite positioning function module does not need to be called every time to acquire the current geographic position. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
EXAMPLE five
Fig. 6 is a flowchart of a location information obtaining method applied to a server according to a fifth embodiment of the present invention, which belongs to the same inventive concept as the location information obtaining method in the foregoing embodiment, and further describes a process in which, in a process of service interaction between a client and the server, the server feeds back geographic location information according to content requested by the client, so that the client obtains and updates geographic location data obtained based on a network request. The method can be executed by a position information acquisition device configured at a server, and the device can be realized by software and/or hardware and is integrated in a server with an application development function.
S510, acquiring a service request of the client, and analyzing request information of the service request.
The service request refers to a request acquired by the server in each interaction between the server and the client. The purpose of the service request may be to obtain the current geographical location information of the client, or may be other service requests that do not aim to obtain the current geographical location information of the client.
After the service request is obtained, the service end analyzes the content of the service request back to perform service feedback.
S520, when the request information contains the IP address, acquiring the geographical position information corresponding to the IP address.
Regardless of the purpose of the service request acquired by the server, when the request content includes the IP address information, the server matches the geographical location information related to the IP address in the address information base.
S530, feeding back the geographical location information and the service data related to the service request to the client, so that the client caches the geographical location information as location information of a request for obtaining location information based on a network request in a preset location information cache region.
The server will add the matched geographical location information to the feedback content of the service request. Therefore, the geographic position information fed back by the server is cached in the preset position information caching area by the client as the position information of the request for acquiring the position information based on the network request. And updating the cache information of the geographic position information acquired based on the network request mode. The validity and the real-time performance of the cache information in the preset position information cache region can be ensured to a certain extent, so that the position information feedback can be carried out on the subsequently acquired position information request.
According to the technical scheme of the embodiment, when the IP address is analyzed in the network request, the geographic position information corresponding to the IP address is matched, and the matched geographic position information is added into the network request feedback content, so that the geographic position information fed back by the server is cached in the preset position information cache region by the client as the position information of the request for acquiring the position information based on the network request, and the cache information of the geographic position information acquired based on the network request mode is updated. The validity and the real-time performance of the cache information in the preset position information cache region can be ensured to a certain extent, so that the client can conveniently feed back the position information of the subsequently acquired position information request. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
EXAMPLE six
Fig. 7 is a schematic structural diagram of a location information acquiring apparatus configured at a client according to a sixth embodiment of the present invention, which is applicable to a situation of acquiring pre-geographic location information of a terminal.
As shown in fig. 7, the position information acquiring apparatus disposed at the client includes: a request category determining module 610, a location cache information obtaining module 620 and a location information feedback module 630.
The request type determining module 610 is configured to obtain a current location information request, and determine a request type of the current location information request; a location cache information obtaining module 620, configured to read, according to the request category, location information cache data that corresponds to the request category and has a cache time closest to a time when the current location information request is obtained, in a preset location information cache region, where location information obtained based on a previous location information request is cached in the preset location information cache region; a location information feedback module 630, configured to, when a time interval between the time when the current location information request is obtained and the request caching time corresponding to the location information caching data is smaller than a preset time threshold corresponding to the request type, use the location information caching data as feedback data of the current location information request, and cache the feedback data in the preset location information caching area.
According to the technical scheme of the embodiment, based on the classification of the position information request, when the current position information request is acquired, the request type of the current position information request is determined; according to the corresponding position information request category, position information cache data which correspond to the request category and have the cache time closest to the time of acquiring the current position information request are read in a preset position information cache region, when the time interval between the time of acquiring the current position information request and the cache time corresponding to the position information cache data is smaller than a preset time threshold value corresponding to the request category, the position information cache data are used as feedback data of the current position information request and are cached in the preset position information cache region, and therefore a satellite positioning function module does not need to be called every time to acquire the current geographic position. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
Optionally, the request types of the current location information request include a first type location request and a second type location request, where the first type location request is a request for obtaining location information based on a network request, and the second type location request is a request for obtaining location information based on a satellite positioning function module.
Optionally, the location cache information obtaining module 620 is further configured to: when the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data is greater than or equal to a preset time threshold corresponding to the request type, and the request type of the current position information request is the first type of position request, reading the caching time of the position caching data of the primary second type of position request which is before the current position information request and is closest to the time of acquiring the current position information request;
the location information feedback module 630 is further configured to use the location cache data of the second type of location request as the feedback data of the current location information request when a time interval between the time of obtaining the current location information request and the cache time of the location cache data of the second type of location request is smaller than a preset time threshold corresponding to the first type of location request; otherwise, requesting geographical position information from a server according to the current IP address of the client, and taking the geographical position information fed back by the server as feedback data of the current position information request; and caching the feedback data of the current position information request into the preset position information cache region.
Optionally, the position information feedback module 630 is further configured to: when the time interval between the time of acquiring the current position information request and the request time corresponding to the position information cache data is greater than or equal to a preset time threshold corresponding to the request type and the request type of the current position information request is the second type position request, calling a satellite positioning function module to acquire current geographical position information, using the current geographical position information as feedback information of the current position information request, and caching the current geographical position information into a preset position information cache region;
and when the current geographical position information is failed to be acquired by calling the satellite positioning function module, acquiring feedback information of the current position information request in the first type of position request mode, and caching the feedback information into the preset position information cache region.
Optionally, the position information feedback module 630 is further configured to:
reading the caching time of the position caching data of the first-class position request which is before the current position information request and is closest to the time of acquiring the current position information request;
when the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the first type of position request is smaller than a preset time threshold corresponding to the first type of position request, taking the position caching data of the first type of position request as feedback data of the current position information request;
otherwise, requesting geographical position information from a server according to the current IP address of the client, and taking the geographical position information fed back by the server as feedback data of the current position information request;
and caching the feedback data of the current position information request into the preset position information cache region.
Optionally, the location information acquiring device further includes a service request sending module and a service data processing module:
the service request sending module is used for writing the current IP address of the client into service request information when sending a service request to a server, so that the server feeds back current geographical position information determined according to the current IP address when feeding back service data according to the service request;
the service data processing module is used for reading the current geographical position information from the service data fed back by the server side, and caching the current geographical position information into the preset position information cache region as the position information of a request for acquiring the position information based on a network request.
The position information acquisition device configured at the client terminal provided by the embodiment of the invention can execute the position information acquisition method applied to the client terminal provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE seven
Fig. 8 is a schematic structural diagram of a location information acquiring apparatus configured at a server according to a seventh embodiment of the present invention, which is applicable to a situation of acquiring pre-administrative location information of a terminal, and the apparatus may be implemented in a software and/or hardware manner and integrated into a server device having an application development function.
As shown in fig. 8, the location information acquiring apparatus disposed at the server includes: a request information analysis module 710, a location information acquisition module 720, and a location information feedback module 730.
The request information analysis module 710 is configured to obtain a service request of a client, and analyze request information of the service request; a location information obtaining module 720, configured to, when the request information includes an IP address, obtain geographic location information corresponding to the IP address; the location information feedback module 730 is configured to feed back the geographic location information and the service data related to the service request to the client, so that the client caches the geographic location information as location information of a request for obtaining location information based on a network request in a preset location information cache region.
The position information acquisition device configured at the server side provided by the embodiment of the invention can execute the position information acquisition method applied to the server side provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
According to the technical scheme of the embodiment, when the IP address is analyzed in the network request, the geographic position information corresponding to the IP address is matched, and the matched geographic position information is added into the network request feedback content, so that the geographic position information fed back by the server is cached in the preset position information cache region by the client as the position information of the request for acquiring the position information based on the network request, and the cache information of the geographic position information acquired based on the network request mode is updated. The validity and the real-time performance of the cache information in the preset position information cache region can be ensured to a certain extent, so that the client can conveniently feed back the position information of the subsequently acquired position information request. According to the technical scheme, the problem that the power consumption of the mobile terminal is too high due to the fact that the APP client frequently acquires the geographic position information is time-consuming and high in power consumption is solved, the number of times of calling the satellite positioning function module interface is reduced when the geographic position information is acquired, and the overall power consumption of the application program is reduced while the efficiency of acquiring the geographic position by the application program is improved.
Example eight
Fig. 9 is a schematic structural diagram of a computer device according to an eighth embodiment of the present invention. FIG. 9 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in fig. 9 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention. The computer device 12 may be any terminal device with computing capability, such as a terminal device of an intelligent controller, a server, a mobile phone, and the like.
As shown in FIG. 9, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, and commonly referred to as a "hard drive"). Although not shown in FIG. 9, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be appreciated that although not shown in FIG. 9, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implements a location information acquisition method applied to a client, the method including:
acquiring a current position information request and determining the request type of the current position information request;
according to the request type, reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region, wherein the preset position information cache region caches position information acquired based on the previous position information request;
and when the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data is smaller than a preset time threshold corresponding to the request type, using the position information caching data as feedback data of the current position information request, and caching the feedback data into a preset position information caching area.
Example nine
Fig. 10 is a schematic structural diagram of a server according to a ninth embodiment of the present invention. FIG. 10 illustrates a block diagram of an exemplary server 12 suitable for use in implementing embodiments of the present invention. The server 12 shown in fig. 10 is only an example, and should not bring any limitation to the function and the scope of use of the embodiment of the present invention. The server 12 may be any terminal device with computing capability, such as a smart controller and a terminal device such as a server and a mobile phone.
As shown in FIG. 10, the server 12 is in the form of a general purpose computing device. The components of the server 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by server 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The server 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 10, and commonly referred to as a "hard drive"). Although not shown in FIG. 10, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The server 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the server 12, and/or with any devices (e.g., network card, modem, etc.) that enable the server 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the server 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the server 12 via the bus 18. It should be appreciated that although not shown in FIG. 10, other hardware and/or software modules may be used in conjunction with the server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing the location information acquisition method applied to the server side provided by the embodiment of the present invention, the method includes:
acquiring a service request of a client, and analyzing request information of the service request;
when the request information contains an IP address, acquiring geographical position information corresponding to the IP address;
and feeding back the geographical position information and the service data related to the service request to the client side together so that the client side caches the geographical position information as the position information of a request for acquiring the position information based on a network request to a preset position information cache region.
Example ten
This embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement a location information acquisition method applied to a client or a server according to any embodiment of the present invention.
The position information acquisition method applied to the client comprises the following steps:
acquiring a current position information request and determining the request type of the current position information request;
according to the request type, reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region, wherein the preset position information cache region caches position information acquired based on the previous position information request;
and when the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data is smaller than a preset time threshold corresponding to the request type, using the position information caching data as feedback data of the current position information request, and caching the feedback data into a preset position information caching area.
The position information acquisition method applied to the server side comprises the following steps:
acquiring a service request of a client, and analyzing request information of the service request;
when the request information contains an IP address, acquiring geographical position information corresponding to the IP address;
and feeding back the geographical position information and the service data related to the service request to the client side together so that the client side caches the geographical position information as the position information of a request for acquiring the position information based on a network request to a preset position information cache region.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps 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 computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A position information acquisition method is applied to a client, and is characterized by comprising the following steps:
acquiring a current position information request and determining the request type of the current position information request;
according to the request type, reading position information cache data which corresponds to the request type and has the cache time closest to the time of acquiring the current position information request in a preset position information cache region, wherein the preset position information cache region caches position information acquired based on the previous position information request;
and when the time interval between the time of acquiring the current position information request and the caching time corresponding to the position information caching data is smaller than the preset time threshold corresponding to the request type, using the position information caching data as feedback data of the current position information request.
2. The method of claim 1, wherein the request categories of the current location information request comprise a first type of location request and a second type of location request, wherein the first type of location request is a request for obtaining location information based on a network request, and wherein the second type of location request is a request for obtaining location information based on a satellite positioning function module.
3. The method according to claim 2, wherein when a time interval between the time when the current location information request is acquired and the caching time corresponding to the location information caching data is greater than or equal to a preset time threshold corresponding to the request category, and the request category of the current location information request is the first type of location request, the method further comprises:
reading the caching time of the position caching data of the primary second-class position request which is before the current position information request and is closest to the time of acquiring the current position information request;
when the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the second type of position request is smaller than a preset time threshold corresponding to the first type of position request, taking the position caching data of the second type of position request as feedback data of the current position information request;
otherwise, requesting geographical position information from a server according to the current IP address of the client, and taking the geographical position information fed back by the server as feedback data of the current position information request;
and caching the feedback data of the current position information request into the preset position information cache region.
4. The method according to claim 2, wherein a time interval between the time when the current location information request is acquired and the request time corresponding to the location information cache data is greater than or equal to a preset time threshold corresponding to the request type, and when the request type of the current location information request is the second type of location request, the method further comprises:
calling a satellite positioning function module to acquire current geographical position information, taking the current geographical position information as feedback information of the current position information request, and caching the current geographical position information into the preset position information cache region;
and when the current geographical position information is failed to be acquired by calling the satellite positioning function module, acquiring feedback information of the current position information request in the first type of position request mode, and caching the feedback information into the preset position information cache region.
5. The method according to claim 4, wherein the obtaining the feedback information of the current location information request by the first type of location request manner includes:
reading the caching time of the position caching data of the first-class position request which is before the current position information request and is closest to the time of acquiring the current position information request;
when the time interval between the time of acquiring the current position information request and the caching time of the position caching data of the first type of position request is smaller than a preset time threshold corresponding to the first type of position request, taking the position caching data of the first type of position request as feedback data of the current position information request;
otherwise, requesting geographical position information from a server according to the current IP address of the client, and taking the geographical position information fed back by the server as feedback data of the current position information request;
and caching the feedback data of the current position information request into the preset position information cache region.
6. The method according to any one of claims 1-5, further comprising:
when a service request is sent to a server, writing the current IP address of the client into service request information so that the server feeds back current geographical position information determined according to the current IP address when feeding back service data according to the service request;
and reading the current geographical position information from the service data fed back by the server, and caching the current geographical position information into the preset position information cache region as position information of a request for acquiring the position information based on a network request.
7. A position information acquisition method is applied to a server side, and is characterized by comprising the following steps:
acquiring a service request of a client, and analyzing request information of the service request;
when the request information contains an IP address, acquiring geographical position information corresponding to the IP address;
and feeding back the geographical position information and the service data related to the service request to the client side together so that the client side caches the geographical position information as the position information of a request for acquiring the position information based on a network request to a preset position information cache region.
8. A position information acquisition apparatus, provided at a client, the apparatus comprising:
a request type determining module, configured to obtain a current location information request and determine a request type of the current location information request;
a location cache information obtaining module, configured to read, according to the request type, location information cache data that corresponds to the request type and has a cache time closest to a time at which the current location information request is obtained, in a preset location information cache region, where location information obtained based on a previous location information request is cached in the preset location information cache region;
and the position information feedback module is used for taking the position information cache data as feedback data of the current position information request when the time interval between the time of acquiring the current position information request and the cache request time corresponding to the position information cache data is less than a preset time threshold corresponding to the request type.
9. A position information acquiring apparatus configured at a server, the apparatus comprising:
the request information analysis module is used for acquiring a service request of a client and analyzing request information of the service request;
the position information acquisition module is used for acquiring geographical position information corresponding to the IP address when the request information contains the IP address;
and the position information feedback module is used for feeding back the geographical position information and the service data related to the service request to the client side together so that the client side caches the geographical position information as the position information of the request for acquiring the position information based on the network request to a preset position information cache region.
10. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the location information acquisition method of any one of claims 1-6.
11. A server, characterized in that the server comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the location information acquisition method of claim 7.
12. A computer-readable storage medium on which a computer program is stored, the program, when being executed by a processor, implementing the position information acquisition method according to any one of claims 1 to 7.
CN202111572475.4A 2021-12-21 2021-12-21 Position information acquisition method, device, equipment and medium Pending CN114268662A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111572475.4A CN114268662A (en) 2021-12-21 2021-12-21 Position information acquisition method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111572475.4A CN114268662A (en) 2021-12-21 2021-12-21 Position information acquisition method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114268662A true CN114268662A (en) 2022-04-01

Family

ID=80828235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111572475.4A Pending CN114268662A (en) 2021-12-21 2021-12-21 Position information acquisition method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114268662A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002081958A (en) * 2000-09-08 2002-03-22 Nippon Telegr & Teleph Corp <Ntt> Method for acquiring positional information
CN104468771A (en) * 2014-12-03 2015-03-25 北京国双科技有限公司 Method and device for determining geographical position
CN106851583A (en) * 2017-04-07 2017-06-13 广东欧珀移动通信有限公司 The location information acquisition method of mobile terminal, device and mobile terminal
CN106953928A (en) * 2017-04-28 2017-07-14 上海与德科技有限公司 The acquisition methods and device of positional information
CN107295073A (en) * 2017-06-13 2017-10-24 腾讯科技(深圳)有限公司 A kind of localization method, positioner and storage medium
CN109040209A (en) * 2018-07-23 2018-12-18 深圳市牛鼎丰科技有限公司 Intercept method, apparatus, computer equipment and the storage medium of repetitive requests
US11010447B1 (en) * 2018-06-12 2021-05-18 Rich Context Llc Systems, devices, and methods for presenting customized content through web API

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002081958A (en) * 2000-09-08 2002-03-22 Nippon Telegr & Teleph Corp <Ntt> Method for acquiring positional information
CN104468771A (en) * 2014-12-03 2015-03-25 北京国双科技有限公司 Method and device for determining geographical position
CN106851583A (en) * 2017-04-07 2017-06-13 广东欧珀移动通信有限公司 The location information acquisition method of mobile terminal, device and mobile terminal
CN106953928A (en) * 2017-04-28 2017-07-14 上海与德科技有限公司 The acquisition methods and device of positional information
CN107295073A (en) * 2017-06-13 2017-10-24 腾讯科技(深圳)有限公司 A kind of localization method, positioner and storage medium
US11010447B1 (en) * 2018-06-12 2021-05-18 Rich Context Llc Systems, devices, and methods for presenting customized content through web API
CN109040209A (en) * 2018-07-23 2018-12-18 深圳市牛鼎丰科技有限公司 Intercept method, apparatus, computer equipment and the storage medium of repetitive requests

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
梁莉菁;: "基于Geolocation API的Html5地理位置追踪定位的实现", 萍乡高等专科学校学报, no. 06 *

Similar Documents

Publication Publication Date Title
CN110109953B (en) Data query method, device and equipment
CN110032459B (en) Message queue configuration method and device, computer equipment and storage medium
CN110134869B (en) Information pushing method, device, equipment and storage medium
CN112860706A (en) Service processing method, device, equipment and storage medium
CN111737564A (en) Information query method, device, equipment and medium
CN110110236B (en) Information pushing method, device, equipment and storage medium
CN110955640A (en) Cross-system data file processing method, device, server and storage medium
CN109639813B (en) Video file transmission processing method and device, electronic equipment and storage medium
US10129362B2 (en) Caching system
CN113760242A (en) Data processing method, device, server and medium
CN113656193A (en) Application communication method, system, electronic equipment and storage medium
US20040068540A1 (en) Coordination of data received from one or more sources over one or more channels into a single context
CN113763008A (en) Application promotion tracking method, device, server, equipment and medium
CN110969479B (en) Method, equipment and computer storage medium for displaying popularization resources
CN114268662A (en) Position information acquisition method, device, equipment and medium
CN114205455B (en) Application positioning processing method and device
CN110377654B (en) Data request processing method and device, electronic equipment and computer-readable storage medium
CN115587860A (en) Service processing method, device, storage medium and electronic equipment
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN110753136A (en) Domain name resolution method, device, equipment and storage medium
US8296055B2 (en) Method and system for positional communication
CN111045823A (en) Context data load distribution method, device, equipment and storage medium
CN111600944B (en) Data processing method, device, equipment and storage medium
CN113778711B (en) Event processing method and device, electronic 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