Position feedback method, position setting method, device, equipment and medium

By receiving the location acquisition request and responding to obtaining application location configuration information, determining and feedbacking virtual location information, the problem of difficulty in effectively setting and feedback application location in the prior art is solved, and the flexibility and operability of application location are achieved.

CN114650507BActive Publication Date: 2025-04-22QINGDAO CHANGSUO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210176272.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2025-04-22
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

The prior art is difficult to effectively solve the problem of feedback and setting locations for applications, especially when users need to specify publishing locations, check-in locations or photo locations, and lack of flexible and operational position settings solutions.

Method used

A position feedback method is provided, by receiving a position acquisition request, in response to obtaining the application location configuration information of the first application, determining the virtual location information based on the information, and feedback to the requesting party. The virtual location information is preset by the first application, and supports the user to specify a location for the application at any time.

Benefits of technology

The function of setting virtual location information for the application is realized, bringing flexibility and operability to users, allowing location-based applications to more flexibly set and feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114650507B_ABST
    Figure CN114650507B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a location feedback method, device, electronic device and storage medium, which receives a location acquisition request, responds to the location acquisition request, obtains application location configuration information of a first application, and determines virtual location information corresponding to the location acquisition request based on the application location configuration information, wherein the virtual location information is pre-set by the first application, and the virtual location information is fed back so that the virtual location information set by the first application for the application can be fed back to the application when the application requests a location, thereby realizing the function of setting virtual location information for the application, so that the user can specify a location for the application at any time, which brings flexibility and operability to location-based applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a position feedback method, a position setting method, a position feedback device, a position setting device, an electronic device and a storage medium. Background Art

[0002] Currently, location-based services are increasingly used in people's lives and work.

[0003] In some cases, people want to provide a specific location. For example, when publishing content in instant messaging software or review software, users want to specify the location of the posting. For another example, in some applications, users want to specify the location of the check-in. For another example, in some photo-taking software, users want to specify the location of the photo. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a position feedback method, a position setting method, device, electronic device and storage medium, so as to solve the problem of providing feedback and setting position for an application.

[0005] In order to solve the above problem, in a first aspect of the implementation of the present invention, a position feedback method is first provided, comprising:

[0006] Receive a location acquisition request;

[0007] In response to the location acquisition request, acquiring application location configuration information of the first application;

[0008] Determining virtual location information corresponding to the location acquisition request according to the application location configuration information, wherein the virtual location information is preset by the first application;

[0009] The virtual location information is fed back.

[0010] Optionally, the receiving a location acquisition request includes:

[0011] The location acquisition request sent by the second application is received.

[0012] Optionally, in response to the location acquisition request, acquiring application location configuration information of the first application includes:

[0013] Get location information through the location provider;

[0014] Based on the location information obtained by the location provider being set invalid location information, the application location configuration information saved by the first application is obtained.

[0015] Optionally, determining the virtual location information corresponding to the location acquisition request according to the application location configuration information includes:

[0016] Based on the fact that the system has not been restarted and / or the application location configuration information has not been updated, obtaining a singleton object storing the application location configuration information;

[0017] The virtual location information corresponding to the location acquisition request is obtained from the singleton object.

[0018] Optionally, in response to the location acquisition request, acquiring application location configuration information of the first application includes:

[0019] Creating a singleton object based on system restart and / or update of the application location configuration information;

[0020] Reading the application location configuration information saved by the first application;

[0021] The application location configuration information is stored in the singleton object.

[0022] Optionally, determining the virtual location information corresponding to the location acquisition request according to the application location configuration information includes:

[0023] Parsing the location configuration information for the second application from the application location configuration information according to the unique identification information of the second application carried in the location acquisition request;

[0024] Determining, according to the location configuration information for the second application, that a virtual location information function of the second application is enabled;

[0025] According to the location configuration information for the second application, virtual location information corresponding to the second application is determined.

[0026] Optionally, the method further comprises:

[0027] Determining, according to the location configuration information for the second application, that the first application has not set virtual location information corresponding to the second application;

[0028] Obtaining preset virtual location information from the application location configuration information;

[0029] The preset virtual location information is fed back to the second application.

[0030] Optionally, the method further comprises:

[0031] Determining, according to the location configuration information for the second application, that the virtual location information function of the second application is not enabled;

[0032] Get real-time location information;

[0033] The real-time location information is fed back to the second application.

[0034] In a second aspect of the present invention, a location setting method is first provided, which is applied to a first application and includes:

[0035] Set the virtual location information corresponding to the application;

[0036] The virtual location information corresponding to the application is stored in the application location configuration information for responding to a location acquisition request of the application, the application location configuration information is acquired, the virtual location information corresponding to the location acquisition request is determined based on the application location configuration information, and the virtual location information is provided to the application corresponding to the location acquisition request.

