CN107249180A - The general cut-in methods of LBS SDK and system - Google Patents
The general cut-in methods of LBS SDK and system Download PDFInfo
- Publication number
- CN107249180A CN107249180A CN201710595276.2A CN201710595276A CN107249180A CN 107249180 A CN107249180 A CN 107249180A CN 201710595276 A CN201710595276 A CN 201710595276A CN 107249180 A CN107249180 A CN 107249180A
- Authority
- CN
- China
- Prior art keywords
- sdk
- lbs
- observed person
- location
- positioning service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000005538 encapsulation Methods 0.000 claims abstract description 53
- 230000008859 change Effects 0.000 claims abstract description 24
- 230000005540 biological transmission Effects 0.000 claims abstract description 7
- 230000015654 memory Effects 0.000 claims description 16
- 230000009471 action Effects 0.000 claims description 9
- 238000012360 testing method Methods 0.000 claims description 5
- 238000001514 detection method Methods 0.000 claims description 2
- 230000004048 modification Effects 0.000 abstract description 6
- 238000012986 modification Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 7
- 238000001914 filtration Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000018109 developmental process Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000032683 aging Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
Abstract
The invention discloses a kind of general cut-in methods of LBS SDK and system, methods described includes:Observed person starts positioning service, and send the Location Request to positioning service when receiving the Location Request of observer's transmission;Location Request is sent to LBS SDK and obtains the location information of LBS SDK feedbacks, and the location information is sent into observed person by positioning service by calling encapsulation class;Observed person is received after the location information, is fed back to observer.Scheme of the present invention, under Observer Pattern, is directly interacted using the encapsulation class being implemented separately with primary LBS SDK, when needing modification LBS SDK, it is only necessary to change the encapsulation class.So so that external interface and primary SDK interfaces are full decoupled, realize in the case where that need not change code, LBS SDK's is uniformly accessed into.
Description
Technical field
The present invention relates to field of location service technology, more particularly to a kind of LBS (Location Based Service, base
In location-based service) SDK (Software Development Kit, SDK) general cut-in methods and system.
Background technology
Along with the development of development of Mobile Internet technology, precision and personalized service are more and more important.Wherein, positioning letter
Breath is an important parameter for realizing precision and personalized service.It is that user recommends periphery for example based on user position
Service, navigation obtains weather etc., is all the strong dependence to location information.In the prior art, LBS (being based on location-based service) is logical
Cross network or outside positioning method (such as GPS) obtains the positional information (geographical coordinate, or geodetic coordinates) of mobile terminal user,
Under the support of GIS (GIS-Geographic Information System, Geographic Information System) platform, corresponding clothes are provided the user
A kind of value-added service of business.Therefore, App (Application, application program) usually requires to obtain the location information ability of user
Provide the user more precision and personalized service.
At present, major location based service providers can be the App developer of different industries, be provided for different usage scenarios
The location-based service of customization.Common, location based service provider needs to provide LBS SDK and opening API (Application
Programming Interface, application programming interfaces) realize positioning service, while provide LBS SDK explanation document with
And example, so that App developer self-developing and accesses according to demand, you can call the position provided by location based service provider
Service.
But, when the location-based service that App developer needs to use other positions service provider to provide, or, work as App
Developer's location-based service for being provided using multiple location based service providers simultaneously but due to when demand shift needs modification code, by
The LBS SDK access ways and the equal disunities of API provided in diverse location service provider, easily causes code change greatly, very
To needing to realize again.
The content of the invention
In view of the above problems, the present invention provides a kind of general cut-in methods of LBS SDK solved the above problems and system.
According to one aspect of the present invention there is provided a kind of general cut-in methods of LBS SDK, application program is including observation
Under person, observed person, positioning service, LBS SDK system architecture, methods described includes:
The observed person is when receiving the Location Request that the observer sends, the startup positioning service, and to
The positioning service sends the Location Request;
The Location Request is sent to the LBS SDK and obtains institute by the positioning service by calling encapsulation class
The location information of LBS SDK feedbacks is stated, and the location information is sent to the observed person;
The observed person is received after the location information, is fed back to the observer.
Alternatively, in the method for the invention, the positioning service is sent the Location Request by calling encapsulation class
To the LBS SDK and the location information of the acquisition LBS SDK feedbacks, including:
The encapsulation class is called in the positioning service, the Location Request is sent into the encapsulation class, and receive institute
State the location information of encapsulation class feedback;
Wherein, the Location Request is converted into the LBS SDK by the encapsulation class after the Location Request is received
After the data format of support, the native interface of the LBS SDK is called, the Location Request after form is changed is sent to described
LBS SDK, and the LBS SDK location informations fed back are converted into feedback after the data format that the positioning service is supported
To the positioning service.
Alternatively, in the method for the invention, the Location Request is being sent to the LBS SDK by the positioning service
Before, in addition to:The positioning service is initialized by calling the encapsulation class to the LBS SDK.
Alternatively, it is described to call encapsulation class to carry out initialization operation to LBS SDK by described fixed in the method for the invention
The sub-line journey of position service is realized;And/or, call encapsulation class to send Location Request to the LBS SDK and obtain the positioning and believe
The positioning action of breath is realized by the sub-line journey of the positioning service.
Alternatively, the method for the invention also includes:
The positioning service obtains the positioning states change information of the LBS SDK feedbacks by calling the encapsulation class,
And the positioning states change information is sent to the observed person;
The observed person feeds back the positioning states change information to the observer.
Alternatively, in the method for the invention, the positioning service is fed back the LBS SDK by way of broadcast
Information be sent to the observed person.
Alternatively, in the method for the invention, the observed person is receiving the Location Request that the observer sends
Afterwards, in addition to:Observer's object is preserved, and holds by the way of weak reference observer's object.
Alternatively, in the method for the invention, the observed person be provided with from different location requirements match it is multiple outer
Portion's calling interface;
The observer calls corresponding external call interface according to different location requirements, with to the observed person
Send corresponding Location Request.
Alternatively, in the method for the invention, in the observed person by the location information received to the observer
After feedback, in addition to:The observer discharges the monitoring to the observed person.
Alternatively, in the method for the invention, the observed person is receiving the Location Request that the observer sends
When, in addition to:Whether effective location information and the effective location information are cached with detection preset buffer memory area whether
The demand of the Location Request is met, it is when testing result is to be, the location information for the demand that meets is anti-to the observer
Feedback;Otherwise, the positioning service is started;
Wherein, the location information cached in the preset buffer memory area includes:The positioning that the observed person receives
The location information of service feedback.
According to another aspect of the present invention, a kind of LBS SDK universal access systems are also provided, including:Observer's module,
Observed person's module, positioning service module and LBS SDK;
Observer's module, for sending Location Request to observed person's module, and receives the observed person
The location information of module feedback;
Observed person's module, for when receiving the Location Request, starts the positioning service module, and to
The positioning service module sends the Location Request, and in the location information for receiving the positioning service module feedback
When, the location information is sent to observer's module;
The positioning service module, for by calling encapsulation class, the Location Request received to be sent into LBS
SDK and the location information for obtaining the LBS SDK feedbacks, and the location information is sent to the observed person.
Alternatively, in system of the present invention, the positioning service module, specifically for calling the encapsulation class, by institute
State Location Request and be sent to the encapsulation class, and receive the location information of the encapsulation class feedback;Wherein, the encapsulation class exists
Receive after the Location Request, the Location Request is converted into after the data format that the LBS SDK are supported, call described
LBS SDK native interface, the Location Request after form is changed is sent to the LBS SDK, and the LBS SDK is anti-
The location information of feedback feeds back to the positioning service module after being converted to the data format that the positioning service module is supported.
Alternatively, in system of the present invention, the positioning service module is additionally operable to be sent to by the Location Request
Before the LBS SDK, by calling the encapsulation class, the LBS SDK are initialized.
Alternatively, in system of the present invention, the positioning service module is additionally operable to, by calling the encapsulation class, obtain
The positioning states change information of the LBS SDK feedbacks is taken, and the positioning states change information is sent to described be observed
Person's module;
Observed person's module, is additionally operable to when receiving the positioning states change information, by the positioning states
Change information is sent to observer's module.
Alternatively, in system of the present invention, the positioning service module, specifically for by way of broadcast, by institute
State LBS SDK feedacks and be sent to observed person's module.
Alternatively, in system of the present invention, observed person's module is additionally operable to receiving observer's module
After the Location Request of transmission, observer's object is preserved, and hold by the way of weak reference observer's object.
Alternatively, in system of the present invention, observed person's module is designed with what is matched from different location requirements
Multiple external call interfaces;
Observer's module, specifically for according to different location requirements, calling corresponding external call interface, with to
Observed person's module sends corresponding Location Request.
Alternatively, in system of the present invention, observed person's module is further used for receiving the observer
During the Location Request that module is sent, detect effective location information whether is cached with preset buffer memory area and described effective fixed
Whether position information meets the demand of the Location Request, when testing result is to be, by the location information for the demand that meets to institute
State observer's module feedback;Otherwise, the positioning service module is started;Wherein, the positioning letter cached in the preset buffer memory area
Breath includes:The location information for the positioning service module feedback that observed person's module is received.
The present invention has the beneficial effect that:
Scheme of the present invention, under Observer Pattern, is directly handed over using the encapsulation class being implemented separately with primary LBS SDK
Mutually, when needing modification LBS SDK, it is only necessary to change the encapsulation class.So so that external interface and primary SDK interfaces
Full decoupled, the convenient new LBS SDK of access are convenient for changing LBS SDK, realized in the case where that need not change code, LBS
SDK's is uniformly accessed into.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 is the schematic diagram in the embodiment of the present invention using Observer Pattern progress LBS SDK accesses;
A kind of flow chart for general cut-in methods of LBS SDK that Fig. 2 provides for first embodiment of the invention;
Fig. 3 is the system architecture diagram of the application of second embodiment of the invention methods described;
Fig. 4 is that the schematic diagram of positioning action is realized by sub-line journey in second embodiment of the invention;
A kind of structure chart for LBS SDK universal access systems that Fig. 5 provides for third embodiment of the invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The embodiment of the present invention provides a kind of general cut-in methods of LBS SDK and system, it is intended that provide one it is unified, general
, the high-performance LBS SDK access schemes for meeting various location requirements, so as to facilitate each developer and company to various
LBS SDK access, meets the demand of its positioning service.
The embodiment of the present invention, it is contemplated that positioning is time-consuming operation, and positioning action may be called in many ways, so, it is comprehensive
Overall permanence is closed, scheme is realized using Observer Pattern described in the embodiment of the present invention, as shown in figure 1, to use observer
Pattern carries out the schematic diagram of LBS SDK accesses.Specifically, when observer has location requirement, can initiate to position to observed person
Request, is interacted with source side by observed person, gets and observer is notified after location data.
Below by several specific embodiments, the method and system described in the embodiment of the present invention is described in detail.
Specifically, there is provided a kind of general cut-in methods of LBS SDK in first embodiment of the invention, application program including
Under observer, observed person, positioning service, LBS SDK system architecture, as shown in Fig. 2 methods described comprises the following steps:
Methods described includes:
Step S201, observed person starts positioning service when receiving the Location Request of observer's transmission, and to positioning
Service sends the Location Request;
The Location Request is sent to LBS SDK and acquisition by step S202, positioning service by calling encapsulation class
The location information of LBS SDK feedbacks, and the location information is sent to observed person;
In the embodiment of the present invention, positioning service before Location Request is sent into LBS SDK, in addition to:By calling
The encapsulation class, is initialized to the LBS SDK.
In one particular embodiment of the present invention, positioning service is sent the Location Request by calling encapsulation class
To the LBS SDK and the location information of the acquisition LBS SDK feedbacks, specifically include:
1) encapsulation class is called in positioning service, and the Location Request is sent into the encapsulation class;
2) encapsulation class enters row format conversion to the Location Request, and calls the native interface of the LBS SDK, by form
Location Request after conversion is sent to the LBS SDK;Wherein, requirement of the encapsulation class according to LBS SDK to data format is to institute
State Location Request and enter row format conversion.
3) encapsulation class is converted to the LBS SDK location informations fed back after the data format that the positioning service is supported
Feed back to the positioning service.
Step S203, observed person is received after the location information, is fed back to observer.
Efficiency is monitored in order to improve positioning, in an alternate embodiment of the present invention where, in step S201, observed person exists
When receiving the Location Request of observer's transmission, detect in preset buffer memory area whether be cached with effective location information and described
Whether effective location information meets the demand of the Location Request, when testing result is to be, will directly meet demand
Location information is fed back to the observer;Otherwise, the positioning service is started.
In the present embodiment, in preset buffer memory area cache location information include but is not limited to be:The observed person receives
The location information of the location-server feedback arrived.That is, in the present embodiment, observed person is receiving the positioning
After the location information of service feedback, the preset buffer memory area is deposited into.
In the present embodiment, it is contemplated that location information have it is stronger ageing, in order to realize the data using caching
Location information feedback is carried out, it is necessary to the data to caching are managed or handled, specifically, in the present embodiment, can basis
Demand, presets the filtering rule of effective location information, and observed person advises when receiving Location Request according to the filtering
Then, effective location information is filtered out.Or, observed person is according to the filtering rule, in real time to storing in buffer area
Location information carry out filtration treatment, it is ensured that cache bank memories storage location information be effective.
Those skilled in the art can flexibly set this rule according to demand, for example, setting this rule based on the time, i.e.,
Location information only in the time range of setting is just effective location information, and the present invention does not do unique limit to filtering rule
It is fixed.
Methods described of the embodiment of the present invention, under Observer Pattern, using the encapsulation class being implemented separately directly with primary LBS
SDK is interacted, when needing modification LBS SDK, it is only necessary to change the encapsulation class.So so that external interface and primary SDK
Interface is full decoupled, the convenient new LBS SDK of access, is convenient for changing LBS SDK, realizes in the case where that need not change code,
LBS SDK's is uniformly accessed into.
Scheme described in the embodiment of the present invention is applied in Android projects, is solved and optimized by better way
Each producer LBS SDK access, meets the demand of various positioning functions.
There is provided a kind of general cut-in methods of LBS SDK in second embodiment of the invention, the present embodiment will combine Fig. 3, open
Compared with the more ins and outs of embodiment one, the function to refine and optimize methods described of the embodiment of the present invention, so that of the invention
The implementation of scheme is more convenient, accurately.It should be noted that ins and outs disclosed in the present embodiment to explain the present invention and without
The present invention is limited in unique, and in the case where not conflicting, each technical characteristic can be any mutually disclosed in the embodiment of the present invention
Combination.
The system construction drawing of methods described of embodiment of the present invention application is as shown in figure 3, including four parts, be respectively:Observation
Person, observed person, positioning service and LBS SDK.Wherein, observer carries out monitoring registration to observed person, and observed person is sight
The person of examining provides external call interface.
Specifically, the present embodiment methods described comprises the following steps:
Step 1, observer sends Location Request by the external call interface of observed person to observed person;
Step 2, observed person starts positioning service, and sends Location Request to positioning service;
Step 3, encapsulation class, initialization LBS SDK are called in positioning service;
Step 4, encapsulation class is called in positioning service, is interacted with LBS SDK, performs positioning action;
Specifically, positioning service is by calling encapsulation class, after the form that the Location Request is converted to LBS SDK supports
LBS SDK are sent to by LBS SDK native interface;
In the present embodiment, directly interacted by encapsulating class with LBS SDK, when needing modification LBS SDK, it is only necessary to change
The encapsulation class, realizes positioning action and LBS SDK are completely isolated.And for LBS SDK, it is only necessary to by LBS
SDK call-back manners are unified into customized call-back manner.
In an optional embodiment of the present invention, in order to avoid time-consuming, using RxJava mode (people in the art
Member can also replace with other modes according to demand) positioning asynchronous operation is realized, specifically, in the present embodiment, positioning service will
Time-consuming operation is all placed on sub-line journey execution, asynchronous acquisition result, it is to avoid time-consuming.Wherein, time-consuming operation at least includes:LBS
SDK initialization operations and the positioning action for obtaining location information.When implementing, the main thread of positioning service is by LB SDK's
Initialization operation transfers to sub-line journey to realize, sub-line journey feeds back the knot for initializing and completing to main thread after the completion of SDK initialization
Really;And positioning action is transferred to SDK sub-line journeys to realize by the main thread of positioning service, SDK sub-line journeys are performing positional operand
After work, location information callback operation is carried out, it is specific as shown in Figure 4.
Step 5, LBS SDK send location information to positioning service by encapsulating class;
Step 6, positioning service is listened to after location information, and the location information is sent into observed person.
In one particular embodiment of the present invention, observed person will register itself as broadcast recipients, and positioning service is led to
Transmission broadcast message is crossed, location information is sent to observed person.
In an alternate embodiment of the present invention where, positioning service for example starts when each positioning states change information
During positioning, when receiving location information readjustment etc., positioning states are changed into information by sending broadcast notification broadcast to observed
Person, so that positioning states change information is notified observer by observed person.
Step 7, observed person is received after location information, and location information is sent into observer.
In the embodiment of the present invention, in order to improve location efficiency, caching mechanism is added, i.e. observed person is receiving calmly
After the information of position, location information is cached.After observed person caches to location information, if data cached meet pre-
The rule of setting requires (such as data cache-time is within the period of setting), directly to observer's return cache data, no
It must reposition.Corresponding, if the data cached rule requirement for not meeting setting, the data of caching are emptied.
Further, in of the invention one alternatively embodiment, observed person also preserves observer's object, due to fixed
Bit manipulation is time-consuming operation, if observed person location receivers for a long time hold object may cause object can not reclaim and
Cause memory overflow.So, in the embodiment of the present invention, hold the mode that object employs weak reference.Pass through this weak reference shape
Formula conservation object example, can avoid memory overflow.
Further, in an alternate embodiment of the present invention where, increase interface meets a variety of location requirements.Specifically,
Due to using Observer Pattern, default behavior is that observer can all be notified by getting location information every time.But this and be unsatisfactory for
All demands.For example, may only need to obtain one-time positioning information in some demands.Therefore, in the present embodiment, adding simplification
Calling interface.One-time positioning is only called, gets to cancel after location data and monitors.Certainly, the embodiment of the present invention can also be opened
A variety of calling interfaces are put, a variety of demands are met, for example, adding stopping positioning, recovers positioning, positions at once, poll positioning etc.
Calling interface, the need for meeting various functions.
In summary, technical scheme described in the embodiment of the present invention:
1) external interface and primary LBS SDK interfaces are full decoupled, the convenient new LBS SDK of access, and are convenient for changing LBS
SDK;
2) for more time-consuming positioning action, using sub-line journey asynchronous operation, APP normal functions are not influenceed, it is to avoid
ANR;
3) observed person holds eavesdropping target using weak reference, it is to avoid memory overflow;
4) positioning service is issued by broadcast notice messages progress location information in the present embodiment, is realized striding course and is called
Location information.
5) in this implementation, called by a variety of functional interfaces, meet various location requirements.
It can be seen that, analysis and design of the present invention Jing Guo systematization consider a variety of demands, take into account function and performance, can
Allow APP developer to be directed to LBS SDK access and replacing in a short time, have found the high-performance solution party of the demand of satisfaction
Case.
Third embodiment of the invention provides a kind of LBS SDK universal access systems, as shown in figure 5, including:Observer's module
510th, observed person's module 520, positioning service module 530 and LBS SDK540;
Observer's module 510, for sending Location Request to observed person's module 520, and receives observed person's module 520
The location information of feedback;
Observed person's module 520, for when receiving the Location Request, starting positioning service module 530, and to calmly
Position service module 530 sends the Location Request, and when receiving the location information of the feedback of positioning service module 530, will
The location information is sent to observer's module 510;
Positioning service module 530, for by calling encapsulation class, the Location Request received to be sent into LBS
SDK540 and the location information for obtaining LBS SDK540 feedbacks, and the location information is sent to observed person 520.
Based on said structure framework and implementation principle, several specific and sides of being preferable to carry out under the above constitution are given below
Formula, the function to refine and optimize system of the present invention, so that the implementation of the present invention program is more convenient, accurately.Specifically relate to
And following content:
In the embodiment of the present invention, positioning service module 530, specifically for calling the encapsulation class, by the Location Request
The encapsulation class is sent to, and receives the location information of the encapsulation class feedback;Wherein, the encapsulation class receive it is described
After Location Request, the Location Request is converted into after the data format that the LBS SDK540 are supported, LBS SDK540 are called
Native interface, the Location Request after form is changed is sent to LBS SDK540, and the positioning that LBS SDK540 are fed back
Information feeds back to positioning service module 530 after being converted to the data format that the positioning service module 530 is supported.
Further, in the embodiment of the present invention, positioning service module 530 is additionally operable to be sent to by the Location Request
Before the LBS SDK540, by calling the encapsulation class, the LBS SDK540 are initialized.
Further, in the embodiment of the present invention, positioning service module 530 is additionally operable to, by the encapsulation class, obtain LBS
The positioning states change information of SDK540 feedbacks, and the positioning states change information is sent to observed person's module 520;
Observed person's module 520, is additionally operable to, when receiving the positioning states change information, the positioning states be become
Change information and be sent to observer's module 510.
Further, in the embodiment of the present invention, positioning service module 530, specifically for by way of broadcast, by described in
LBS SDK feedacks are sent to observed person's module 520.
Further, in the embodiment of the present invention, observed person's module 520 is additionally operable to receiving observer's module
After 510 Location Requests sent, observer's object is preserved, and hold by the way of weak reference observer's object.
Further, in the embodiment of the present invention, observed person's module 520 be designed with from different location requirements match it is many
Individual external call interface;
Observer's module 510, specifically for according to different location requirements, calling corresponding external call interface, with to
Observed person's module 520 sends corresponding Location Request.
Further, in the embodiment of the present invention, observed person's module 520 is further used for receiving the observer
During the Location Request that module 510 is sent, detect effective location information whether is cached with preset buffer memory area and described effective
Location information whether meet the demand of the Location Request, when testing result is to be, by the location information for the demand that meets
Fed back to observer's module 510;Otherwise, the positioning service module 530 is started;Wherein, delay in the preset buffer memory area
The location information deposited includes:The positioning letter for the positioning service module 530 feedback that observed person's module 520 is received
Breath.
In summary, system described in the embodiment of the present invention:
1) external interface and primary LBS SDK interfaces are full decoupled, the convenient new LBS SDK of access, and are convenient for changing LBS
SDK;
2) observed person's module holds eavesdropping target using weak reference, it is to avoid memory overflow;
3) positioning service module is issued by broadcast notice messages progress location information, is realized striding course and is called positioning to believe
Breath.
4) in this implementation, called by a variety of functional interfaces, meet various location requirements.
It can be seen that, analysis and design of the present invention Jing Guo systematization consider a variety of demands, take into account function and performance, can
Allow APP developer to be directed to LBS SDK access and replacing in a short time, have found the high-performance solution party of the demand of satisfaction
Case.
Fourth embodiment of the invention provides a kind of computer-readable recording medium, is stored thereon with computer program, the journey
The step of general cut-in methods of LBS SDK described in first or second embodiments are realized when sequence is executed by processor.
Because the implementation process to the general cut-in methods of LBS SDK in first, second embodiment has been carried out in detail
Illustrate, it is no longer repeated herein for the present embodiment.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment was stressed is its difference with other embodiment.Particularly with system,
For storage medium embodiment, due to its substantially similar and embodiment of the method, so, fairly simple, the related part ginseng of description
See the part explanation of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can
To instruct the hardware of correlation to complete by program, the program can be stored in a computer-readable recording medium, storage
Medium can include:ROM, RAM, disk or CD etc..
In a word, the foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.
Within the spirit and principles of the invention, any modification, equivalent substitution and improvements made etc., should be included in the present invention's
Within protection domain.
Claims (10)
1. a kind of general cut-in methods of LBS SDK, it is characterised in that application program is including observer, observed person, positioning clothes
Under business, LBS SDK system architecture, methods described includes:
The observed person starts the positioning service when receiving the Location Request that the observer sends, and to described
Positioning service sends the Location Request;
The Location Request is sent to the LBS SDK and obtains the LBS by the positioning service by calling encapsulation class
The location information of SDK feedbacks, and the location information is sent to the observed person;
The observed person is received after the location information, is fed back to the observer.
2. the method as described in claim 1, it is characterised in that the positioning service is by calling encapsulation class, by the positioning
Request is sent to the LBS SDK and obtains the location information of the LBS SDK feedbacks, including:
The encapsulation class is called in the positioning service, the Location Request is sent into the encapsulation class, and receive the envelope
Fill the location information of class feedback;
Wherein, the Location Request is converted into the LBS SDK and supported by the encapsulation class after the Location Request is received
Data format after, call the native interface of the LBS SDK, the Location Request after form is changed is sent to the LBS
SDK, and institute is fed back to after the LBS SDK location informations fed back are converted into the data format that the positioning service is supported
State positioning service.
3. the method as described in claim 1, it is characterised in that the positioning service the Location Request is sent to it is described
Before LBS SDK, in addition to:The positioning service is initialized by calling the encapsulation class to the LBS SDK.
4. method as claimed in claim 3, it is characterised in that described to call encapsulation class to carry out initialization operation to LBS SDK
Realized by the sub-line journey of the positioning service;And/or, call encapsulation class to send Location Request to the LBS SDK and obtain institute
The positioning action for stating location information is realized by the sub-line journey of the positioning service.
5. the method as described in claim 1, it is characterised in that also include:
The positioning service obtains the positioning states change information of the LBS SDK feedbacks by calling the encapsulation class, and will
The positioning states change information is sent to the observed person;
The observed person feeds back the positioning states change information to the observer.
6. the method as described in any in claim 1-5, it is characterised in that the positioning service, will by way of broadcast
The LBS SDK feedacks are sent to the observed person.
7. the method as described in any in claim 1-5, it is characterised in that the observed person is receiving the observer
After the Location Request of transmission, in addition to:Observer's object is preserved, and holds by the way of weak reference observer's object.
8. the method as described in any in claim 1-5, it is characterised in that the observed person is provided with and different location requirements
The multiple external call interfaces matched;
The observer calls corresponding external call interface according to different location requirements, to be sent to the observed person
Corresponding Location Request.
9. the method as described in any in claim 1-5, it is characterised in that the observed person is receiving the observer
During the Location Request of transmission, in addition to:Whether effective location information is cached with detection preset buffer memory area and described effective
Location information whether meet the demand of the Location Request, when testing result is to be, by the location information for the demand that meets
Fed back to the observer;Otherwise, the positioning service is started;
Wherein, the location information cached in the preset buffer memory area includes:The positioning service that the observed person receives
The location information of feedback.
10. a kind of LBS SDK universal access systems, it is characterised in that including:Observer's module, observed person's module, positioning clothes
Module of being engaged in and LBS SDK;
Observer's module, for sending Location Request to observed person's module, and receives observed person's module
The location information of feedback;
Observed person's module, for when receiving the Location Request, starts the positioning service module, and to described
Positioning service module sends the Location Request, and when receiving the location information of the positioning service module feedback, will
The location information is sent to observer's module;
The positioning service module, for by calling encapsulation class, by the Location Request received be sent to LBS SDK with
And the location information of the LBS SDK feedbacks is obtained, and the location information is sent to the observed person.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710595276.2A CN107249180A (en) | 2017-07-20 | 2017-07-20 | The general cut-in methods of LBS SDK and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710595276.2A CN107249180A (en) | 2017-07-20 | 2017-07-20 | The general cut-in methods of LBS SDK and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107249180A true CN107249180A (en) | 2017-10-13 |
Family
ID=60014692
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710595276.2A Pending CN107249180A (en) | 2017-07-20 | 2017-07-20 | The general cut-in methods of LBS SDK and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107249180A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032693A (en) * | 2018-06-29 | 2018-12-18 | 北京金山安全软件有限公司 | Method and device for loading display information, electronic equipment and readable storage medium |
CN110704325A (en) * | 2019-10-09 | 2020-01-17 | 京东数字科技控股有限公司 | Data processing method and device, computer storage medium and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120110543A1 (en) * | 2010-10-29 | 2012-05-03 | Kwak Chae Hwa | Application Store System for Supporting Development of Application Interoperated with Unified Device and Method for Managing Application Store |
CN106453939A (en) * | 2016-10-28 | 2017-02-22 | 努比亚技术有限公司 | Streaming media access method and apparatus |
CN106776845A (en) * | 2016-11-28 | 2017-05-31 | 努比亚技术有限公司 | A kind of information flow adaptive management method and terminal |
CN106851583A (en) * | 2017-04-07 | 2017-06-13 | 广东欧珀移动通信有限公司 | The location information acquisition method of mobile terminal, device and mobile terminal |
CN106912104A (en) * | 2017-02-28 | 2017-06-30 | 和创(北京)科技股份有限公司 | Localization method and terminal device |
-
2017
- 2017-07-20 CN CN201710595276.2A patent/CN107249180A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120110543A1 (en) * | 2010-10-29 | 2012-05-03 | Kwak Chae Hwa | Application Store System for Supporting Development of Application Interoperated with Unified Device and Method for Managing Application Store |
CN106453939A (en) * | 2016-10-28 | 2017-02-22 | 努比亚技术有限公司 | Streaming media access method and apparatus |
CN106776845A (en) * | 2016-11-28 | 2017-05-31 | 努比亚技术有限公司 | A kind of information flow adaptive management method and terminal |
CN106912104A (en) * | 2017-02-28 | 2017-06-30 | 和创(北京)科技股份有限公司 | Localization method and terminal device |
CN106851583A (en) * | 2017-04-07 | 2017-06-13 | 广东欧珀移动通信有限公司 | The location information acquisition method of mobile terminal, device and mobile terminal |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032693A (en) * | 2018-06-29 | 2018-12-18 | 北京金山安全软件有限公司 | Method and device for loading display information, electronic equipment and readable storage medium |
CN110704325A (en) * | 2019-10-09 | 2020-01-17 | 京东数字科技控股有限公司 | Data processing method and device, computer storage medium and electronic equipment |
CN110704325B (en) * | 2019-10-09 | 2021-07-30 | 京东数字科技控股有限公司 | Data processing method and device, computer storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10467025B2 (en) | Managing delivery of code and dependent data using application containers | |
US10445083B2 (en) | Application containers with dynamic sub-package loading | |
AU2012348048B2 (en) | Contextual and location awareness for device interaction | |
US11853820B2 (en) | Cross-process communication method, apparatus, and device | |
CN112965700B (en) | Routing-based micro-service processing method and device, computer equipment and medium | |
KR20050010907A (en) | A method for handling position data in a mobile equipment, and a mobile equipment having improved position data handling capabilities | |
CN113141405B (en) | Service access method, middleware system, electronic device, and storage medium | |
CN106681749B (en) | Local code patch updating method and device based on android platform | |
CN103713943B (en) | Native terminal operating system based application function realization method and device | |
JP5004857B2 (en) | Application update information providing system and application update information providing method | |
CN109669787B (en) | Data transmission method and device, storage medium and electronic equipment | |
CN107249180A (en) | The general cut-in methods of LBS SDK and system | |
EP3853722B1 (en) | Implementation of core cellular networking stack on cloud infrastructure | |
CN111600812A (en) | Message processing method, processing device, readable medium and system | |
CN113435173B (en) | Text generation method, related device and system | |
CN107423291B (en) | Data translation method and client device | |
US11194603B2 (en) | User equipment, server, control method of the user equipment and control method of the server for performing ahead-of-time (AOT) compilation of an application based on usage frequency | |
EP1736881A1 (en) | Controlling collection of debugging data | |
CN114564700A (en) | Method and related device for managing communication of untrusted application programs | |
US10686717B1 (en) | Dynamic allocation of content requests to content providers | |
CN114691553A (en) | Method and device for accessing accessory device | |
CN113452536B (en) | Atomic object management method and device | |
CN113986743A (en) | Position information modification method and device, storage medium and electronic equipment | |
CN116800612A (en) | Configuration management method and related device based on cloud service | |
US8732352B1 (en) | Dynamic allocation of buffers for direct memory access |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171013 |