Positioning method and device and storage medium
By replacing location information in the framework layer of the terminal operating system, security threats and location confusion in virtual positioning applications are solved, and stable virtual positioning is achieved and user experience is improved.
Patent Information
- Application Number
- CN202310596082.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2024-11-26
AI Technical Summary
In the prior art, virtual positioning applications (three-party APPs) have security threats, unstable operation, lack of system-level registration and cancellation prompts, and the real location and virtual location are prone to jump horizontally.
By determining the virtual location information in the framework layer of the terminal operating system, in response to the virtual location service opening status, replace the real location information in the position reporting function with virtual location information, avoiding the horizontal jump of the real location and virtual location, and achieving stable virtual position.
Fast and stable virtual positioning is achieved, avoiding the chaos of real locations and virtual locations, and improving system security and user experience.
Smart Images

Figure CN119025763A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of positioning, and in particular to a positioning method, device and storage medium. Background Art
[0002] With the development of positioning technology, people use positioning in more and more diverse scenarios, such as virtual positioning functions, for example, positioning the terminal to another virtual location different from the current real location, and finding nearby food, shopping malls, etc. based on the virtual location. At present, the terminal's operating system includes a virtual provider (MP). MP refers to an application programming interface (API) that provides a global "virtual location" to the operating system based on the terminal's native positioning framework. Realizing virtual positioning based on MP is the focus of current research in the field of positioning. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a positioning method, device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a positioning method is provided, which is applied to a terminal, and the method comprises: determining first location information, wherein the first location information is virtual location information of the terminal; in response to detecting that a virtual positioning service in an operating system of the terminal is turned on, replacing second location information indicated by a location parameter with the first location information, wherein the location parameter is used by the operating system to transmit location information; and performing positioning based on the location parameter after replacing the location information.
[0005] In one embodiment, the first position information is determined by at least one of the following methods: receiving input information for indicating the first position information, and determining the first position information based on the input information; receiving touch information for indicating the first position information, and determining the first position information based on the touch information; receiving voice interaction information for indicating the first position information, and determining the first position information based on the voice interaction information.
[0006] In one embodiment, receiving touch information for indicating the first position information and determining the first position information based on the touch information includes: determining pre-configured map information; receiving touch information based on the map information; and determining the first position information based on the map information and the touch information.
[0007] In one embodiment, the method further includes: in response to detecting a navigation instruction, displaying a prompt message or closing the virtual positioning service; the prompt message is used to prompt closing of the virtual positioning service.
[0008] In one embodiment, the method also includes: controlling the central processing unit CPU to broadcast a status signal, wherein the status signal is used to indicate that the virtual positioning service is in an on state; detecting the status signal at the framework layer of the operating system of the terminal; and determining that the virtual positioning service is in an on state in response to detecting the status signal.
[0009] In one embodiment, replacing the second location information indicated by the location parameter with the first location information includes: replacing the second location information indicated by the location parameter with the first location information in the framework layer of the operating system; positioning based on the location parameter after the location information is replaced includes: reporting the first location information to the application layer of the operating system based on the location parameter after the location information is replaced; and positioning based on the first location information in the application layer of the operating system.
[0010] In one implementation, replacing the second location information indicated by the location parameter with the first location information includes: calling a virtual positioning interface to replace the second location information indicated by the location parameter with the first location information.
[0011] In one embodiment, the method further includes: in response to not detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, performing positioning based on the second location information indicated by the location parameter.
[0012] In one embodiment, the method further includes: generating a first tag corresponding to the first location information, the first tag being used to indicate that the positioning of the terminal is virtual positioning; generating a second tag corresponding to the second location information, the second tag being used to indicate that the positioning of the terminal is non-virtual positioning.
[0013] In one embodiment, the method further includes: based on the first tag or the second tag, displaying a positioning identifier in a notification bar and / or a status bar of the terminal, wherein the positioning identifier is used to indicate whether the positioning of the terminal is virtual positioning.
[0014] In one implementation, the method further includes: displaying the first location information and / or the second location information in a notification bar and / or a status bar of the terminal based on the first tag or the second tag.
[0015] According to a second aspect of an embodiment of the present disclosure, a positioning device is provided, which is configured in a terminal, and includes: a determination module, used to determine first location information, wherein the first location information is virtual location information of the terminal; a processing module, used to replace second location information indicated by a location parameter with the first location information in response to detecting that a virtual positioning service in an operating system of the terminal is turned on, wherein the location parameter is used for the operating system to transmit location information; and positioning is performed based on the location parameter after the location information is replaced.
[0016] In one embodiment, the processing module determines the first position information in at least one of the following ways: receiving input information for indicating the first position information, and determining the first position information based on the input information; receiving touch information for indicating the first position information, and determining the first position information based on the touch information; receiving voice interaction information for indicating the first position information, and determining the first position information based on the voice interaction information.
[0017] In one embodiment, the processing module determines the first position information in the following manner: determining pre-configured map information; receiving touch information based on the map information; and determining the first position information based on the map information and the touch information.
[0018] In one embodiment, the device further includes: a display module, configured to display a prompt message or close the virtual positioning service in response to detecting a navigation instruction; the prompt message is used to prompt closing of the virtual positioning service.
[0019] In one embodiment, the device also includes: the processing module, which is also used to control the central processing unit CPU to broadcast a status signal, and the status signal is used to indicate that the virtual positioning service is in an on state; the detection module, which detects the status signal at the framework layer of the terminal's operating system; the determination module is also used to determine that the virtual positioning service is in an on state in response to detecting the status signal.
[0020] In one embodiment, the processing module replaces the second location information indicated by the location parameter with the first location information in the following manner: in the framework layer of the operating system, the second location information indicated by the location parameter is replaced with the first location information; based on the location parameter after the replacement of the location information, the first location information is reported to the application layer of the operating system; in the application layer of the operating system, positioning is performed based on the first location information.
[0021] In one implementation, the processing module replaces the second location information indicated by the location parameter with the first location information in the following manner: calling a virtual positioning interface to replace the second location information indicated by the location parameter with the first location information.
[0022] In one embodiment, the processing module is further used for: in response to not detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, performing positioning based on the second location information indicated by the location parameter.
[0023] In one embodiment, the processing module is also used to: generate a first tag corresponding to the first location information, the first tag is used to indicate that the positioning of the terminal is virtual positioning; generate a second tag corresponding to the second location information, the second tag user indicates that the positioning of the terminal is non-virtual positioning.
[0024] In one embodiment, the display module is further used to: display a positioning identifier in the notification bar and / or status bar of the terminal based on the first tag or the second tag, and the positioning identifier is used to indicate whether the positioning of the terminal is virtual positioning.
[0025] In one implementation, the display module is further configured to: display the first location information and / or the second location information in a notification bar and / or a status bar of the terminal based on the first tag or the second tag.
[0026] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including: a memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the positioning method in the first aspect or any one of the implementations of the first aspect.
[0027] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions are executed by a processor, the positioning method in the first aspect or any one of the implementations of the first aspect is executed.
[0028] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by determining the first location information, the first location information is the virtual location information of the terminal, in response to detecting that the virtual positioning service is turned on, the second location information in the location reporting function is replaced with the first location information, and positioning is performed based on the location reporting function after the location information is replaced. The present disclosure can perform virtual positioning quickly and stably.
[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0031] Figure 1 It is a schematic diagram of virtual positioning based on a third-party APP.
[0032] Figure 2 This is another schematic diagram of virtual positioning based on a third-party APP.
[0033] Figure 3 This is another schematic diagram of virtual positioning based on a third-party APP.
[0034] Figure 4 The figure is a flowchart of a positioning method according to an exemplary embodiment.
[0035] Figure 5 It is a schematic diagram showing a positioning method according to an exemplary embodiment.
[0036] Figure 6 The figure is a schematic diagram showing a terminal native positioning framework according to an exemplary embodiment.
[0037] Figure 7 The figure is a flow chart of another positioning method according to an exemplary embodiment.
[0038] Figure 8 The figure is a flow chart of another positioning method according to an exemplary embodiment.
[0039] Fig. 9 The figure is a flow chart of another positioning method according to an exemplary embodiment.
[0040] Fig.10 The figure is a flow chart of another positioning method according to an exemplary embodiment.
[0041] Fig.11 The figure is a schematic diagram of another terminal native positioning framework according to an exemplary embodiment.
[0042] Fig.12 The figure is a flow chart of another positioning method according to an exemplary embodiment.
[0043] Fig.13 The figure is a block diagram of a positioning device according to an exemplary embodiment.
[0044] Fig.14 is a block diagram of another positioning device according to an exemplary embodiment. DETAILED DESCRIPTION
[0045] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
[0046] With the development of positioning technology, people are becoming more and more interested in virtual positioning functions. For example, positioning the terminal to another virtual location different from the current real location, and finding nearby food, shopping malls, etc. based on the virtual location.
[0047] Currently, the operating system of the terminal includes a mock provider (MP). MP refers to an API that provides a global "virtual location" to the operating system based on the terminal's native positioning framework. MP is essentially an extended function of the location manager service (LMS), which is used to inject virtual locations under the monitoring of the terminal operating system. Among them, LMS is the abbreviation of Android system positioning service, which provides location information services for the application layer of the Android system throughout the entire life cycle of the Android phone after it is turned on.
[0048] In the related art, many third-party applications (APPs) for virtual positioning have been developed based on MP. Based on MP, the third-party APPs can take over the four types of locations provided by LMS and inject virtual locations into the application layer. Figure 1 It is a schematic diagram of virtual positioning based on a third-party APP. The simulated positioning shown in the drawings of this disclosure is virtual positioning. This disclosure will be explained in terms of virtual positioning later, but it can be understood that simulated positioning can be equivalent to virtual positioning. Figure 1 As shown in the figure, virtual positioning is performed through a third-party APP. The first step is as shown in the left figure. You need to set the "Virtual Location" permission of the third-party APP, that is, you need to turn on the developer options and select the virtual location application; the second step is as shown in the middle figure. You need to enter the virtual location point, where the third-party APP also displays a map. The third step is shown in the right figure. After selecting the location point, you can start the virtual location. Among them, the specific method of setting the "Virtual Location" permission of the third-party APP is as follows Figure 2 shown. Figure 2 The middle left picture is the developer options page. On the developer options page, click "Select virtual location app" to enter Figure 2The application selection page in the middle right picture. The application selection page displays multiple applications that can perform virtual positioning, and you can select the virtual location application. Since third-party apps need to set permissions, the steps are relatively cumbersome. In addition, third-party apps also have the following problems: First, there are behaviors that potentially threaten system security; second, the development is not standardized, and the operation is prone to disorder; third, there is no clear registration and deregistration operation status prompt at the system level. For example, there may be a virus in the third-party app. For another example, when a third-party app exits abnormally, only the foreground exits, and the registered background service is still running, which causes the positioning function of the mobile phone to be abnormal. It can only be solved by restarting, and even restarting cannot solve the problem. For another example, the MP does not take over the four types of locations provided by the LMS in real time. That is, the third-party app injects the virtual location into the application layer at intervals by setting a timer, and there is a problem such as Figure 3 In the situation shown, the real location is also reported to the application layer, causing the positioning of the mobile phone to jump between the virtual location and the real location.
[0049] In another related technology, the real location reported by the system is replaced by changing the relevant code in the native positioning framework of the terminal operating system. However, this method has potential threats and has the tendency to forge the location.
[0050] Therefore, the present disclosure provides a positioning method, device and storage medium. The positioning method determines the first position information, which is virtual position information. In response to detecting that the virtual positioning service is turned on, the second position information in the position reporting function is replaced with the first position information, and positioning is performed based on the position reporting function after the position information is replaced. The present disclosure does not require setting permissions, the steps are relatively simple, and virtual positioning can be performed stably to avoid the situation where the real position and the virtual position jump sideways.
[0051] Among them, the positioning method is applied to the terminal, which can also be called a terminal device, a mobile station (MS), a mobile terminal (MT), etc. It is a device that provides voice and / or data connectivity to users. For example, the terminal can be a handheld device with wireless connection function, a vehicle-mounted device, etc. At present, some examples of terminals are: smart phones (mobile phones), pocket personal computers (pocket personal computers, PPCs), handheld computers, personal digital assistants (personal digital assistants, PDAs), laptops, tablet computers, wearable devices, or vehicle-mounted devices, etc. In addition, when it is a vehicle-to-everything (V2X) communication system, the terminal device can also be a vehicle-mounted device. It should be understood that the embodiments of the present disclosure do not limit the specific technology and specific device form adopted by the terminal.
[0052] Figure 4 is a flow chart of a positioning method according to an exemplary embodiment. Figure 1 As shown, the positioning method includes the following steps.
[0053] In step S11, first position information is determined.
[0054] In one embodiment, the terminal may determine the first location information, which is virtual location information of the terminal and is used for virtual positioning. For example, the terminal determines the first location information according to an address input by a user, a voice command issued, or a map point selected on a map.
[0055] It is understandable that in other scenarios, the first location information may also be randomly acquired by the terminal, and this disclosure does not limit this.
[0056] In step S12, in response to detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, the second location information indicated by the location parameter is replaced with the first location information.
[0057] In one embodiment, the terminal's operating system includes a virtual positioning service. Figure 5 As shown, the user can first turn on the switch of the location information service, and when the location information service is turned on, the virtual positioning service switch is displayed. The user can choose to turn on the virtual positioning service for virtual positioning. Exemplarily, the terminal can also display a map after the virtual positioning service is turned on. For example, the map control is accessed through the map API. The user touches the screen and clicks on the location on the map, and the location is used as the virtual location for subsequent virtual positioning, that is, the first location information determined by the terminal. It can be understood that the present disclosure may not display a map, but directly receive an address entered by the user, or receive a voice command from the user, etc., and may also determine the first location information for virtual positioning.
[0058] In one embodiment, the terminal can detect that the virtual positioning service is turned on and replace the second location information indicated by the location parameter with the first location information. The location parameter is a variable used to indicate the location information. That is, the location information reported each time is different, and the location parameter is also different. The second location information is the current location information obtained by the terminal based on the native positioning framework. It can be considered that the second location information is real location information. The first location information is virtual location information.
[0059] In one embodiment, Figure 6 is a schematic diagram of a terminal native positioning framework. Figure 6As shown, the native positioning framework includes the positioning module of the hardware layer, the driver of the kernel layer, the runtime of the runtime layer, the global navigation satellite system location provider (GNSS location provider) of the framework layer, the location provider manager (location provider manager), the location management service (location manager service) and the location manager (location manager) of the application layer, and the APP of the application layer.
[0060] The positioning module of the hardware layer may be, for example, a global positioning system (GPS), a Beidou navigation satellite system (BDS), a Galileo navigation satellite system, etc. A location provider is a service that provides location information. For example, Fig.11 The GNSS location provider in the middle framework layer. The GNSS location provider provides location information based on the positioning module in the hardware layer. Location providers also include network location providers (NLP), which provide location information through the network; fused location providers (FLP), which provide location information by integrating all positioning methods, such as GPS, base station positioning, wireless network (wifi) positioning, Bluetooth positioning, and sensor positioning; passive location providers (PLP), which provide location information by receiving location information. The location provider manager is used to manage location providers. The location management service is used to provide positioning services. The location manager is used to manage the location management service. APPs based on positioning services are installed in the application layer, and APPs based on positioning services can initiate positioning requests, such as X-degree maps.
[0061] Exemplarily, the process of positioning the terminal based on the native positioning framework includes: the application layer APP initiates a positioning request, calls the location service manager of the framework layer, and starts the thread of the positioning service. Based on the location provider manager, call the corresponding location provider. The location provider drives the positioning module based on the runtime layer and the driver layer to obtain the location information. The location information is reported to the application layer via the kernel layer, the runtime layer, and the framework layer in sequence for use by the APP.
[0062] In step S13, positioning is performed based on the position parameters after replacing the position information.
[0063] In one embodiment, after the terminal replaces the second location information indicated by the location parameter in the framework layer with the first location information, the terminal reports the first location information to the application layer based on the location parameter after the replacement of the location information, so that the APP in the application layer can perform positioning based on the first location information.
[0064] The present disclosure determines the first location information, and in response to detecting that the virtual positioning service is turned on, replaces the second location information in the location reporting function with the first location information, thereby performing positioning based on the location reporting function after the location information is replaced, thereby achieving virtual positioning. And because the present disclosure replaces the second location information in the location reporting function with the first location information, the second location information will no longer be reported to the application layer, thereby avoiding the phenomenon of real location and virtual location jumping sideways during user use.
[0065] The present disclosure replaces the second location information in the location reporting function of the operating system with the first location information. It can be understood that the present disclosure performs virtual positioning based on the operating system, which can save power consumption and is safer and more stable.
[0066] In some embodiments, Figure 7 FIG. 1 is a flow chart of a positioning method according to an exemplary embodiment. Figure 7 As shown, the positioning method includes the following steps.
[0067] In step S21, it is determined whether it is detected that the virtual positioning service is in an on state.
[0068] In step S22, the second location information in the location reporting function is replaced by the first location information.
[0069] In step S23, positioning is performed based on the position reporting function.
[0070] In one embodiment, in step S21, it is determined whether the virtual positioning service is detected to be in an on state, and if it is detected that the virtual positioning service is in an on state, steps S22 and S23 are executed. If it is not detected that the virtual positioning service is in an on state, step S23 is executed.
[0071] In this embodiment, if it is detected that the virtual positioning service is turned on, the second location information in the location reporting function is replaced with the first location information, and positioning is performed based on the location reporting function after the location information is replaced. If the virtual positioning service is not detected to be turned on, positioning is performed directly based on the location reporting function.
[0072] The present disclosure replaces the second location information in the location reporting function with the first location information in response to detecting that the virtual positioning service is in an on state, thereby performing positioning based on the location reporting function after the location information is replaced, thereby achieving virtual positioning.
[0073] In some implementations, the manner in which the terminal determines the first location information may include at least one of the following:
[0074] Input information indicating first position information is received, and the first position information is determined based on the input information.
[0075] Touch information indicating first position information is received, and the first position information is determined based on the touch information.
[0076] Voice interaction information indicating first location information is received, and the first location information is determined based on the voice interaction information.
[0077] In one embodiment, the terminal receives input information, and the input information is used to indicate the first location information. For example, the input information may be the latitude and longitude information entered by the user on the page of the virtual positioning service. Alternatively, the input information may also be the name of a city, the name of a building, etc. Alternatively, it may also be some network labels, for example, the Magic City refers to Shanghai, and the Land of Abundance refers to Chengdu. The terminal may determine the first location information based on the received input information.
[0078] In one embodiment, the terminal may also receive touch information. For example, the terminal may display one or more preset first location information on the page of the virtual positioning service. The above-mentioned preset one or more first location information may be set by the user or by the operating system of the terminal. Exemplarily, the user may set one or more commonly used first location information according to actual needs. The operating system of the terminal may set the location information of one or more cities according to the city classification. The user may touch and click on the preset first location information to generate touch information. The terminal receives the touch information and determines the first location information based on the first location information indicated by the touch information.
[0079] For another example, the terminal may display a map, and the user touches and clicks on the map to generate touch information. The terminal determines the first location information based on the touch information and the map.
[0080] In one implementation, the terminal may also receive voice interaction information. The voice interaction information includes the first location information. For example, the terminal turns on the voice interaction function and receives the user's voice interaction information, and the voice interaction information may include longitude and latitude information. Alternatively, the voice interaction information may also be the name of a city, the name of a building, etc. The terminal may determine the first location information based on the received voice interaction information.
[0081] In one embodiment, the terminal may also receive input information and touch information, and determine the first location information based on the input information and touch information. For example, a user inputs the name of a shopping mall to generate input information. The terminal displays a map of the shopping mall based on the received input information. The user touches on the map to click on a store in the shopping mall to generate touch information. The terminal determines the first location information based on the received touch information and the map.
[0082] It is understandable that the terminal can receive any one or more of input information, touch information, and voice interaction information, and determine the first position information based on any one or more of the received input information, touch information, and voice interaction information. This disclosure does not give examples one by one.
[0083] The present disclosure receives any one or more of input information, touch information, and voice interaction information, and determines the first position information based on any one or more of the received input information, touch information, and voice interaction information, so as to flexibly determine the first position information and improve the user experience.
[0084] In some embodiments, Figure 8 is a flow chart of a positioning method. Figure 8 As shown, the positioning method includes the following steps.
[0085] In step S31, pre-configured map information is determined.
[0086] In step S32, first position information is determined based on the map information and the received touch information.
[0087] In one embodiment, the terminal can determine the map information. For example, the terminal can obtain the map information pre-stored in the terminal, or it can also retrieve the map information configured in the third-party APP in the terminal, or it can also send a network request to obtain the map from the server, etc. Of course, the method of determining the map can also refer to other existing feasible methods, and the present disclosure does not limit this. Display the map information on the virtual positioning service page. It is understandable that the user does not need to turn on the virtual positioning service, and the terminal can also display the map information. The user touches and clicks on the displayed map information to generate touch information. The terminal determines the first location information based on the map information and the touch information.
[0088] The present disclosure determines the first location information by determining pre-configured map information based on the map information and the received touch information, so that the user can intuitively select the first location information on the map, thereby improving the user experience.
[0089] In some embodiments, the user may need to navigate during the virtual positioning process. However, the starting position for navigation is the virtual positioning position, and navigation errors are likely to occur, resulting in a poor user experience. Therefore, the present disclosure provides a positioning method, the method comprising: in response to detecting a navigation instruction, displaying a prompt message or closing a virtual positioning service.
[0090] In one embodiment, the terminal may display a prompt message in response to detecting a navigation instruction. The prompt message may prompt the user that navigation is being performed based on a virtual location, and may further display a prompt message indicating whether to close the virtual positioning service, so that the user can directly close the virtual positioning service.
[0091] In one implementation, the terminal may also directly turn off the virtual positioning service so that the user can navigate based on the current real location without noticing, thereby avoiding navigation errors caused by navigation based on the virtual location.
[0092] In this implementation manner, the terminal may also re-enable the virtual positioning service after the navigation is completed.
[0093] The present invention displays a prompt message or turns off the virtual positioning service in response to detecting a navigation instruction. The prompt message is used to prompt the virtual positioning service to be turned off, thereby avoiding navigation errors and improving the user experience.
[0094] In some embodiments, Fig. 9 is a flow chart of a positioning method. Fig. 9 As shown, the positioning method includes the following steps.
[0095] In step S41, the central processing unit CPU is controlled to broadcast a status signal.
[0096] In step S42, a status signal is detected at the framework layer of the operating system of the terminal.
[0097] In step S43, in response to detecting the status signal, it is determined that the virtual positioning service is in an on state.
[0098] In one embodiment, after the virtual positioning service is turned on, a status signal is broadcasted by the central processing unit CPU, and the status signal indicates that the virtual positioning service is in the turned-on state. The terminal determines whether the virtual positioning service is in the turned-on state by detecting the status signal broadcasted by the CPU in the location provider manager of the framework layer.
[0099] The present disclosure can determine whether the virtual positioning service in the terminal operating system is in an enabled state by detecting the broadcast signal of the CPU in the framework test, thereby realizing virtual positioning.
[0100] In some embodiments, Fig.10 is a flow chart of a positioning method. Fig.10 As shown, the positioning method includes the following steps.
[0101] In step S51, in the framework layer of the operating system, the second location information indicated by the location parameter is replaced with the first location information.
[0102] In step S52, the first location information is reported to the application layer of the operating system based on the location parameters after the location information is replaced.
[0103] In step S53, positioning is performed in the application layer of the operating system based on the first location information.
[0104] In one implementation, the location parameter may be a variable in a location reporting function (ReportLocation()). The terminal may replace the second location information indicated by the location parameter in the location reporting function of the framework layer with the first location information.
[0105] For example, Fig.11 FIG. 1 is a schematic diagram of another terminal native positioning framework according to an exemplary embodiment. Fig.11 As shown, in the native positioning framework of the terminal, a computer programming language local interface (Java native interface, JNI) layer is also included between the framework layer and the runtime layer. The JNI layer is used to interact with Java code and code in other languages. The JNI layer includes multiple callback functions. For example, a location information callback function (location_callback), a status callback function (status_callback), and a satellite message information callback function (nmea_callback), etc. The terminal generates a location reporting function based on the second location information in the location information callback function. Specifically, the setting (set) function of the framework layer is called to set the location parameter in the location reporting function to the second location information. If it is detected that the virtual positioning service is in the on state, the terminal can call the setting function to set the location parameter in the location reporting function to the first location information, which can be understood as replacing the second location information in the location reporting function with the first location information.
[0106] In this implementation, the location parameter after replacing the location information indicates the virtual location information. Based on the location parameter in the location reporting function, the first location information is reported to the application layer. The application layer implements virtual positioning according to the first location information.
[0107] The present invention replaces the second location information indicated by the location parameter with the first location information in the framework layer in response to detecting that the virtual positioning service is in an on state, and then reports the first location information to the application layer based on the location parameter after the location information is replaced, so that the application layer can perform positioning based on the first location information to achieve virtual positioning.
[0108] In some implementations, the positioning method includes: calling a virtual positioning interface to replace the second position information indicated by the position parameter with the first position information.
[0109] In one implementation, the terminal may call a virtual positioning interface to replace the second location information indicated by the location parameter with the first location information. For example, the terminal calls the MP, takes over the set function of the framework layer, and sets the location information in the location reporting function to the second location information.
[0110] The present disclosure implements virtual positioning by calling a virtual positioning interface to replace the second position information indicated by the position parameter with the first position information.
[0111] In some embodiments, the positioning method includes: in response to not detecting that a virtual positioning service in an operating system of the terminal is in an enabled state, performing positioning based on second location information indicated by a location parameter.
[0112] In one embodiment, when the terminal does not detect that the virtual positioning service is turned on, the terminal can report the real location information to the application layer according to the process of the native positioning framework. Therefore, when the virtual positioning service is turned on, the terminal performs positioning based on the first location information indicated by the replaced location parameter, and when the virtual positioning service is not turned on, the terminal performs positioning based on the second location information indicated by the original location parameter.
[0113] The present disclosure implements non-virtual positioning and improves user experience by performing positioning based on second location information indicated by location parameters in response to failure to detect that a virtual positioning service in an operating system of a terminal is in an enabled state.
[0114] In some embodiments, Fig.12 is a flow chart of a positioning method. Fig.12 As shown, the positioning method includes the following steps.
[0115] In step S61, a first tag corresponding to the first location information is generated, and the first tag is used to indicate that the positioning of the terminal is a virtual positioning.
[0116] In step S62, a second tag corresponding to the second location information is generated, and the second tag indicates that the positioning of the user-indicated terminal is non-virtual positioning.
[0117] In one embodiment, the native positioning framework of the terminal operating system includes a function for determining whether the location information reported this time is the first location information, for example, the internal function isFromMockProvider() of the class storing the location information. The function can clearly indicate whether the location information reported this time is virtual location information. For example, if the return result of the function is the first result, the location information reported this time is considered to be the second location information, that is, the real location information. If the return result of the function is the second result, the location information reported this time is considered to be the first location information, that is, the virtual location information. Exemplarily, the first result can be 0 and the second result can be 1, but the present disclosure is not limited to this, and the first result and the second result can also be in any other form.
[0118] In this implementation, the terminal may generate a label based on the first result or the second result. For example, if the location information reported this time is the second location information, a first label may be generated. The first label is used to indicate that the positioning of the terminal is virtual positioning. If the location information reported this time is the first location information, a second label may be generated. The second label is used to indicate that the positioning of the terminal is non-virtual positioning.
[0119] The present disclosure generates a tag to indicate whether the positioning of the terminal is virtual positioning, so that the virtual positioning is performed under the monitoring of the system, which is safer and more reliable.
[0120] In some implementations, the positioning method includes: based on the first tag or the second tag, displaying a positioning identifier in the notification bar and / or the status bar, where the positioning identifier is used to indicate whether the positioning of the terminal is virtual positioning.
[0121] In one embodiment, the terminal may display a positioning indicator in a notification bar or status. The positioning indicator is used to indicate whether the current terminal positioning is virtual positioning. For example, an icon or character of virtual positioning is displayed in a notification bar or status bar. Alternatively, it may also be displayed in the form of a floating window whether the current terminal positioning is virtual positioning, and the terminal may also display a close button in the interface of the floating window to close the virtual positioning service.
[0122] The present disclosure displays a positioning identifier in a notification bar or status to prompt the user whether the current positioning of the terminal belongs to virtual positioning, thereby improving the user's usage experience.
[0123] In some implementations, the positioning method includes: displaying the first location information and / or the second location information in a notification bar and / or a status bar.
[0124] In one embodiment, the terminal may display the location information in the notification bar or the status bar. For example, the terminal may display the first location information in the notification bar or the status bar. If virtual positioning is currently being performed, the first location information is displayed to inform the user of the location information of the virtual positioning. If virtual positioning is not currently being performed, the first location information may also be displayed to inform the user of the first location information stored in the terminal. Among them, the first location information stored in the terminal may be based on the first location information obtained when the terminal performed virtual positioning the last time. For another example, the terminal may display the second location information in the notification bar or the status bar to inform the user of the current real location information.
[0125] The present disclosure displays the first location information or the second location information in a notification bar or a status bar so that the user can view the location information intuitively, thereby improving the user's usage experience.
[0126] It should be noted that those skilled in the art can understand that the various implementation methods / embodiments involved in the embodiments of the present disclosure can be used in conjunction with the aforementioned embodiments or can be used independently. Whether used alone or in conjunction with the aforementioned embodiments, the implementation principle is similar. In the implementation of the present disclosure, some embodiments are described in terms of implementation methods used together. Of course, those skilled in the art can understand that such examples are not limitations of the embodiments of the present disclosure.
[0127] Based on the same concept, an embodiment of the present disclosure also provides a positioning device.
[0128] It is understandable that the positioning device provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0129] Fig.13 is a block diagram of a positioning device 100 according to an exemplary embodiment. Fig.13 The device 100 includes a determination module 101 , a processing module 102 , a display module 103 and a detection module 104 .
[0130] The determining module 101 is used to determine the first location information, wherein the first location information is the virtual location information of the terminal. The processing module 102 is used to replace the second location information indicated by the location parameter with the first location information in response to detecting that the virtual location service in the operating system of the terminal is turned on, and the location parameter is used for the operating system to transmit the location information. Positioning is performed based on the location parameter after the location information is replaced.
[0131] In one implementation, the processing module 102 determines the first location information in at least one of the following ways: receiving input information indicating the first location information, and determining the first location information based on the input information. Receiving touch information indicating the first location information, and determining the first location information based on the touch information. Receiving voice interaction information indicating the first location information, and determining the first location information based on the voice interaction information.
[0132] In one implementation, the processing module 102 determines the first location information in the following manner: determining pre-configured map information, receiving touch information based on the map information, and determining the first location information based on the map information and the touch information.
[0133] In one embodiment, the display module 103 is used to: in response to detecting a navigation instruction, display a prompt message or close the virtual positioning service. The prompt message is used to prompt to close the virtual positioning service.
[0134] In one embodiment, the processing module 102 is further used to control the central processing unit CPU to broadcast a status signal, and the status signal is used to indicate that the virtual positioning service is in an enabled state. The detection module 104 detects the status signal at the framework layer of the terminal operating system. The determination module 101 is further used to determine that the virtual positioning service is in an enabled state in response to detecting the status signal.
[0135] In one embodiment, the processing module 102 replaces the second location information indicated by the location parameter with the first location information in the following manner: in the framework layer of the operating system, the second location information indicated by the location parameter is replaced with the first location information. Based on the location parameter after the location information is replaced, the first location information is reported to the application layer of the operating system. In the application layer of the operating system, positioning is performed based on the first location information.
[0136] In one implementation, the processing module 102 replaces the second location information indicated by the location parameter with the first location information in the following manner: calling a virtual positioning interface to replace the second location information indicated by the location parameter with the first location information.
[0137] In one implementation, the processing module 102 is further configured to: in response to not detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, perform positioning based on the second location information indicated by the location parameter.
[0138] In one embodiment, the processing module 102 is further configured to: generate a first tag corresponding to the first location information, the first tag being used to indicate that the terminal's location is virtual location, and generate a second tag corresponding to the second location information, the second tag being used to indicate that the terminal's location is non-virtual location.
[0139] In one implementation, the display module 103 is further configured to: based on the first tag or the second tag, display a positioning identifier in the notification bar and / or status bar of the terminal, where the positioning identifier is used to indicate whether the positioning of the terminal is virtual positioning.
[0140] In one implementation, the display module 103 is further configured to: display the first location information and / or the second location information in a notification bar and / or a status bar of the terminal based on the first tag or the second tag.
[0141] Fig.14 is a block diagram of a positioning device 200 according to an exemplary embodiment.
[0142] like Fig.14 As shown, apparatus 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .
[0143] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.
[0144] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0145] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.
[0146] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0147] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.
[0148] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0149] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200 and the temperature change of the device 200. The sensor assembly 214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0150] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0151] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0152] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0153] The present disclosure determines first location information, which is virtual location information, replaces second location information in a location reporting function with the first location information in response to detecting that a virtual positioning service is turned on, and performs positioning based on the location reporting function after the location information is replaced. The present disclosure can perform virtual positioning quickly and stably.
[0154] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0155] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.
Claims
1. A positioning method, characterized in that: The method is applied to a terminal, and the method includes: Determine first location information, wherein the first location information is virtual location information of the terminal; In response to detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, replacing the second location information indicated by the location parameter with the first location information, the location parameter being used by the operating system to transmit the location information; Positioning is performed based on the position parameters after the position information is replaced.
2. The method according to claim 1, characterized in that The first location information is determined in at least one of the following ways: receiving input information indicating the first position information, and determining the first position information based on the input information; receiving touch information indicating the first position information, and determining the first position information based on the touch information; Voice interaction information indicating the first position information is received, and the first position information is determined based on the voice interaction information.
3. The method according to claim 2, characterized in that The receiving touch information indicating the first position information, and determining the first position information based on the touch information includes: Determining pre-configured map information; receiving touch information based on the map information; The first position information is determined based on the map information and the touch information.
4. The method according to claim 1, characterized in that: The method further comprises: In response to detecting a navigation instruction, displaying a prompt message or closing the virtual positioning service; The prompt information is used to prompt closing of the virtual positioning service.
5. The method according to claim 1, wherein: The method further comprises: Controlling the central processing unit CPU to broadcast a status signal, wherein the status signal is used to indicate that the virtual positioning service is in an enabled state; Detecting the status signal at a framework layer of an operating system of the terminal; In response to detecting the status signal, it is determined that the virtual positioning service is in an enabled state.
6. The method according to claim 1, characterized in that The replacing the second location information indicated by the location parameter with the first location information includes: In the framework layer of the operating system, replacing the second location information indicated by the location parameter with the first location information; The performing positioning based on the position parameter after the position information is replaced includes: Reporting the first location information to an application layer of the operating system based on the location parameter after the location information is replaced; In the application layer of the operating system, positioning is performed based on the first location information.
7. The method according to claim 1, characterized in that The replacing the second location information indicated by the location parameter with the first location information includes: The virtual positioning interface is called to replace the second position information indicated by the position parameter with the first position information.
8. The method according to claim 1, characterized in that The method further comprises: In response to not detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, positioning is performed based on the second location information indicated by the location parameter.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: Generate a first tag corresponding to the first location information, where the first tag is used to indicate that the positioning of the terminal is virtual positioning; A second tag corresponding to the second location information is generated, and the second tag user indicates that the positioning of the terminal is non-virtual positioning.
10. The method according to claim 9, characterized in that The method further comprises: Based on the first tag or the second tag, a positioning identifier is displayed in a notification bar and / or a status bar of the terminal, where the positioning identifier is used to indicate whether the positioning of the terminal is virtual positioning.
11. The method according to claim 9, characterized in that The method further comprises: Based on the first tag or the second tag, the first location information and / or the second location information is displayed in a notification bar and / or a status bar of the terminal.
12. A positioning device, characterized in that: The device is configured in a terminal, and the device includes: A determination module, configured to determine first location information, wherein the first location information is virtual location information of the terminal; A processing module is used to replace the second location information indicated by the location parameter with the first location information in response to detecting that the virtual positioning service in the operating system of the terminal is turned on, and the location parameter is used by the operating system to transmit the location information; and perform positioning based on the location parameter after the location information is replaced.
13. The device according to claim 12, characterized in that The processing module determines the first position information by at least one of the following methods: receiving input information indicating the first position information, and determining the first position information based on the input information; receiving touch information indicating the first position information, and determining the first position information based on the touch information; Voice interaction information indicating the first position information is received, and the first position information is determined based on the voice interaction information.
14. The device according to claim 13, characterized in that The processing module determines the first location information in the following manner: Determining pre-configured map information; receiving touch information based on the map information; The first position information is determined based on the map information and the touch information.
15. The device according to claim 12, characterized in that The device also includes: The display module is used to display a prompt message or close the virtual positioning service in response to detecting a navigation instruction; the prompt message is used to prompt to close the virtual positioning service.
16. The device according to claim 12, characterized in that The device also includes: The processing module is further used to control the central processing unit CPU to broadcast a status signal, wherein the status signal is used to indicate that the virtual positioning service is in an enabled state; A detection module, detecting the status signal at the framework layer of the operating system of the terminal; The determination module is further configured to determine, in response to detecting the status signal, that the virtual positioning service is in an enabled state.
17. The device according to claim 12, characterized in that The processing module replaces the second position information indicated by the position parameter with the first position information in the following manner: In the framework layer of the operating system, replacing the second location information indicated by the location parameter with the first location information; Reporting the first location information to an application layer of the operating system based on the location parameter after the location information is replaced; In the application layer of the operating system, positioning is performed based on the first location information.
18. The device according to claim 12, characterized in that The processing module replaces the second position information indicated by the position parameter with the first position information in the following manner: The virtual positioning interface is called to replace the second position information indicated by the position parameter with the first position information.
19. The device according to claim 12, characterized in that The processing module is also used for: In response to not detecting that the virtual positioning service in the operating system of the terminal is in an enabled state, positioning is performed based on the second location information indicated by the location parameter.
20. The device according to any one of claims 12 to 19, characterized in that The processing module is also used for: Generate a first tag corresponding to the first location information, where the first tag is used to indicate that the positioning of the terminal is virtual positioning; A second tag corresponding to the second location information is generated, and the second tag user indicates that the positioning of the terminal is non-virtual positioning.
21. The device according to claim 20, characterized in that The display module is also used for: Based on the first tag or the second tag, a positioning identifier is displayed in a notification bar and / or a status bar of the terminal, where the positioning identifier is used to indicate whether the positioning of the terminal is virtual positioning.
22. The device according to claim 20, characterized in that The display module is also used for: Based on the first tag or the second tag, the first location information and / or the second location information is displayed in a notification bar and / or a status bar of the terminal.
23. An electronic device, characterized in that: include: A memory for storing instructions; as well as A processor, configured to call the instructions stored in the memory to execute the positioning method according to any one of claims 1 to 11.
24. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed by the processor, the positioning method according to any one of claims 1 to 11 is executed.
Citation Information
Patent Citations
Positioning information processing method and device
CN105848105A
Virtual positioning method and terminal
CN106339266A
Sign-in method, mobile terminal and computer readable storage medium
CN107820210A
Map display method and device, storage medium and terminal
CN110019580A
Mobile communication terminal and operation method thereof
KR1020120138462A