[0037] In a third aspect of the present invention, a position feedback device is provided, comprising:

[0038] A request receiving module, used for receiving a location acquisition request;

[0039] An information acquisition module, configured to acquire application location configuration information of the first application in response to the location acquisition request;

[0040] An information determination module, configured to determine virtual location information corresponding to the location acquisition request according to the application location configuration information, wherein the virtual location information is preset by the first application;

[0041] The information feedback module is used to feed back the virtual location information.

[0042] Optionally, the request receiving module includes:

[0043] The request receiving submodule is used to receive the location acquisition request sent by the second application.

[0044] Optionally, the information acquisition module includes:

[0045] A first information acquisition submodule, used to acquire location information through a location provider;

[0046] The second information acquisition submodule is used to acquire the application location configuration information saved by the first application based on that the location information acquired by the location provider is set as invalid location information.

[0047] Optionally, the information determination module includes:

[0048] An object acquisition submodule, used for acquiring a singleton object storing the application location configuration information based on the system not being restarted and / or the application location configuration information not being updated;

[0049] The third information acquisition submodule is used to obtain the virtual location information corresponding to the location acquisition request from the singleton object.

[0050] Optionally, the information acquisition module includes:

[0051] An object creation submodule, used to create a singleton object based on system restart and / or update of the application location configuration information;

[0052] An information reading submodule, used to read the application location configuration information saved by the first application;

[0053] The information storage submodule is used to store the application location configuration information into the singleton object.

[0054] Optionally, the information determination module includes:

[0055] An information parsing submodule, configured to parse the location configuration information for the second application from the application location configuration information according to the unique identification information of the second application carried in the location acquisition request;

[0056] An activation determination submodule, configured to determine, based on the location configuration information for the second application, whether the virtual location information function of the second application is activated;

[0057] The information determination submodule is used to determine the virtual location information corresponding to the second application according to the location configuration information for the second application.

[0058] Optionally, the device further comprises:

[0059] A setting determination module, configured to determine, based on the location configuration information for the second application, that the first application has not set the virtual location information corresponding to the second application;

[0060] A second information acquisition module, used to acquire preset virtual location information from the application location configuration information;

[0061] The second information feedback module is used to feed back the preset virtual location information to the second application.

[0062] Optionally, the device further comprises:

[0063] a not enabled determining module, configured to determine, based on the location configuration information for the second application, that the virtual location information function of the second application is not enabled;

[0064] The third information acquisition module is used to obtain real-time location information;

[0065] The third information feedback module is used to feed back the real-time location information to the second application.

[0066] In a fourth aspect of the present invention, a position setting device is provided, which is applied to a first application and includes:

[0067] An information setting module, used to set the virtual location information corresponding to the application;

[0068] An information storage module is used to store the virtual location information corresponding to the application into the application location configuration information, so as to obtain the application location configuration information in response to the location acquisition request of the application, determine the virtual location information corresponding to the location acquisition request based on the application location configuration information, and provide the virtual location information to the application corresponding to the location acquisition request.

[0069] In another aspect of the present invention, there is provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0070] Memory, used to store computer programs;

[0071] The processor is used to implement any of the above-mentioned method steps when executing the program stored in the memory.

[0072] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-described methods.

[0073] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-described methods.

[0074] According to an embodiment of the present invention, a location acquisition request is received, application location configuration information of a first application is acquired in response to the location acquisition request, and virtual location information corresponding to the location acquisition request is determined based on the application location configuration information, wherein the virtual location information is pre-set by the first application, and the virtual location information is fed back so that the virtual location information set for the application by the first application can be fed back to the application when the application requests the location, thereby realizing the function of setting virtual location information for the application, so that the user can specify a location for the application at any time, which brings flexibility and operability to location-based applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0076] Figure 1 A flow chart showing the steps of a position feedback method embodiment of the present invention is shown;

[0077] Figure 2 A schematic diagram of an interface call is shown;

[0078] Figure 3a A schematic diagram showing that the position cannot be obtained in time when the positioning signal is poor;

[0079] Figure 3b A schematic diagram showing that the position cannot be obtained in time when the positioning signal is poor;

[0080] Figure 4a A schematic diagram showing an application frequently obtaining location information;

[0081] Figure 4b A schematic diagram showing an application frequently obtaining location information;

[0082] Figure 5 A schematic diagram showing the interface call when the application location configuration information is updated;

[0083] Figure 6 A flow chart showing the steps of a position feedback method embodiment of the present invention is shown;

[0084] Figure 7 A schematic diagram showing location information acquisition;

[0085] Figure 8 A flow chart showing the steps of a position feedback method embodiment of the present invention is shown;

[0086] Fig. 9 A schematic diagram showing the setting of virtual location information;

[0087] Fig.10 A structural block diagram of an embodiment of a position feedback device of the present invention is shown;

