[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114356452A - Method and device for acquiring positioning result information, electronic equipment and storage medium - Google Patents

Method and device for acquiring positioning result information, electronic equipment and storage medium Download PDF

Info

Publication number
CN114356452A
CN114356452A CN202111662606.8A CN202111662606A CN114356452A CN 114356452 A CN114356452 A CN 114356452A CN 202111662606 A CN202111662606 A CN 202111662606A CN 114356452 A CN114356452 A CN 114356452A
Authority
CN
China
Prior art keywords
positioning
result information
information
positioning result
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111662606.8A
Other languages
Chinese (zh)
Other versions
CN114356452B (en
Inventor
王成庆
路峻鉴
魏志扬
吕健侨
任江波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongyuan Beijing Technology Co ltd
Original Assignee
Hongyuan Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hongyuan Beijing Technology Co ltd filed Critical Hongyuan Beijing Technology Co ltd
Priority to CN202111662606.8A priority Critical patent/CN114356452B/en
Publication of CN114356452A publication Critical patent/CN114356452A/en
Application granted granted Critical
Publication of CN114356452B publication Critical patent/CN114356452B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephonic Communication Services (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application relates to a method and a device for acquiring positioning result information, electronic equipment and a storage medium, wherein the acquisition method comprises the following steps: when a preset interaction channel is established with a preset network application, receiving a positioning request sent by the network application through the preset interaction channel, wherein the preset interaction channel is a JSbridge channel established based on a preset Application Program Interface (API); and acquiring corresponding positioning result information based on the positioning request, and feeding back the positioning result information to the network application. Through the method and the device, the problems that user operation steps are increased and user experience is poor when geographical position information is acquired are solved, the fact that privacy protection popup windows are prevented from being triggered is achieved, the user operation steps are reduced, and the beneficial effect of user experience sense is improved.

Description

Method and device for acquiring positioning result information, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring positioning result information, an electronic device, and a storage medium.
Background
In the development of the application of the mobile terminal, some business capabilities need to be opened to a third party for access in a closed source mode, so that the application program app corresponding to an access party can rapidly have the corresponding business capabilities; the closed source code is usually packaged into a Software Development Kit (SDK), and the access party can realize the corresponding service capability by integrating the SDK.
In the related art, in an application (for example, HTML5) in which hypertext is embedded in an SDK, a corresponding hypertext application has a requirement for obtaining user geographic location information, but when the geographic location information is obtained through the corresponding hypertext application, a user privacy protection mechanism is triggered, at this time, a corresponding system pops up an authorized popup window or prompt for obtaining location, user operation steps are increased, and user experience is poor.
Aiming at the problems that user operation steps are increased and user experience is poor when geographical position information is acquired in the related technology, an effective solution does not exist.
Disclosure of Invention
The application provides a method and a device for acquiring positioning result information, electronic equipment and a storage medium, which are used for at least solving the problems that user operation steps are increased and user experience is poor when geographical position information is acquired in the related technology.
In a first aspect, the present application provides a method for acquiring positioning result information, which is applied to a processing module, and includes: when a preset interaction channel is established with a preset network application, receiving a positioning request sent by the network application through the preset interaction channel, wherein the preset interaction channel is a JSBR (Java service provider) idge channel established based on a preset Application Program Interface (API); and acquiring corresponding positioning result information based on the positioning request, and feeding back the positioning result information to the network application.
In a second aspect, the present application provides a method for acquiring positioning result information, which is applied to an access party, and includes: when a preset interaction channel is established with a preset network application, receiving a positioning request issued by the network application, wherein the preset interaction channel is established based on an application program interface API (application program interface) which is bridged from a corresponding SDK (software development kit) and is used for establishing the preset interaction channel, the preset interaction channel comprises a JSbridge channel, and the network application is embedded in the SDK; acquiring corresponding positioning result information based on the positioning request; and sending response information to the network application, wherein the response information comprises the positioning result information.
In a third aspect, the present application provides an apparatus for obtaining location result information, including a processing module, where the processing module includes: the receiving submodule is used for receiving a positioning request sent by a network application through a preset interaction channel when the preset interaction channel is established with the preset network application, wherein the preset interaction channel is a JSbridge channel established based on a preset Application Program Interface (API); and the processing submodule is used for acquiring corresponding positioning result information based on the positioning request and feeding the positioning result information back to the network application.
In a fourth aspect, the present application provides an apparatus for acquiring positioning result information, which is applied to an access party, and includes: the system comprises a receiving module and a processing module, wherein the receiving module is used for receiving a positioning request issued by a preset network application when the preset interaction channel is established with the preset network application, the preset interaction channel is established based on an application program interface API (application program interface) which is bridged from a corresponding SDK (software development kit) and is used for establishing the preset interaction channel, the preset interaction channel comprises a JSbridge channel, and the network application is embedded in the SDK; an obtaining module, configured to obtain corresponding positioning result information based on the positioning request; and the response module is used for sending response information to the network application, wherein the response information comprises the positioning result information.
In a fifth aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of the method for obtaining positioning result information according to any one of the embodiments of the first aspect and/or the steps of the method for obtaining positioning result information according to any one of the embodiments of the second aspect when executing the program stored in the memory.
A sixth aspect provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for obtaining positioning result information according to any one of the embodiments of the first aspect, and/or implements the steps of the method for obtaining positioning result information according to any one of the embodiments of the second aspect.
Compared with the related art, the embodiment provides a method, an apparatus, an electronic device and a storage medium for acquiring positioning result information, and receives a positioning request sent by a network application through a preset interaction channel when the preset interaction channel is established with the preset network application, wherein the preset interaction channel is a JSBridge channel created based on a preset application program interface API; based on the positioning request, corresponding positioning result information is obtained and fed back to the network application, so that the problems of increased user operation steps and poor user experience during geographic position information obtaining are solved, the logic flexibility of geographic position information obtaining is high, the privacy protection popup window is prevented from being triggered, the user operation steps are reduced, and the beneficial effect of user experience sense is improved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a diagram illustrating a prior art popup of privacy prompts for a native app;
FIG. 2 is a diagram illustrating a prior art privacy-prompting pop-up window after a hypertext application is loaded by a native app;
FIG. 3 is a diagram of another prior art native app privacy hint popup;
fig. 4 is a schematic flowchart of a method for acquiring positioning result information according to an embodiment of the present application;
fig. 5 is a flowchart of another method for acquiring positioning result information according to an embodiment of the present application;
fig. 6 is a flowchart of a method for acquiring positioning result information according to a preferred embodiment of the present application;
fig. 7 is a block diagram of a device for acquiring positioning result information according to an embodiment of the present application;
fig. 8 is a block diagram of an apparatus for acquiring location result information of an access party according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Before describing the embodiments of the present application, the following description is made on a scenario to which the method for acquiring positioning result information of the embodiments of the present application is applied and problems in the related art.
An Application Programming Interface (API) is a convention for linking different components of a software system.
An Application program (app) refers to a computer program that is developed and run on an operating system to perform a specific task or tasks, the Application program runs in a user mode, can interact with a user, and has a visual user interface, each Application program runs in an independent process and has an independent address space, and boundaries of different Application programs are called process boundaries.
The web view (WebView) is a control that can display a web page.
JSbridge is a channel for communication and interaction between a Webview side (such as Html5) and a Native (Native) side, wherein the Webview can call the capability of the Native through the JSbridge, and the Native can also execute some logic on the Webview through the JSbridge; JSB Bridge in the related technology mainly achieves the effect of mutual communication between a Native end and a Webview end by intercepting URL requests, the JSB Bridge is established by using a WebView self-contained API, concretely, WKWebView is used in iOS, JavaScript interaction codes are injected by evaluateJavaScript: completionHandler, and Bridge is established by monitoring by webView: decisionalHandler: decisionPolicyForNavigation Handler; and the Android uses WebView, JavaScript interactive codes are injected through the evalutateJavascript, monitoring is carried out through shouldOverderiderUrLoading, and JSbridge is established.
The following description is made on the principle of obtaining geographical location information in the related art based on Html5, as follows:
the Html5 has the capability of acquiring the position information by calling positioning through a browser, and can load an Html5 page through WebView (the iOS uses WKWebView, and the Android uses WebView) in the application of the mobile terminal, and then acquire the position information in the Html 5; when the Html5 acquires the location information, a system privacy protection mechanism is triggered, wherein the iOS is represented as a popup window, and the prompt contents are "allow for accessing your location when you use the application" apply for APP right (refer to fig. 1), "want to use your current location" apply for Html5 right (refer to fig. 2); android appears as a popup, and prompts "allow or not allow? "(see fig. 3), this popup pops up for the system detecting that Html5 is about to acquire location information, and cannot be intercepted by code.
In the prior art, the Html5 triggers a privacy protection mechanism when acquiring geographic position information, and needs to trigger logic of a system popup window for applying for Html5 permission and a corresponding popup window, so that user operation steps are increased, and user experience is poor. The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Fig. 4 is a flowchart illustrating a method for acquiring positioning result information according to an embodiment of the present application. As shown in fig. 4, an embodiment of the present application provides a method for acquiring positioning result information, which is applied to a processing module, and the method includes the following steps:
step S401, when a preset interaction channel is established with a preset network application, receiving a positioning request sent by the network application through the preset interaction channel, where the preset interaction channel is a JSBridge channel created based on a preset application program interface API.
In this embodiment, the main body of the method for acquiring the positioning result information is a processing module, and in some application scenarios, the processing module may serve as a host for interacting with the network application; meanwhile, the processing module may be an SDK (Software Development Kit), and certainly, the SDK may be a third-party SDK or an own SDK, and meanwhile, the terminal that loads the corresponding SDK may also execute the method for acquiring the positioning result information in the present application; preset web applications include, but are not limited to, Html 5; in this embodiment, Html5 is run on WebView of the SDK, Html5 interacts with the SDK using JSBridge channel, that is, Html5 sends a positioning request for acquiring geographical location information to the SDK through the JSBridge channel before acquiring the geographical location information; in this embodiment, when Html5 is to acquire the geographical location information, it executes a call to JSBridge, so as to send a positioning request corresponding to the acquisition of the geographical location information to the SDK.
In this embodiment, the preset application program interface API is an API for creating a JSBridge channel in the present application, for example: WebView's own API for creating JSbridge passes.
In this embodiment, the processing module may also be a native APP which is developed by itself, and when the native APP shows HTML5 through WebView, JSBridge is implemented through a WebView own API, and then the HTML5 sends the location request to the native APP through the JSBridge.
In this embodiment, the network application (i.e., Html5) sends a location request for obtaining geographic location information to the corresponding processing module through the JSBridge channel, so as to obtain the corresponding location result information through the processing module, and after receiving the location request, the processing module can perform location according to its own logic to obtain the geographic location information, thereby avoiding triggering the privacy protection popup of Html 5.
Step S402, based on the positioning request, obtaining the corresponding positioning result information, and feeding back the positioning result information to the network application.
In this embodiment, after receiving the location request, the processing module (SDK or native APP) performs location according to its own preset rule to obtain the geographic location information, that is, obtains the geographic location information according to its own logic, for example: when the processing module is positioned by the access party associated with the processing module, the access party can pop up a personalized popup window before the loaded APP is not authorized, the purpose of obtaining the position authority is explained to a user-friendly way, and after the corresponding access party completes positioning and obtains the geographical position information, the relevant information obtained by the geographical position information is fed back to the processing module; certainly, the positioning result information fed back by the access party includes two cases of successful positioning information and failure in obtaining the geographic location information, and the case corresponding to the failure in obtaining the geographic location information includes two cases of failure in obtaining the corresponding authorization by the app of the access party or failure in obtaining the geographic location information, and the successful positioning information needs to satisfy the condition that the app of the access party obtains the corresponding authorization and the successful positioning of the geographic location information.
In this embodiment, after acquiring the corresponding positioning result information, the processing module feeds back the corresponding positioning result information to the network application, that is, Html5, through the JSBridge channel, and thus, the whole process of acquiring the positioning result information is completed; in this embodiment, the positioning result information includes positioning failure information and positioning success information, and the positioning success information includes geographical location information corresponding to the positioning request, when the positioning result information received by the Html5 is the positioning success information, the geographical location information corresponding to the positioning request may be extracted from the corresponding positioning result information, and thereafter, the Html5 and the WebView perform subsequent services based on the geographical location information; when the positioning result information received by the Html5 indicates that the geographic position information is failed to be acquired, the corresponding positioning result information does not have the corresponding geographic position information, and thereafter, the Html5 and the WebView execute subsequent services without the geographic position information.
Through the steps S401 to S402, when a preset interaction channel is established with a preset network application, receiving a positioning request sent by the network application through the preset interaction channel, where the preset interaction channel is a JSBridge channel created based on a preset application program interface API; based on the positioning request, corresponding positioning result information is obtained and fed back to the network application, so that the problems of increased user operation steps and poor user experience during geographic position information obtaining are solved, the logic flexibility of geographic position information obtaining is high, the privacy protection popup window is prevented from being triggered, the user operation steps are reduced, and the beneficial effect of user experience sense is improved.
In some embodiments, the processing module executing the steps S401 to S402 includes one of the following: SDK, native application APP.
When the processing module is a native APP, after the native APP shows HTML5 through WebView, a JSB bridge channel is constructed through the WebView self-contained API, HTML5 sends a positioning request for acquiring geographic position information to the native APP through the JSB bridge channel, the positioning request is acquired by the native APP, and after the native APP is acquired, positioning result information is returned to HTML5, so that the privacy protection popup of the system for HTML5 when the native APP uses HTML5 can be avoided.
In some embodiments, the processing module includes an SDK, and obtains corresponding positioning result information based on the positioning request, and the method includes the following steps:
and step 51, sending the positioning request to the access party associated with the processing module.
In this embodiment, the processing module performs the acquisition of the positioning result information by sending the positioning request to the access party associated therewith, and the access party performs the acquisition of the positioning result information corresponding to the positioning request.
And step 52, acquiring response information corresponding to the access party responding to the positioning request, wherein the response information comprises corresponding positioning result information.
In this embodiment, after receiving the location request, the access party performs acquisition of location result information corresponding to the location request according to a preset rule, that is, acquires the geographic location information according to a logic of its own (for example, the access party may pop up a personalized popup window before the app has acquired no authorization, and explains to a user-friendly purpose of acquiring the location permission), and after completing acquisition of the geographic location information, the access party feeds back related information acquired from the geographic location information to the SDK, that is, feeds back corresponding response information to the SDK, and correspondingly acquires response information of the access party responding to the location request for the SDK.
In this embodiment, whether the response information fed back by the access party corresponds to the acquisition of the positioning result information includes two types, namely positioning success information and positioning failure information, where the situation corresponding to the positioning failure information includes two situations, namely failure when the app of the access party acquires the corresponding authorization or failure in positioning the geographic location information, and the situation corresponding to the positioning success information is that the app of the access party acquires the corresponding authorization and the positioning of the geographic location information is successful.
Sending the positioning request to the access party associated with the processing module through the steps 51 to 52; the method comprises the steps of obtaining response information corresponding to a positioning request responded by an access party, wherein the response information comprises corresponding positioning result information, the problems that user operation steps are increased and user experience is poor when the positioning result information containing geographic position information is obtained are solved, the positioning request for obtaining the geographic position information is sent to the access party, the result is returned after the access party obtains the geographic position information, the logic flexibility of the obtained geographic position information is high, the personalized popup window can friendly explain the use of using the geographic position information to a user, the user goodness and permission application passing rate are improved, triggering of a privacy protection popup window is avoided, the user operation steps are reduced, and the beneficial effect of user experience is improved.
It should be noted that, in the embodiment, before obtaining the geographic location information by using the HTML5 embedded in the SDK, the positioning request corresponding to the obtained geographic location information is sent to the access party, the access party is used to obtain the geographic location information instead, and the access party is used to obtain the geographic location information instead, so that the corresponding obtaining logic is high in flexibility, and the access party can determine whether to apply for the authority by itself, and pop up a personalized popup window before applying for the authority; meanwhile, the access party personalized popup window can friendly explain the use of using the geographical position information to the user, improve the user perception, and improve the permission application passing rate; moreover, the access party acquires the geographic position information instead, so that privacy protection popup of HTML5 by the trigger system can be avoided, user operation steps are reduced, and user experience is better.
In some embodiments, before sending the location request to the access party associated with the processing module, the following steps are further performed:
and step 61, judging whether the access party can respond to the positioning request.
In this embodiment, it is determined whether the access party responds to the location request executed by the SDK, and after the Html5 generates the location request, the location request for obtaining the location result information is sent to the SDK through the JSBridge channel, and after receiving the location request, the SDK interacts with the access party and sends the location request to the access party.
And step 62, if the access party is judged to be capable of responding to the positioning request, sending the positioning request to the access party associated with the processing module.
In this embodiment, the determination of whether the access party responds to the location request is to determine whether the SDK performs a corresponding protocol agreement with the access party, that is, whether a protocol corresponding to the sending of the location request to the access party and the obtaining of the response information corresponding to the location request from the access party is written into an SDK open protocol used by the SDK and the access party interactively; meanwhile, when the SDK determines that the access party can respond to the positioning request, the SDK triggers a positioning request of the access party, that is, sends the corresponding positioning request to the access party.
In some embodiments, if it is determined that the access party cannot respond to the positioning request, the network application is executed to acquire corresponding positioning result information.
In this embodiment, the step of acquiring the corresponding positioning result information by the web application is to load a web application page corresponding to the web application through a preset web view, and detect geographic position information from the web application page; the embodiment performs the following steps: when the access party does not support the acquisition of the positioning result information, the existing operation of acquiring the positioning result information, namely positioning JS is executed to acquire the geographical location information.
In some embodiments, the processing module executing the method for acquiring the positioning result information in the embodiments of the present application corresponds to an embedded network application.
In some embodiments, determining whether the access party is able to respond to the location request is implemented by:
step 71, obtaining an interaction protocol corresponding to interaction with the access party, wherein the interaction protocol includes a plurality of pieces of first protocol information, and the first protocol information is used for representing interaction operation with the access party.
In this embodiment, the interaction protocol used by the SDK and the access party interactively includes an SDK open protocol, that is, a form by which both parties of the protocol perform data transmission, interface call, and whether data is allowed to be called back, where each piece of first protocol information corresponds to a different object and an agreement on an operation on the object.
Step 72, detecting target protocol information in the plurality of first protocol information, wherein the target protocol information represents whether the access party responds to the agreement of the positioning request.
In this embodiment, the determining whether the access party responds to the location request is determining whether the SDK performs a corresponding protocol agreement with the access party, that is, target protocol information corresponding to the location request is detected in the plurality of first protocol information of the interactive protocol, and when the target protocol information is written in the interactive protocol in which the SDK interacts with the access party, it indicates that the access party can respond to the location request.
In case the target protocol information is detected, it is determined that the access party is able to respond to the positioning request, step 73.
Acquiring an interaction protocol corresponding to interaction with the access party in the steps 71 to 73, wherein the interaction protocol comprises a plurality of pieces of first protocol information, and the first protocol information is used for representing interaction operation with an access party agreement; detecting target protocol information in the first protocol information, wherein the target protocol information represents whether an access party responds to an agreement of a positioning request; and under the condition that the target protocol information is detected, determining that the access party can respond to the positioning request, judging whether the access party can respond to the positioning request, reducing invalid request repeated requests and improving the efficiency of acquiring the geographical position information by the network application.
In some of these embodiments, the following steps are also performed: and receiving response information of the access party responding to the positioning request based on the interactive protocol.
In this embodiment, when it is determined that the access party can respond to the positioning request based on the interaction protocol, the positioning request and the response message of the access party responding to the positioning request are both transmitted via the corresponding interaction protocol, that is, based on the corresponding target protocol message, the transmission of the positioning request, the transmission of the response message, and the callback of the geographic location message are performed.
In some embodiments, the feedback of the positioning result information to the network application may be further implemented by:
and step 81, detecting first state information generated when the access party acquires the geographical position information from the positioning result information, wherein the first state information is used for representing an authorization state of the access party for acquiring positioning.
In this embodiment, when the access party acquires the geographic location information according to its own logic, the corresponding state information generated in the acquisition process is written into the response information that needs to be transmitted to the SDK, where the corresponding state information includes a state of whether the app of the access party applies for authorization in the process of acquiring the geographic location information, and the right of the app application of the access party includes one of the following: checking whether the app has authority (geographical location information positioning), applying for app authorization by system popup, and applying for network application authority (for example, Html5 authority) by system popup.
And step 82, when the first state information indicates that the access party acquires authorization, determining whether the access party successfully acquires the geographical position information according to the positioning result information.
In this embodiment, when the first state information indicates that one of the rights of the app application of the access party is not authorized, it indicates that the access party fails to acquire the geographic location information, and when the rights of the app application of the access party sequentially acquire authorization from top to bottom, it indicates that the access party can perform positioning and acquire the geographic location information, and at this time, it is determined whether the access party acquires the corresponding geographic location information according to the positioning result information; in this embodiment, when the positioning is completed but the geographic location information is not acquired, the positioning still fails for the access party.
And step 83, when the access party is determined to successfully acquire the geographical location information, determining that the access party is successfully positioned, and feeding back the geographical location information acquired by the access party to the network application.
In this embodiment, after it is determined that the access party successfully acquires the geographic location information, the feedback response information includes an identifier of successful positioning and corresponding geographic location information. Certainly, when the geographical location information is not acquired, the feedback response information includes an identifier of positioning failure.
Through the steps 81 to 83, the judgment of whether the access party completes positioning and obtains the geographical location information according to the response information is realized, and the corresponding geographical location information is obtained under the condition of not triggering a privacy protection mechanism, so that the user operation is reduced, and the user experience is improved.
In some embodiments, the step S403 may further include feeding back the obtained result determined according to the result information to the network application, and the following steps may also be implemented:
step 91, detecting first state information generated when the access party acquires the geographical location information from the result information, wherein the first state information is used for representing an authorization state of the access party for acquiring the positioning.
And step 92, when the first state information indicates that the access party does not acquire the authorization, determining that the positioning of the access party fails.
Detecting first state information generated when the access party acquires the geographical location information from the result information in the above steps 91 to 92; when the first state information indicates that the access party does not acquire the authorization, the positioning of the access party is determined to fail, and whether the positioning of the access party is successful or not is judged based on whether the access party acquires the corresponding authorization or not.
In some embodiments, the feedback of the positioning result information to the network application may be further implemented by:
step 101, detecting first state information generated when an access party acquires geographical location information from the positioning result information, wherein the first state information is used for representing an authorization state of the access party for acquiring positioning.
And 102, when the first state information indicates that the access party acquires authorization, determining whether the access party successfully acquires the geographical position information according to the positioning result information.
And 103, determining that the positioning of the access party fails when the access party is determined not to acquire the geographical position information.
Through the steps 101 to 103, the judgment of whether the access party acquires the geographical location information is realized.
Fig. 5 is a flowchart of another method for acquiring positioning result information according to an embodiment of the present application. As shown in fig. 5, an embodiment of the present application provides a method for acquiring positioning result information, which is applied to an access party, and the method includes the following steps:
step S501, when a preset interaction channel is established with a preset network application, a positioning request issued by the network application is received, wherein the preset interaction channel is established based on an application program interface API (application program interface) which is bridged from a corresponding SDK and is used for establishing the preset interaction channel, the preset interaction channel comprises a JSbridge channel, and the network application is embedded in the SDK.
In this embodiment, a corresponding web application (for example, Html5, described below with Html5) runs in WebView of the SDK, and meanwhile, an API for using WebView to establish JSBridge is bridged to the access party through the SDK, and the access party establishes a JSBridge channel, and Html5 directly interacts with the access party and obtains positioning result information, that is, obtains geographical location information.
In this embodiment, when the network application is to acquire the geographical location information, the network application directly sends the corresponding positioning request to the access party through the JSBridge channel established by the access party.
Step S502, based on the positioning request, obtaining corresponding positioning result information.
In this embodiment, after receiving the positioning request, the access party obtains the positioning result information according to its own preset rule, that is, obtains the geographic location information according to its own logic, for example: the access party can pop up a personalized popup window before the app is not authorized, and the purpose of obtaining the position permission is explained to the user friendliness.
Step S503, sending a response message to the network application, where the response message includes the positioning result information.
In this embodiment, after completing the acquisition of the positioning result information, the access side feeds back the positioning result information to the Html5, that is, feeds back the corresponding response information to the Html 5.
In this embodiment, the positioning result information in the response information fed back by the access party includes positioning success information and positioning failure information, the positioning success information includes geographic location information, where a situation corresponding to the positioning information failure includes two situations, that is, failure when the app of the access party acquires the corresponding authorization or failure in positioning the geographic location information, and the positioning success information includes that the app of the access party acquires the corresponding authorization and that the positioning the geographic location information is successful.
In this embodiment, after sending the response message, the Html5 will extract the corresponding geographical location information from the received positioning result information, and when the positioning result information is positioning success information, it indicates that the geographical location information can be obtained, and the Html5 and the WebView execute the subsequent service based on the geographical location information; when the positioning result information is positioning failure information, the positioning failure information indicates that the geographical position information cannot be acquired, and the corresponding acquisition result does not have the corresponding geographical position information, and then, the Html5 and the WebView execute subsequent services without the geographical position information.
Through the steps S501 to S503, when a preset interaction channel is established with a preset network application, a positioning request issued by the network application is received; acquiring corresponding positioning result information based on the positioning request; the method and the device for sending the response information to the network application have the advantages that the response information comprises the positioning result information, the problems that user operation steps are increased and user experience is poor when the geographic position information is obtained are solved, direct interaction between the network application and an access party is achieved, the geographic position information is obtained based on the access party, logic flexibility is high, personalized popup windows can explain the use of the geographic position information to a user in a friendly mode, user goodness and permission application passing rate are improved, triggering of privacy protection popup windows is avoided, user operation steps are reduced, and user experience is improved.
It should be noted that when Html5 and the access party directly establish the JSBridge channel, Html5 further performs a determination of whether the access party responds to the positioning request and determines that the access party obtains the geographic location information, specifically, refer to the steps in the above embodiment, at this time, the subject of the execution is Html5, and relevant steps are not described herein again.
Fig. 6 is a flowchart of a method for acquiring positioning result information according to a preferred embodiment of the present application. As shown in fig. 6, the method flow includes the following steps:
in step S601, Html5 acquires geographical location information, and then step S602 is executed.
In step S602, JSBridge is called, and thereafter, step S603 is executed.
In step S603, the SDK receives the positioning request, and then, executes step S604.
Step S604, determining whether the access party can respond to the positioning request, if yes, performing step S605, otherwise, performing step S606.
In step S605, the SDK triggers the access location request, and then step S607 is executed.
In step S606, Html5 executes positioning JS, and acquires geographical location information.
In step S607, the access side receives the positioning request, and then performs step S608.
In step S608, the access side inquires whether the app has the right, if so, performs step S612, if to be authorized, performs step S609, and if not, performs step S614.
In step S609, the access system pops up a personalized popup window to friendly explain to the user, and then performs step S610.
Step S610, the access side determines whether to allow the corresponding user operation, if yes, step S611 is executed, otherwise, step S614 is executed.
Step S611, the access side determines whether to request system authorization, if yes, step S612 is executed, otherwise, step S614 is executed.
Step S612, the access party performs positioning to obtain the geographic location information, if the positioning is successful, step S613 is executed, otherwise, step S614 is executed.
In step S613, the SDK determines that the acquisition of the geographical location information is successful, and feeds back to Html 5.
In step S614, the SDK determines that the acquisition of the geographical location information has failed, and feeds back to Html 5.
In this embodiment, a device for acquiring positioning result information is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. The terms "module," "unit," "subunit," and the like as used below may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 7 is a block diagram of a structure of an apparatus for acquiring positioning result information according to an embodiment of the present application, and as shown in fig. 7, the apparatus includes a processing module, where the processing module includes:
the receiving submodule 71 is configured to receive, through a preset interaction channel when the preset interaction channel is established with a preset network application, a positioning request sent by the network application, where the preset interaction channel is a JSBridge channel created based on a preset application program interface API;
and the processing submodule 72 is coupled with the receiving submodule 71, and is configured to obtain corresponding positioning result information based on the positioning request, and feed back the positioning result information to the network application.
By the device of the embodiment of the application, when a preset interaction channel is established with a preset network application, the preset interaction channel is used for receiving a positioning request sent by the network application, wherein the preset interaction channel is a JSbridge channel established based on a preset Application Program Interface (API); based on the positioning request, corresponding positioning result information is obtained and fed back to the network application, the problems that user operation steps are increased and user experience is poor when geographical position information is obtained are solved, the positioning request for obtaining the geographical position information is sent to an access party, the result is returned after the access party obtains the geographical position information, the logic flexibility of the obtained geographical position information is high, the personalized popup window can friendly explain the use of the geographical position information to a user, the user goodness and permission application passing rate are improved, triggering of the privacy protection popup window is avoided, the user operation steps are reduced, and the beneficial effect of user experience is improved.
In some of these embodiments, the processing module comprises one of: SDK, native application APP.
In some embodiments, the processing module is an SDK, and the processing submodule 72 further includes:
the sending unit is used for sending the positioning request to the access party associated with the processing module;
and the acquisition unit is coupled with the sending unit and is used for acquiring response information corresponding to the response positioning request of the access party, wherein the response information comprises corresponding positioning result information.
In some embodiments, the processing sub-module 72 is configured to determine whether the access party is able to respond to the location request; and if the access party can respond to the positioning request, the access party sends the positioning request to the processing module.
In some embodiments, the processing sub-module 72 is configured to execute the network application to obtain the corresponding positioning result information if it is determined that the access party cannot respond to the positioning request.
Fig. 8 is a block diagram of a device for acquiring location result information of an access party according to an embodiment of the present application, where as shown in fig. 8, the device includes:
the receiving module 81 is configured to receive a positioning request issued by a network application when a preset interaction channel is established with the preset network application, where the preset interaction channel is established based on an application program interface API, which is bridged from a corresponding SDK and used for establishing the preset interaction channel, the preset interaction channel includes a JSBridge channel, and the network application is embedded in the SDK;
an obtaining module 82, coupled to the receiving module 81, configured to obtain corresponding positioning result information based on the positioning request;
and the response module 83 is coupled to the obtaining module 82 and configured to send response information to the network application, where the response information includes the positioning result information.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 9, an embodiment of the present application provides an electronic device including a processor 91, a communication interface 92, a memory 93, and a communication bus 94, where the processor 91, the communication interface 92, and the memory 93 complete mutual communication through the communication bus 94,
a memory 93 for storing a computer program;
the processor 91 is configured to implement the method steps of fig. 4 when executing the program stored in the memory 93.
The processing in the server implements the method steps in fig. 4, and the technical effect brought by the method is consistent with the technical effect of the method for acquiring the positioning result information in fig. 4 executed in the foregoing embodiment, and is not described again here.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for obtaining positioning result information provided in any one of the foregoing method embodiments.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the steps of the method for acquiring positioning result information in any of the above embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A method for acquiring positioning result information is applied to a processing module, and is characterized by comprising the following steps:
when a preset interaction channel is established with a preset network application, receiving a positioning request sent by the network application through the preset interaction channel, wherein the preset interaction channel is a JSbridge channel established based on a preset Application Program Interface (API);
and acquiring corresponding positioning result information based on the positioning request, and feeding back the positioning result information to the network application.
2. The method of claim 1, wherein the processing module comprises one of: SDK, native application APP.
3. The method of claim 2, wherein the processing module comprises an SDK, and wherein obtaining corresponding positioning result information based on the positioning request comprises:
sending the positioning request to an access party associated with the processing module;
and acquiring response information corresponding to the access party responding to the positioning request, wherein the response information comprises the corresponding positioning result information.
4. The method of claim 3, wherein prior to sending the location request to the processing module associated access party, the method further comprises:
judging whether the access party can respond to the positioning request;
and if the access party can respond to the positioning request, executing to send the positioning request to the access party associated with the processing module.
5. The method of claim 4, further comprising: and if the access party is judged to be incapable of responding to the positioning request, the network application is executed to acquire corresponding positioning result information.
6. The method according to any one of claims 1 to 5, wherein the positioning result information comprises one of: positioning failure information and positioning success information, wherein the positioning success information further comprises geographic position information corresponding to the positioning request.
7. The method according to any of claims 1 to 5, wherein the network application is embedded in the processing module.
8. A method for acquiring positioning result information is applied to an access party, and is characterized by comprising the following steps:
when a preset interaction channel is established with a preset network application, receiving a positioning request issued by the network application, wherein the preset interaction channel is established based on an application program interface API (application program interface) which is bridged from a corresponding SDK (software development kit) and is used for establishing the preset interaction channel, the preset interaction channel comprises a JSbridge channel, and the network application is embedded in the SDK;
acquiring corresponding positioning result information based on the positioning request;
and sending response information to the network application, wherein the response information comprises the positioning result information.
9. An apparatus for obtaining positioning result information, comprising a processing module, wherein the processing module comprises:
the receiving submodule is used for receiving a positioning request sent by a network application through a preset interaction channel when the preset interaction channel is established with the preset network application, wherein the preset interaction channel is a JSbridge channel established based on a preset Application Program Interface (API);
and the processing submodule is used for acquiring corresponding positioning result information based on the positioning request and feeding the positioning result information back to the network application.
10. An apparatus for obtaining positioning result information, applied to an access party, includes:
the system comprises a receiving module and a processing module, wherein the receiving module is used for receiving a positioning request issued by a preset network application when the preset interaction channel is established with the preset network application, the preset interaction channel is established based on an application program interface API (application program interface) which is bridged from a corresponding SDK (software development kit) and is used for establishing the preset interaction channel, the preset interaction channel comprises a JSbridge channel, and the network application is embedded in the SDK;
an obtaining module, configured to obtain corresponding positioning result information based on the positioning request;
and the response module is used for sending response information to the network application, wherein the response information comprises the positioning result information.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the method for acquiring positioning result information according to any one of claims 1 to 8 when executing a program stored in the memory.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for obtaining positioning result information according to any one of claims 1 to 8.
CN202111662606.8A 2021-12-31 2021-12-31 Method and device for acquiring positioning result information, electronic equipment and storage medium Active CN114356452B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111662606.8A CN114356452B (en) 2021-12-31 2021-12-31 Method and device for acquiring positioning result information, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111662606.8A CN114356452B (en) 2021-12-31 2021-12-31 Method and device for acquiring positioning result information, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114356452A true CN114356452A (en) 2022-04-15
CN114356452B CN114356452B (en) 2024-03-19

Family

ID=81104704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111662606.8A Active CN114356452B (en) 2021-12-31 2021-12-31 Method and device for acquiring positioning result information, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114356452B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105989280A (en) * 2015-02-10 2016-10-05 富泰华工业(深圳)有限公司 Application program authority management system, device and method
WO2017088473A1 (en) * 2015-11-23 2017-06-01 北京百度网讯科技有限公司 Client positioning method and apparatus
CN107347179A (en) * 2017-03-28 2017-11-14 吉林市东杰科技开发有限公司 A kind of method that LBS is realized based on ReactNative
US20180240118A1 (en) * 2017-02-23 2018-08-23 Paypal, Inc. Bridge for Communicating Data Outside of a Mobile Application
CN108924750A (en) * 2018-08-02 2018-11-30 赵佳丽 A kind of mobile terminal energy conservation positioning system based on Internet of Things
CN108959864A (en) * 2017-05-25 2018-12-07 阿里巴巴集团控股有限公司 Funcall authentication, the method and apparatus of calling function and authority information method for building up
CN109246605A (en) * 2018-10-12 2019-01-18 连尚(新昌)网络科技有限公司 Using method, electronic equipment and the medium for obtaining geographical location information in terminal
CN109885412A (en) * 2019-01-23 2019-06-14 深圳壹账通智能科技有限公司 Data interactive method, device, computer equipment and storage medium based on H5
CN110275738A (en) * 2019-06-30 2019-09-24 浪潮卓数大数据产业发展有限公司 A kind of Android bidirectional interaction method based on JsBridge
CN110365738A (en) * 2019-05-31 2019-10-22 平安国际智慧城市科技股份有限公司 Localization method, device and storage medium based on Hybird framework
CN110502708A (en) * 2019-08-27 2019-11-26 北京达佳互联信息技术有限公司 Based on the JSBridge method, apparatus communicated and storage medium
CN110688232A (en) * 2018-07-05 2020-01-14 珠海市魅族科技有限公司 Application program calling method, terminal device and computer readable storage medium
WO2020238277A1 (en) * 2019-05-24 2020-12-03 中国银联股份有限公司 Access method based on h5 access mode, access assembly thereof and mobile terminal

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105989280A (en) * 2015-02-10 2016-10-05 富泰华工业(深圳)有限公司 Application program authority management system, device and method
WO2017088473A1 (en) * 2015-11-23 2017-06-01 北京百度网讯科技有限公司 Client positioning method and apparatus
US20180240118A1 (en) * 2017-02-23 2018-08-23 Paypal, Inc. Bridge for Communicating Data Outside of a Mobile Application
CN107347179A (en) * 2017-03-28 2017-11-14 吉林市东杰科技开发有限公司 A kind of method that LBS is realized based on ReactNative
CN108959864A (en) * 2017-05-25 2018-12-07 阿里巴巴集团控股有限公司 Funcall authentication, the method and apparatus of calling function and authority information method for building up
CN110688232A (en) * 2018-07-05 2020-01-14 珠海市魅族科技有限公司 Application program calling method, terminal device and computer readable storage medium
CN108924750A (en) * 2018-08-02 2018-11-30 赵佳丽 A kind of mobile terminal energy conservation positioning system based on Internet of Things
CN109246605A (en) * 2018-10-12 2019-01-18 连尚(新昌)网络科技有限公司 Using method, electronic equipment and the medium for obtaining geographical location information in terminal
CN109885412A (en) * 2019-01-23 2019-06-14 深圳壹账通智能科技有限公司 Data interactive method, device, computer equipment and storage medium based on H5
WO2020238277A1 (en) * 2019-05-24 2020-12-03 中国银联股份有限公司 Access method based on h5 access mode, access assembly thereof and mobile terminal
CN110365738A (en) * 2019-05-31 2019-10-22 平安国际智慧城市科技股份有限公司 Localization method, device and storage medium based on Hybird framework
CN110275738A (en) * 2019-06-30 2019-09-24 浪潮卓数大数据产业发展有限公司 A kind of Android bidirectional interaction method based on JsBridge
CN110502708A (en) * 2019-08-27 2019-11-26 北京达佳互联信息技术有限公司 Based on the JSBridge method, apparatus communicated and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
荆超凡: "基于人机交互的地理属性数据采集系统研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 January 2021 (2021-01-15) *

Also Published As

Publication number Publication date
CN114356452B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
US9497563B2 (en) Mobile device activation
CN107515764B (en) Application page opening method, terminal and computer readable storage medium
CN107070870B (en) Data acquisition method and device
CN107168960B (en) Service execution method and device
CN108833585B (en) Information interaction method and device and storage medium
CN108712372B (en) Method and system for accessing WEB third party login by client
CN112232794A (en) Payment method and device, storage medium and electronic equipment
CN104584011A (en) Methods and systems for secure in-network insertion of WEB content and WEB services
CN108399119B (en) Method and device for data processing and automatic testing of browsing service kernel engine
CN108574721B (en) Login method, device, server, user terminal and readable storage medium
CN106843975B (en) Method and device for extending HTML5 application function
CN107517188A (en) A kind of data processing method and device based on Android system
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
CN108037989B (en) SDK component identification method and device
CN112769798B (en) Login method and device
WO2019119974A1 (en) Object uploading method and device
CN114356452A (en) Method and device for acquiring positioning result information, electronic equipment and storage medium
CN113115238A (en) Short message verification code filling method and electronic equipment
CN112990902A (en) Service processing method, device, computer equipment and storage medium
CN111078437A (en) Remote calling method and device of verification code, electronic equipment and readable storage medium
CN106886721B (en) Method and device for realizing auxiliary function in application
CN114257441B (en) Data processing method and device based on cloud document component
CN112600786B (en) Data interaction method and device
KR102115908B1 (en) User equipment and control method thereof
CN113672460A (en) Service monitoring method and device

Legal Events

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