[0088] Fig.11 A structural block diagram of an embodiment of a position setting device of the present invention is shown;

[0089] Fig.12 A schematic diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0090] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0091] Reference Figure 1 , shows a flow chart of steps of a position feedback method embodiment of the present invention, which may specifically include the following steps:

[0092] Step 101: Receive a location acquisition request.

[0093] In the embodiment of the present invention, the location acquisition request is a request sent by the application to the operating system or the electronic device to obtain the location. After receiving the location acquisition request, the operating system or the electronic device feeds back the location to the application in response to the request.

[0094] Step 102: In response to the location acquisition request, acquire application location configuration information of the first application.

[0095] In the embodiment of the present invention, the first application may be an application dedicated to setting a location for other applications, or may be any application, such as an instant messaging application, a review application, a map application, a photo application, etc., and may specifically include any applicable application, which is not limited in the embodiment of the present invention.

[0096] In an embodiment of the present invention, the application location configuration information is configuration information generated by the first application setting the location for any application. The location information set by the first application for any application is recorded as virtual location information. The virtual location information can be generated by a user, for example, by clicking on a map or by selecting in a drop-down list. The virtual location information can be recorded in the application location configuration information.

[0097] In the embodiment of the present invention, the application location configuration information is preset by the first application. After receiving a location acquisition request from another application, the operating system or the electronic device acquires the application location configuration information in response to the location acquisition request.

[0098] For example, the virtual location information function is implemented based on the Android R version MTK (MediaTek, an embedded real-time operating system) platform. Users can set different virtual location information for any second application through the first application, such as location information represented by longitude and latitude, or descriptive location information (country, city, street, community). The application location configuration information preset by the first application is stored in the data / data / partition of the terminal in the form of an xml (eXtensible Markup Language) file. When the second application requests location information, it obtains the application location configuration information.

[0099] In an optional embodiment of the present invention, in a specific implementation method of obtaining application location configuration information of a first application, the application location configuration information saved by the first application is obtained through the modified system interface of the present invention.

[0100] When an application obtains location information through the original system interface, the system interface returns real-time location information. In order to provide virtual location information to the application, the system interface needs to be modified. The modified system interface will not provide real-time location information to the application, but will provide virtual location information to the application. Among them, the modified system interface will first obtain the application location configuration information saved by the first application.

[0101] For example, the Framework layer is customized and modified. A new location information parsing file is added in the Framework location directory: LocationXmlParsing.java, which is used to obtain and parse the configuration file storing the virtual location information of the second application, that is, the application location configuration information. The specific system interface obtains the interface call of the country, city, longitude, latitude and other location information, such as Figure 2The schematic diagram of the interface call shown. When the second application B turns on GPS (Global Positioning System) and network positioning, the LocationListener of the second application B will obtain the location information through the Framework's system interface, for example, the system interface for obtaining longitude and latitude information: Location.GetLatitude() (the interface for obtaining latitude at location), Location.GetLongitude() (the interface for obtaining longitude at location), the system interface for obtaining address information: Address.getLocality() (the interface for obtaining region at address), Address.getCountryName() (the interface for obtaining country at address), Address.getLatitude() (the interface for obtaining latitude at address), Address.getLongtude() (the interface for obtaining longitude at address), the system interface for obtaining geocoding: Geocoder.getFromLocation() (the interface for obtaining geocoding from location), etc. The above system interfaces have been modified. When executing the above-mentioned modified system interface, the Framework calls the getLatitude(), getLongitude(), getCountryName(), getLocality() and other methods of the newly added class LocationXmlParsing to return the virtual location information set by the first application A for the second application B, so that Location.java, Address.java, Geocoder.java obtain the longitude, latitude, country, city and other data information and return it to the second application B.

[0102] Step 103: Determine virtual location information corresponding to the location acquisition request according to the application location configuration information, wherein the virtual location information is pre-set by the first application.

[0103] In an embodiment of the present invention, the first application sets virtual location information for other applications in advance and saves it in the application location configuration information. Then, according to the application location configuration information, the virtual location information of other applications set by the first application can be determined by parsing.

[0104] For example, when the second application obtains the location information through the Android system interface, the virtual location information set for it by the first application is parsed from the application location configuration information.

[0105] Step 104: Feedback the virtual location information.

[0106] In an embodiment of the present invention, the virtual location information is fed back to the issuer of the location acquisition request. A specific implementation method is: the virtual location information is fed back to the issuer of the location acquisition request through a system interface. The system interface is an interface for feeding back location information to an application, for example, an interface for obtaining latitude and an interface for obtaining longitude in the Location.java file related to longitude and latitude, an interface for obtaining address in the Address.java file related to address, and an interface for obtaining geocode in the Geocoder.java file related to geocode, etc.

[0107] According to an embodiment of the present invention, a location acquisition request is received, application location configuration information of a first application is acquired in response to the location acquisition request, and virtual location information corresponding to the location acquisition request is determined based on the application location configuration information, wherein the virtual location information is pre-set by the first application, and the virtual location information is fed back so that the virtual location information set for the application by the first application can be fed back to the application when the application requests the location, thereby realizing the function of setting virtual location information for the application, so that the user can specify a location for the application at any time, which brings flexibility and operability to location-based applications.

[0108] In an optional embodiment of the present invention, step 101 includes: receiving the location acquisition request sent by the second application.

[0109] The second application may be any application. For example, an instant messaging application, a review application, a map application, a photo application, etc., and may include any applicable application, which is not limited in the embodiment of the present invention. The second application sends a location acquisition request to the operating system or the electronic device.

[0110] In an optional embodiment of the present invention, step 102 includes: obtaining location information through a location provider, and based on the location information obtained by the location provider being set invalid location information, obtaining the application location configuration information saved by the first application.

[0111] The invalid location information is the set location information returned by the location provider when the real-time location information cannot be obtained, for example, the initial value of longitude and latitude (0, 0) when registering LocationProvider.

[0112] Some applications obtain location information through the LocationProvider location provider. Usually, they need to wait for the system to trigger the onLocationChanged callback interface of LocationListener to update the initialized location information. However, in indoor environments with tall buildings or densely populated streets, the network signal is poor. A-GPS (Assisted GPS, a technology that combines network base station information and GPS information to locate mobile stations) is affected by the environment. The system side is slow to obtain real-time location information, and often fails to receive the onLocationChanged callback, resulting in the location information being displayed as empty.

[0113] For example, Figure 3a The diagram shown shows that the location cannot be obtained in time when the positioning signal is poor. The second application B obtains location information through LocationProvider when taking pictures. The location information is obtained by monitoring the system callback through onLocationChanged of LocationListener. When the second application B obtains the location information, it has not received the system callback due to the influence of the environment, network signal, and A-GPS. Calling Location.java returns the initial value (0, 0) when registering LocationProvider. Location.java performs longitude and latitude detection when parsing location information. When the longitude and latitude (0, 0) are invalid longitude and latitude (that is, invalid location information), it returns null and no location information is displayed.

[0114] The present invention modifies the system interface for obtaining location information so that the virtual location information configured by the first application for the application is returned by default, including when invalid location information is obtained, that is, when the application initializes the location, the virtual location information can be obtained, and there is no need to wait for a callback to update the invalid location information set when the location object is initialized. The above method removes the influence of external factors such as the network and GPS, thereby ensuring that when the application obtains location information in any time period, the virtual location information configured by the first application can be successfully returned, and the virtual location information function can still be realized under poor network and GPS positioning conditions.

[0115] For example, Figure 3b The schematic diagram of the inability to obtain the position in time when the positioning signal is poor is shown. Modify the system interface for obtaining the position information in the Location.java of the Framework. Parse the position configuration for the uid (user ID) of the second application B in Location.java, that is, apply the position configuration information. Return the configured virtual position information.

[0116] In an optional embodiment of the present invention, step 102 may include: creating a singleton object based on system restart and / or update of the application location configuration information; reading the application location configuration information saved by the first application; and storing the application location configuration information in the singleton object.

[0117] When some applications are performing location positioning, they continuously obtain location information. If the application location configuration information set by the first application for the application is parsed in real time, a large cache will be generated, affecting the operation of the system.

[0118] For example, Figure 4a The schematic diagram of the application frequently obtaining location information is shown. When the second application B that obtains location information in real time, such as maps, performs location positioning, it continuously obtains longitude and latitude information through Location, and obtains location information from time to time through Address and Geocoder. The second application B needs to obtain location information. Create a stream object and read the file of application location configuration information that stores virtual location information. Close the stream object. Call the interface for obtaining location information. The interface for obtaining location information is frequently called and parsed in real time as virtual location information stored by the second application B. Continuous calls in a loop will cause a large cache occupancy and affect system operation.

[0119] To this end, an embodiment of the present invention proposes to adopt a singleton mode to parse virtual location information. When an application obtains location information, it first determines whether the system is restarted and / or whether the application location configuration information is updated. If the system is restarted and / or the application location configuration information is updated, a singleton object is created. Read the application location configuration information saved by the first application; store the application location configuration information in the singleton object. Only when the first application updates the application location configuration information or the device is restarted, will the global application's location information update and parsing be triggered to avoid frequent acquisition of application location configuration information.

[0120] In an optional embodiment of the present invention, step 103 includes: based on the system not being restarted and / or the application location configuration information not being updated, obtaining a singleton object storing the application location configuration information, and obtaining virtual location information corresponding to the location acquisition request from the singleton object. When the user does not update the virtual location and the device is not restarted, it is ensured that when each application obtains location information, the framework layer only reads the stored virtual location information once, thereby avoiding unnecessary cache accumulation.

[0121] For example, Figure 4bThe schematic diagram of the application frequently obtaining location information is shown. When the second application B needs to obtain the location information, first determine whether it is the system startup or the configuration of the virtual location information is updated. If it is the system startup or the configuration of the virtual location information is updated, create a singleton object, create a stream object, and read the persistent xml file that stores the application location configuration information of the virtual location. Update the singleton object and close the stream object. Return the singleton object that stores the virtual location information, and read the configuration of the location information of the second application B from the singleton object. Return the location information through Location.java, or Address.java, or Geocoder.java. If it is not the system startup or the configuration of the virtual location information is updated, directly return the singleton object that stores the virtual location information, and read the configuration of the location information of the second application B from the singleton object. Return the location information through Location.java, or Address.java, or Geocoder.java.

[0122] In addition, if Figure 5 The diagram shown is a schematic diagram of the interface call when the application location configuration information is updated. The first application A sets the virtual location information for the second application B. Call the policy manager to obtain the singleton location change interface PolicyManager.getInstance().locationStrChangeXml(). The location change interface locationStrChangeXml() calls the update file interface LocationXmlParsing.getLocationXmlParsing.updatXml() for obtaining the location configuration file. Add the updateXml() method in LocationXmlParsing.java and call the interface getLocationXmlParsing() for obtaining the application location configuration information. Execute getLatitude(), getLongitude(), getCountryName(), and getLocality() in the LocationXmlParsing file once. Return the location information to the second application B through Location.java, or Address.java, or Geocoder.java.

[0123] Reference Figure 6 , shows a flow chart of steps of a position feedback method embodiment of the present invention, which may specifically include the following steps:

[0124] Step 201: Receive a location acquisition request.

[0125] In the embodiment of the present invention, the specific implementation method of this step can refer to the description in the aforementioned embodiment and will not be further described here.

[0126] Step 202: In response to the location acquisition request, acquire application location configuration information of the first application.

[0127] In the embodiment of the present invention, the specific implementation method of this step can refer to the description in the aforementioned embodiment and will not be further described here.

[0128] Step 203: According to the unique identification information of the second application carried in the location acquisition request, the location configuration information for the second application is parsed from the application location configuration information.

[0129] In the embodiment of the present invention, the unique identification information of the second application refers to information that can uniquely identify the application, such as the UID (User Identification, user identity), PackageName (name of the software package), and PID (Process Identification, process identity) of the application. The unique identification information can be the UID and PackageName, and can also be added with the PID. The location acquisition request carries the unique identification information.

[0130] The application location configuration information stores the unique identification information of the second application and the corresponding location configuration information. The location configuration information includes, but is not limited to, information indicating whether the virtual location information function of the application is enabled, virtual location information, and the like.

[0131] For example, Figure 7 The schematic diagram of location information acquisition is shown. The second application B calls the system interface to obtain location information. Call the location configuration information acquisition interface LocationXmlParsing.getLocationXmlParsing() in the Location.java, or Address.java, or Geocoder.java file. In LocationXmlParsing, the saved application location configuration information is looped through, and the location configuration information corresponding to the virtual location information is parsed according to the UID, PackageName, and PID of the second application B. According to the location configuration information, determine whether to enable the virtual location information function.

[0132] After step 203, step 204 or step 210 is executed according to whether the virtual location information function of the second application is turned on.

[0133] Step 204: Determine, based on the location configuration information for the second application, whether the virtual location information function of the second application is enabled.

[0134] In the embodiment of the present invention, the location configuration information for the second application stores indication information of whether the second application has enabled the virtual location information function. According to the location configuration information, it can be determined that the virtual location information function of the second application has been enabled.

[0135] After step 204, step 205 or step 206 is executed according to whether the virtual location information is set for the second application.

[0136] Step 205: Determine virtual location information corresponding to the second application based on the location configuration information for the second application.

[0137] In an embodiment of the present invention, when the virtual location information function of the second application is enabled and the first application has pre-set virtual location information for the second application, the virtual location information corresponding to the second application can be parsed from the location configuration information for the second application.

[0138] For example, Figure 7 As shown, when the second application B turns on the virtual location information function and configures the virtual location information, the configured virtual location information is returned to the second application B.

[0139] Step 206: Feedback the virtual location information.

[0140] In the embodiment of the present invention, the specific implementation method of this step can refer to the description in the aforementioned embodiment and will not be further described here.

[0141] Step 207: Determine, based on the location configuration information for the second application, that the first application has not set virtual location information corresponding to the second application.

[0142] In the embodiment of the present invention, when the virtual location information function of the second application is turned on, sometimes the second application is not set with virtual location information by the first application. In the location configuration information of the second application, the virtual location information corresponding to the second application cannot be parsed.

[0143] Step 208: Obtain preset virtual location information from the application location configuration information.

[0144] In an embodiment of the present invention, preset virtual location information is stored in the application location configuration information. For example, the first virtual location information in the application location configuration information is used as the preset virtual location information. When the virtual location information of the second application is not set by the first application, the preset virtual location information is used as the virtual location information of the second application.

[0145] Step 209: Feedback the preset virtual location information to the second application.

[0146] In the embodiment of the present invention, the preset virtual location information is fed back to the second application through the system interface. Figure 7 As shown, when the second application B turns on the virtual location information function and does not configure the virtual location information, the first virtual location information in the virtual location information is fed back to the second application B by default.

[0147] Step 210: Determine, based on the location configuration information for the second application, that the virtual location information function of the second application is not enabled.

[0148] In the embodiment of the present invention, according to the location configuration information, it can be determined that the virtual location information function of the second application is not enabled. In this case, the real-time location information is returned, so as to flexibly switch between the real-time location information and the virtual location information of the second application.

[0149] Step 211, obtaining real-time location information.

[0150] In the embodiment of the present invention, the real-time location information is obtained through a system interface, for example, the current real-time location information is obtained through GPS.

[0151] Step 212: Feedback the real-time location information to the second application.

[0152] In the embodiment of the present invention, the real-time location information is fed back to the second application through the system interface. Figure 7 As shown, when the second application B does not turn on the virtual location information function, the real-time location information is fed back to the second application B.

[0153] According to an embodiment of the present invention, by receiving a location acquisition request, in response to the location acquisition request, application location configuration information of a first application is acquired; according to the unique identification information of the second application carried in the location acquisition request, the location configuration information for the second application is parsed from the application location configuration information; according to the location configuration information for the second application, it is determined that the virtual location information function of the second application is enabled; according to the location configuration information for the second application, the virtual location information corresponding to the second application is determined, and the virtual location information is fed back; according to the location configuration information for the second application, it is determined that the first application has not set the virtual location information corresponding to the second application; from the application location configuration information, preset virtual location information is acquired, and the preset virtual location information is fed back to the second application; according to the location configuration information for the second application, it is determined that the virtual location information function of the second application is not enabled; real-time location information is acquired, and the real-time location information is fed back to the second application, so that the virtual location information set by the first application for the second application can be fed back to the second application, thereby realizing the function of setting virtual location information for the application, so that the user can specify a location for the application at any time, bringing flexibility and operability to location-based applications.

[0154] Reference Figure 8 , shows a flowchart of a method for setting a location according to an embodiment of the present invention, which is applied to a first application and may specifically include the following steps:

[0155] Step 301, setting virtual location information corresponding to the application.

[0156] In the embodiment of the present invention, the first application first obtains the installed applications and selects the application for which the virtual location information is to be set. Fig. 9 Schematic diagram of the setting of virtual location information shown. In the first application A of the virtual information setting, the interface obtains the applications installed on the current terminal through PackageMangerService (installation package management service), and displays PackageName, Icon and other information through ListView (list view) for selection. It supports whether to configure the virtual location for the application. If the configuration is no, the virtual location information function is not turned on, and the real-time location information is used. If the configuration is yes, the virtual location information function is turned on, and the virtual location information is used.

[0157] In the embodiment of the present invention, corresponding virtual location information is set for the application. Fig. 9As shown, if the configuration is yes, that is, the virtual location information function is turned on, the first application A uses the spinner (drop-down control) to filter the country and city in the virtual location configuration library, obtain a set of virtual location information, and complete the virtual configuration of the location information of any second application B in the interface operation. It supports setting virtual country, city, street, community and other location information for any second application B, supports setting different locations for different second applications B, and supports changing the location information configuration at any time. ,

[0158] Step 302, stores the virtual location information corresponding to the application into the application location configuration information, so as to obtain the application location configuration information in response to the location acquisition request of the application, determine the virtual location information corresponding to the location acquisition request based on the application location configuration information, and provide the virtual location information to the application corresponding to the location acquisition request.

[0159] In an embodiment of the present invention, the first application stores the virtual location information corresponding to the application into the application location configuration information. If the file of the application location configuration information does not exist, a new file is created and stored. If the file of the application location configuration information already exists, the virtual location information corresponding to the application is stored into the file.

[0160] For example, Fig. 9 As shown, application A uses List to store the PackageName, UID, and virtual location information of the second application B. <map>It is configured in the form of an XML file and stored in the data / data / partition of the terminal.

[0161] According to an embodiment of the present invention, by setting virtual location information corresponding to an application, the virtual location information corresponding to the application is stored in the application location configuration information, so as to respond to a location acquisition request of the application, obtain the application location configuration information, determine the virtual location information corresponding to the location acquisition request based on the application location configuration information, and provide the virtual location information to the application corresponding to the location acquisition request, so that the first application sets the virtual location information for the application and can feed back to the application, thereby realizing the function of setting virtual location information for the application, so that the user can specify the location for the application at any time, which brings flexibility and operability to location-based applications.

[0162] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0163] Reference Fig.10 , shows a structural block diagram of an embodiment of a position feedback device of the present invention, which may specifically include the following modules:

[0164] A request receiving module 401 is used to receive a location acquisition request;

[0165] The information acquisition module 402 is used to acquire the application location configuration information of the first application in response to the location acquisition request;

[0166] An information determination module 403, configured to determine virtual location information corresponding to the location acquisition request according to the application location configuration information, wherein the virtual location information is preset by the first application;

[0167] The information feedback module 404 is used to feed back the virtual location information.

[0168] Optionally, the request receiving module includes:

[0169] The request receiving submodule is used to receive the location acquisition request sent by the second application.

[0170] Optionally, the information acquisition module includes:

[0171] A first information acquisition submodule, used to acquire location information through a location provider;

[0172] The second information acquisition submodule is used to acquire the application location configuration information saved by the first application based on that the location information acquired by the location provider is set as invalid location information.

[0173] Optionally, the information determination module includes:

[0174] An object acquisition submodule, used for acquiring a singleton object storing the application location configuration information based on the system not being restarted and / or the application location configuration information not being updated;

[0175] The third information acquisition submodule is used to obtain the virtual location information corresponding to the location acquisition request from the singleton object.

[0176] Optionally, the information acquisition module includes:

[0177] An object creation submodule, used to create a singleton object based on system restart and / or update of the application location configuration information;

[0178] An information reading submodule, used to read the application location configuration information saved by the first application;

[0179] The information storage submodule is used to store the application location configuration information into the singleton object.

[0180] Optionally, the information determination module includes:

[0181] An information parsing submodule, configured to parse the location configuration information for the second application from the application location configuration information according to the unique identification information of the second application carried in the location acquisition request;

[0182] An activation determination submodule, configured to determine, based on the location configuration information for the second application, whether the virtual location information function of the second application is activated;

[0183] The information determination submodule is used to determine the virtual location information corresponding to the second application according to the location configuration information for the second application.

[0184] Optionally, the device further comprises:

[0185] A setting determination module, configured to determine, based on the location configuration information for the second application, that the first application has not set the virtual location information corresponding to the second application;

[0186] A second information acquisition module, used to acquire preset virtual location information from the application location configuration information;

[0187] The second information feedback module is used to feed back the preset virtual location information to the second application.

[0188] Optionally, the device further comprises:

[0189] a not enabled determining module, configured to determine, based on the location configuration information for the second application, that the virtual location information function of the second application is not enabled;

[0190] The third information acquisition module is used to obtain real-time location information;

[0191] The third information feedback module is used to feed back the real-time location information to the second application.

[0192] According to an embodiment of the present invention, a location acquisition request is received, application location configuration information of a first application is acquired in response to the location acquisition request, and virtual location information corresponding to the location acquisition request is determined based on the application location configuration information, wherein the virtual location information is pre-set by the first application, and the virtual location information is fed back so that the virtual location information set for the application by the first application can be fed back to the application when the application requests the location, thereby realizing the function of setting virtual location information for the application, so that the user can specify a location for the application at any time, which brings flexibility and operability to location-based applications.

[0193] Reference Fig.11 , shows a structural block diagram of an embodiment of a position setting device of the present invention, which is applied to a first application and may specifically include the following modules:

[0194] The information setting module 501 is used to set the virtual location information corresponding to the application;

[0195] The information storage module 502 is used to store the virtual location information corresponding to the application into the application location configuration information, so as to obtain the application location configuration information in response to the location acquisition request of the application, determine the virtual location information corresponding to the location acquisition request based on the application location configuration information, and provide the virtual location information to the application corresponding to the location acquisition request.

[0196] According to an embodiment of the present invention, by setting virtual location information corresponding to an application, the virtual location information corresponding to the application is stored in the application location configuration information, so as to respond to a location acquisition request of the application, obtain the application location configuration information, determine the virtual location information corresponding to the location acquisition request based on the application location configuration information, and provide the virtual location information to the application corresponding to the location acquisition request, so that the first application sets the virtual location information for the application and can feed back to the application, thereby realizing the function of setting virtual location information for the application, so that the user can specify the location for the application at any time, which brings flexibility and operability to location-based applications.

[0197] The embodiment of the present invention further provides an electronic device, such as Fig.12 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0198] Memory 903, used for storing computer programs;

[0199] The processor 901 is used to implement the steps described in any of the above method embodiments when executing the program stored in the memory 903.

[0200] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0201] The communication interface is used for communication between the above terminal and other devices.

[0202] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0203] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0204] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes any of the methods described in the above embodiments.

[0205] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer is enabled to execute any of the methods described in the above embodiments.

[0206] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0207] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0208] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0209] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.< / map>

Claims

1. A position feedback method, characterized in that: include: Receive a location acquisition request; In response to the location acquisition request, acquiring application location configuration information of the first application; Wherein, in response to the location acquisition request, acquiring the application location configuration information of the first application includes: acquiring location information through a location provider; based on the location information acquired by the location provider being set invalid location information, acquiring the application location configuration information saved by the first application; According to the application location configuration information, determine the virtual location information corresponding to the location acquisition request; wherein the virtual location information is preset by the first application, and the location information is determined Acquiring the virtual location information corresponding to the request includes: acquiring a singleton object storing the application location configuration information based on the system not being restarted and / or the application location configuration information not being updated; acquiring the virtual location information corresponding to the location acquisition request from the singleton object; The virtual location information is fed back.

2. The method according to claim 1, characterized in that The receiving a location acquisition request comprises: The location acquisition request sent by the second application is received.

3. The method according to claim 1 or 2, characterized in that: The acquiring, in response to the location acquisition request, application location configuration information of the first application comprises: Creating a singleton object based on system restart and / or update of the application location configuration information; Reading the application location configuration information saved by the first application; The application location configuration information is stored in the singleton object.

4. The method according to claim 2, characterized in that: The determining, according to the application location configuration information, the virtual location information corresponding to the location acquisition request comprises: Parsing the location configuration information for the second application from the application location configuration information according to the unique identification information of the second application carried in the location acquisition request; Determining, according to the location configuration information for the second application, that a virtual location information function of the second application is enabled; According to the location configuration information for the second application, virtual location information corresponding to the second application is determined.

5. The method according to claim 4, characterized in that The method further comprises: Determining, according to the location configuration information for the second application, that the first application has not set virtual location information corresponding to the second application; Obtaining preset virtual location information from the application location configuration information; The preset virtual location information is fed back to the second application.

6. The method according to claim 4, characterized in that The method further comprises: Determining, according to the location configuration information for the second application, that the virtual location information function of the second application is not enabled; Get real-time location information; The real-time location information is fed back to the second application.

7. A method for setting a position, characterized in that: Applied to the first application, including: Set the virtual location information corresponding to the application; storing the virtual location information corresponding to the application into the application location configuration information, so as to obtain the application location configuration information in response to a location acquisition request of the application; Wherein, in response to the location acquisition request, acquiring the application location configuration information includes: Acquire location information through a location provider; acquire the application location configuration information based on the location information acquired by the location provider being set invalid location information; According to the application location configuration information, determine the virtual location information corresponding to the location acquisition request; wherein the determining the virtual location information corresponding to the location acquisition request includes: based on the system If the application location configuration information is restarted and / or not updated, obtaining a singleton object storing the application location configuration information; obtaining virtual location information corresponding to the location acquisition request from the singleton object; The virtual location information is provided to an application corresponding to the location acquisition request.

8. A position feedback device, characterized in that: include: A request receiving module, used for receiving a location acquisition request; An information acquisition module is used to obtain application location configuration information of the first application in response to the location acquisition request, and the information acquisition module includes: A first information acquisition submodule, used to acquire location information through a location provider; A second information acquisition submodule, configured to acquire the application location configuration information saved by the first application based on that the location information acquired by the location provider is set as invalid location information; An information determination module, configured to determine virtual location information corresponding to the location acquisition request according to the application location configuration information, wherein the virtual location information is preset by the first application, and the information determination module includes: An object acquisition submodule, used for acquiring a singleton object storing the application location configuration information based on the system not being restarted and / or the application location configuration information not being updated; A third information acquisition submodule, used to obtain virtual location information corresponding to the location acquisition request from the singleton object; The information feedback module is used to feed back the virtual location information.

9. A position setting device, characterized in that: include: An information setting module, used to set the virtual location information corresponding to the application; An information storage module, used to store the virtual location information corresponding to the application into the application location configuration information, so as to obtain the application location configuration information in response to the location acquisition request of the application; Wherein, in response to the location acquisition request, acquiring the application location configuration information includes: acquiring location information through a location provider; acquiring the application location configuration information based on the location information acquired by the location provider being set as invalid location information; Determining virtual location information corresponding to the location acquisition request according to the application location configuration information; Wherein, determining the virtual location information corresponding to the location acquisition request includes: based on the system not being restarted and / or the application location configuration information not being updated, acquiring a singleton object storing the application location configuration information; acquiring the virtual location information corresponding to the location acquisition request from the singleton object; The virtual location information is provided to an application corresponding to the location acquisition request.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Positioning information processing method and device

    CN105848105A

  • Method and device for providing location service

    CN108012233A