CN105516926B - A kind of network locating method, device and mobile terminal - Google Patents
A kind of network locating method, device and mobile terminal Download PDFInfo
- Publication number
- CN105516926B CN105516926B CN201610023999.0A CN201610023999A CN105516926B CN 105516926 B CN105516926 B CN 105516926B CN 201610023999 A CN201610023999 A CN 201610023999A CN 105516926 B CN105516926 B CN 105516926B
- Authority
- CN
- China
- Prior art keywords
- network
- location service
- service
- interface
- network location
- 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.)
- Active
Links
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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W64/00—Locating users or terminals or network equipment for network management purposes, e.g. mobility management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses a kind of network locating method, device and mobile terminal, this method includes:Network positions interface is created with opening network positioning service, and creates network location service watcher thread;When the network location service watcher thread, which listens to the network location service, to interrupt, network positions interface is re-created with opening network positioning service.When this programme realizes network location service and accidental switched off, automatically turn on again.
Description
Technical field
The present embodiments relate to network location technology, more particularly to a kind of network locating method, system and mobile terminal.
Background technology
Network positions refer to the positional information that terminal device is obtained by specific location technology, and the skill being labeled
Art or service.More typical positioning method has two kinds, and a kind of is the positioning based on GPS, and a kind of is the base based on mobile operation network
The positioning stood.Positioning method based on GPS is to be sent out the position reference of oneself using the d GPS locating module on terminal device
Positioning backstage is sent to realize positioning.Architecture is then to determine that terminal is set using measuring and calculating of the base station to the distance of terminal device
Standby position.
No matter in the prior art using which kind of positioning method, once finder surprisingly terminates during network positions,
Then network location service is accordingly closed and can not automatically turned on again.
The content of the invention
The present invention provides a kind of network locating method, system and mobile terminal, to realize that network location service accidental switches off
When, automatically turn on again.
In a first aspect, the embodiments of the invention provide a kind of network locating method, including:
Network positions interface is created with opening network positioning service, and creates network location service watcher thread;
When the network location service watcher thread, which listens to the network location service, to interrupt, re-create network and determine
Position interface is with opening network positioning service.
Second aspect, the embodiment of the present invention additionally provide a kind of network positions device, including:
Creation module, for creating network positions interface with opening network positioning service, and create network location service prison
Listen thread;
Module is rebuild, for when the network location service watcher thread listens to the network location service and interrupted,
Network positions interface is re-created with opening network positioning service.
The third aspect, the embodiment of the present invention additionally provide a kind of mobile terminal, a kind of net of the mobile terminal integrated installation
Network positioner, the network positions device, including:
Creation module, for creating network positions interface with opening network positioning service, and create network location service prison
Listen thread;
Module is rebuild, for when the network location service watcher thread listens to the network location service and interrupted,
Network positions interface is re-created with opening network positioning service.
The present invention creates network location service listening-in line by creating network positions interface with opening network positioning service
Journey, when the network location service watcher thread, which listens to the network location service, to interrupt, re-create network positions and connect
Mouth is with opening network positioning service, once solving accidental interruption during network positions, then network location service is accordingly closed
And the problem of can not automatically turning on again, realize the automatic opening again when network location service accidental switches off.
Brief description of the drawings
Fig. 1 is the flow chart for the network locating method that the embodiment of the present invention one provides;
Fig. 2 is the flow chart for the network locating method that the embodiment of the present invention two provides;
Fig. 3 is the flow chart for the network locating method that the embodiment of the present invention three provides;
Fig. 4 is the flow chart for the network locating method that the embodiment of the present invention four provides;
Fig. 5 is the structure chart for the network positions device that the embodiment of the present invention five provides;
Fig. 6 is the flow chart for the network locating method that the embodiment of the present invention seven provides.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that in order to just
Part related to the present invention rather than entire infrastructure are illustrate only in description, accompanying drawing.
Embodiment one
Fig. 1 is the flow chart for the network locating method that the embodiment of the present invention one provides, and the present embodiment, which is applicable to user, to be made
Situation about being positioned with intelligent terminal, this method can be performed by intelligent terminal such as smart mobile phone, specific bag
Include following steps:
Step 101, network positions interface is created with opening network positioning service, and create network location service listening-in line
Journey;
Wherein, when network location service needs to open, it is necessary first to create network positions interface, the network positions interface
Realize shared between data.While network positions interface is created, network location service watcher thread is created, the monitoring
Thread is used for the state for monitoring network service.
Step 102, when the network location service watcher thread listens to the network location service and interrupted, create again
Establishing network locating interface is with opening network positioning service;
Wherein, network location service watcher thread once listens to network location service interruption, then re-creates network and determine
Position interface, the network positions interface re-created by this are again turned on network location service.
The technical scheme of the present embodiment, by creating network positions interface with opening network positioning service, and create network
Positioning service watcher thread, when the network location service watcher thread, which listens to the network location service, to interrupt, again
Network positions interface is created with opening network positioning service, once solving accidental interruption during network positions, then network is determined
The problem of position service is accordingly closed and can not automatically turned on again, realizes again automatic when network location service accidental switches off
Open.
In such scheme preferably, before network positions interface is created with opening network positioning service, in addition to:
Receive the request of user's opening network positioning service.Network positions are carried out i.e. when user opens the network location service function to connect
The establishment of mouth.If network location service is arranged into automatic opening pattern, intelligent terminal will be certainly in opening initialization
The dynamic network positions interface that creates is with opening network positioning service.
Embodiment two
Fig. 2 is the flow chart for the network locating method that the embodiment of the present invention two provides, and the present embodiment is in above-described embodiment
On the basis of, give a kind of preferable realize and create network positions interface with opening network positioning service, and create network positions
The scheme of watcher thread is serviced, this realizes that the method for network positions includes:
Step 201, thread creation network positions interface created with opening network positioning service by the interface of operating system layer,
And thread creation network location service watcher thread is created by the interface, supervised with the state to the network location service
Listen.
Step 202, when the network location service watcher thread listens to the network location service and interrupted, create again
Establishing network locating interface is with opening network positioning service.
The technical scheme of the present embodiment, thread creation network positions interface is created to open net by the interface of operating system layer
Network positioning service, and thread creation network location service watcher thread is created by the interface, with to the network location service
State monitored, improve the establishment efficiency of network positions interface and network location service watcher thread, created with by interface
Thread creation network location service watcher thread is built so that the stability monitored gets a promotion.
Embodiment three
Fig. 3 is the flow chart for the network locating method that the embodiment of the present invention three provides, and the present embodiment is in above-described embodiment
On the basis of, give it is a kind of preferable realize when listening to network location service and interrupting, re-create network positions interface with
The scheme of opening network positioning service, this realizes that the method for network positions includes:
Step 301, thread creation network positions interface created with opening network positioning service by the interface of operating system layer,
And thread creation network location service watcher thread is created by the interface, supervised with the state to the network location service
Listen.
Step 302, when the network location service watcher thread listens to the network location service and interrupted, call net
Network positioning service interrupt method;
Wherein, the network location service interrupt method is preferably embedded in network location service watcher thread.
Step 303, network reorientation broadcast is sent according to the network location service interrupt method;
When step 304, interface create thread and receive network reorientation broadcast, re-create network positions interface with
Opening network positioning service.
In the technical scheme of the present embodiment, when network location service interrupts, by calling network location service interruption side
Method send network reorientation broadcast, and then by interface create thread receive the network reorientation broadcast when, re-create net
Network locating interface makes full use of the network location service embedded in network location service watcher thread with opening network positioning service
Interrupt method so that the system resource that the process of network reorientation takes is minimum, while can be interrupted in network location service the
One time opened reorientation.
In such scheme preferably, network reorientation broadcast packet is sent according to the network location service interrupt method
Include:The network reorientation that the bag name comprising network location service installation kit is sent according to the network location service interrupt method please
Ask.The bag name of the network location service installation kit is used for recognition and verification network location service installation procedure.
In such scheme preferably, can further comprise after step 304:Judge network location service whether again
Open successfully, being obtained if failure is reopened causes to open the display interface that the parameter command to fail passes through intelligent terminal
Failure cause is opened in display;Performed again after preset time and re-create network positions interface with opening network positioning service
Operation.The preset time preferably may be configured as 1 minute.
Example IV
Fig. 4 is the flow chart for the network locating method that the embodiment of the present invention four provides, and the present embodiment is in above-described embodiment
On the basis of, the operation for judging network location service interrupt type is further increased, the network locating method specifically includes:
Step 401, network positions interface is created with opening network positioning service, and create network location service listening-in line
Journey.
Step 402, when the network location service watcher thread listens to the network location service and interrupted, judge institute
State the interrupt type of network location service interruption;
Step 403, the interrupt type be that free memory is too low, CPU usage is too high and program conflict at least one
During kind, network positions interface is re-created with opening network positioning service;
There are a variety of interrupt modes and interrupt network location service in intelligent terminal, interrupt type is main in the process of running
Actively closed including user, free memory is too low, CPU usage is too high and program conflict etc., when judging interrupt type to be inhuman
When being accidental switched off to close, such as free memory is too low, CPU usage is too high and program conflict, then re-creates network
Locating interface is with opening network positioning service.
In the technical scheme of the present embodiment, when network location service interrupts, first determine whether in the network location service
Disconnected interrupt type, when interrupt type is that free memory is too low, CPU usage is too high and during at least one of program conflict, weight
The new network positions interface that creates is with opening network positioning service.By judging interrupt type in advance, when user's normal switching-off network
Positioning service is other when causing the interruption that can not reopen network location service to cause the network location service to interrupt, without weight
The new network positions interface that creates is with opening network positioning service so that scheme is more perfect.
Embodiment five
Fig. 5 show the structure chart of the network positions device of the offer of the embodiment of the present invention five, and the present embodiment is applicable to net
Network positioning service accidental interruption situation, the network positions device include:
Creation module 1, for creating network positions interface with opening network positioning service, and create network location service prison
Listen thread;
Module 2 is rebuild, for when the network location service watcher thread listens to the network location service and interrupted,
Network positions interface is re-created with opening network positioning service.
The technical scheme of the present embodiment, network positions interface is created with opening network positioning service by creation module 1, and
Network location service watcher thread is created, is interrupted when the network location service watcher thread listens to the network location service
When, rebuild module 2 and re-create network positions interface with opening network positioning service, solve during network positions once anticipate
Outer interruption, then network location service corresponding the problem of closing and can not automatically turning on again, realize network location service accident
Automatic opening again during closing.
In such scheme preferably, the creation module 1 is specifically used for:Line is created by the interface of operating system layer
Journey creates network positions interface with opening network positioning service, and creates thread creation network location service by the interface and supervise
Thread is listened, is monitored with the state to the network location service.
In such scheme preferably, the reconstruction module 2 is specifically used for:When the network location service watcher thread
When listening to the network location service interruption, network location service interrupt method is called;According in the network location service
Disconnected method sends network reorientation broadcast;When the interface establishment thread receives the network reorientation broadcast, re-create
Network positions interface is with opening network positioning service.
In such scheme preferably, the reconstruction module 2 is specifically used for:According to the network location service interruption side
Method sends the network re-positioning request of the bag name comprising network location service installation kit.
In such scheme preferably, the creation module 1 is additionally operable to:Receive asking for user's opening network positioning service
Ask.
In such scheme preferably, the reconstruction module 2 is additionally operable to:In judging that the network location service interrupts
Disconnected type;It is that free memory is too low, CPU usage is too high and during at least one of program conflict in the interrupt type, again
Network positions interface is created with opening network positioning service.
The said goods can perform the method that any embodiment of the present invention is provided, and possess the corresponding functional module of execution method
And beneficial effect.
Embodiment six
A kind of mobile terminal is present embodiments provided, the mobile terminal integrated installation has the device that embodiment five describes.Should
Mobile terminal possesses common network location service function, can be the network positions terminal device of customization, intelligent hand typically
The products such as machine, tablet personal computer, notebook computer, Medical Devices, car-mounted terminal.
Embodiment seven
Fig. 6 is the flow chart for the network locating method that the embodiment of the present invention seven provides, and the present embodiment is in above-described embodiment
On the basis of, there is provided a kind of preferred embodiment is specifically included with realizing network positions in Android operation system:
Step 601, network positions provider is created with opening network positioning service, and initialize one
ServiceWatcher。
Wherein, provider is a kind of mechanism of application program data sharing, by creating network positions provider
The network location service of installation is internally integrated with calling system, while network positions provider is created,
A ServiceWatcher is created inside provider, the ServiceWatcher is used for the state for monitoring network location service.
Step 602, onServiceDisconnected methods are realized in ServiceWatcher.
Wherein, ServiceConnection classes include two methods in Android operation system, are respectively
ServiceConnection methods and onServiceDisconnected methods, called when servicing successful connection
ServiceConnection methods, onServiceDisconnected methods are called when servicing accidental interruption.
Step 603, when ServiceWatcher listen to network location service interrupt when, call
OnServiceDisconnected methods send network reorientation broadcast, re-create network positions provider to open net
Network positioning service.
Wherein, onServiceDisconnected methods will not be called in the case where connecting normal switching-off, the party
Method only Service be destroyed or it is killed when call.In this step, when network location service is destroyed or by
Kill, typical such as system resource deficiency calls onServiceDisconnected side, it is necessary to when closing network location service
Method.Record has the bag name of network location service installation kit in the onServiceDisconnected methods, when
OnServiceDisconnected methods then send the network reorientation broadcast containing the bag name when called, re-create net
Network positions provider with opening network positioning service.
The technical scheme of the present embodiment, by creating network positions provider with opening network positioning service, and initially
Change a ServiceWatcher, onServiceDisconnected methods are realized in ServiceWatcher, when
When ServiceWatcher listens to network location service interruption, onServiceDisconnected methods are called to send network
Reorientation broadcast, network positions provider is re-created with opening network positioning service, realizes network location service accident
Automatic opening again during closing.
Pay attention to, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes,
Readjust and substitute without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.
Claims (9)
- A kind of 1. network locating method, it is characterised in that including:Network positions interface is created with opening network positioning service, and creates network location service watcher thread;When the network location service watcher thread, which listens to the network location service, to interrupt, re-create network positions and connect Mouth is with opening network positioning service;Wherein, system is Android system;The network location service watcher thread is ServiceWatcher;When When ServiceWatcher listens to network location service interruption, onServiceDisconnected methods are called to send network Reorientation broadcast, re-creates network positions provider with opening network positioning service;Wherein, the establishment network positions interface is with opening network positioning service, and creates network location service watcher thread bag Include:Thread creation network positions interface is created with opening network positioning service by the interface of operating system layer, and by the interface Thread creation network location service watcher thread is created, is monitored with the state to the network location service;Wherein, it is described when the network location service watcher thread listens to the network location service and interrupted, re-create Network positions interface is included with opening network positioning service:When the network location service watcher thread, which listens to the network location service, to interrupt, call in network location service Disconnected method;Network reorientation broadcast is sent according to the network location service interrupt method;When the interface establishment thread receives the network reorientation broadcast, network positions interface is re-created with opening network Positioning service.
- 2. network locating method according to claim 1, it is characterised in that described to be interrupted according to the network location service Method, which sends network reorientation broadcast, to be included:The network that the bag name comprising network location service installation kit is sent according to the network location service interrupt method relocates Request.
- 3. network locating method according to claim 1, it is characterised in that create network positions interface described to open Before network location service, in addition to:Receive the request of user's opening network positioning service.
- 4. according to the network locating method any one of claim 1-3, it is characterised in that re-create network described Before locating interface is with opening network positioning service, in addition to:Judge the interrupt type that the network location service interrupts;The network positions interface that re-creates is included with opening network positioning service:It is that free memory is too low, CPU usage is too high and during at least one of program conflict in the interrupt type, re-creates Network positions interface is with opening network positioning service.
- A kind of 5. network positions device, it is characterised in that including:Creation module, for creating network positions interface with opening network positioning service, and create network location service listening-in line Journey;Module is rebuild, for when the network location service watcher thread listens to the network location service and interrupted, again Network positions interface is created with opening network positioning service;Wherein, system is Android system;The network location service watcher thread is ServiceWatcher;When When ServiceWatcher listens to network location service interruption, onServiceDisconnected methods are called to send network Reorientation broadcast, re-creates network positions provider with opening network positioning service;Wherein, the creation module is specifically used for:Thread creation network positions interface is created with opening network positioning service by the interface of operating system layer, and by described Interface creates thread creation network location service watcher thread, is monitored with the state to the network location service;Wherein, the reconstruction module is specifically used for:When the network location service watcher thread, which listens to the network location service, to interrupt, call in network location service Disconnected method;Network reorientation broadcast is sent according to the network location service interrupt method;When the interface establishment thread receives the network reorientation broadcast, network positions interface is re-created with opening network Positioning service.
- 6. network positions device according to claim 5, it is characterised in that the reconstruction module is specifically used for:The network that the bag name comprising network location service installation kit is sent according to the network location service interrupt method relocates Request.
- 7. network positions device according to claim 5, it is characterised in that the creation module is additionally operable to:Receive the request of user's opening network positioning service.
- 8. the network positions device according to any one of claim 5-7, it is characterised in that the reconstruction module is also used In:Judge the interrupt type that the network location service interrupts;It is that free memory is too low, CPU usage is too high and during at least one of program conflict in the interrupt type, re-creates Network positions interface is with opening network positioning service.
- 9. a kind of mobile terminal, it is characterised in that the mobile terminal is integrated with the network as described in claim 5-8 any one Positioner.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610023999.0A CN105516926B (en) | 2016-01-13 | 2016-01-13 | A kind of network locating method, device and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610023999.0A CN105516926B (en) | 2016-01-13 | 2016-01-13 | A kind of network locating method, device and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105516926A CN105516926A (en) | 2016-04-20 |
CN105516926B true CN105516926B (en) | 2018-03-27 |
Family
ID=55724498
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610023999.0A Active CN105516926B (en) | 2016-01-13 | 2016-01-13 | A kind of network locating method, device and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105516926B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106851819B (en) * | 2016-12-23 | 2020-04-21 | 北京微影时代科技有限公司 | Positioning method and device |
CN110392157B (en) * | 2018-04-19 | 2020-07-31 | 珠海格力电器股份有限公司 | Information processing method and device and electronic equipment |
CN108710534A (en) * | 2018-05-22 | 2018-10-26 | 广州优视网络科技有限公司 | The tune of multi-process plays method, apparatus, terminal device and computer storage media |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102103676A (en) * | 2011-02-28 | 2011-06-22 | 南京邮电大学 | Method for protecting Java program progress based on inheritance relationship among progresses |
CN104410951A (en) * | 2014-10-21 | 2015-03-11 | 刘芳 | Intelligent terminal tracking locating method and intelligent terminal |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8665082B2 (en) * | 2003-10-15 | 2014-03-04 | Arthroscopic Surgery Associates Corporation | Method and apparatus for monitoring conditions |
-
2016
- 2016-01-13 CN CN201610023999.0A patent/CN105516926B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102103676A (en) * | 2011-02-28 | 2011-06-22 | 南京邮电大学 | Method for protecting Java program progress based on inheritance relationship among progresses |
CN104410951A (en) * | 2014-10-21 | 2015-03-11 | 刘芳 | Intelligent terminal tracking locating method and intelligent terminal |
Also Published As
Publication number | Publication date |
---|---|
CN105516926A (en) | 2016-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8744519B2 (en) | Multimodal phone data session management enhancement that alleviates dual transmission problems | |
CN105516926B (en) | A kind of network locating method, device and mobile terminal | |
CN102893653B (en) | Wireless wide area network bandwidth constraint in supervisory communications network | |
CN103294553A (en) | Method and device for managing multimedia resources of mobile terminal | |
CN104601818A (en) | Method and device for switching operating systems in communication process | |
CN112799786A (en) | Exit method, device, equipment and storage medium of micro-service instance | |
CN109743722A (en) | It is connected to the network treating method and apparatus | |
CN103914321A (en) | Method for invoking message processing capacity of system and mobile terminal | |
CN102547665A (en) | Communication processing method and communication processing device | |
CN103257889B (en) | Application program management device and management method for hybrid architecture system | |
CN103067593B (en) | A kind of double card bilateral software system architecture based on Android platform and operation method thereof | |
WO2012129930A1 (en) | Multi-standard drive method and system, and terminal | |
CN106060031B (en) | Multimedia communication control method, server and system | |
CN107592618A (en) | A kind of crosstalk reminding method, device and storage medium | |
US20120320877A1 (en) | Method, System and Base Station Subsystem for Realizing Handover in Local Switch | |
CN109286996A (en) | Mode switching method, bluetooth equipment, apparatus and system based on bluetooth connection | |
CN103685779B (en) | A kind of user satisfaction management system and the method carrying out call manager thereof | |
CN105072185A (en) | TR069 (Technical Report 069) remote monitoring method and system, and communication equipment | |
CN104394264A (en) | Method and system of preventing recording interruption | |
CN107609843A (en) | Contract renewal method and server | |
CN102843263B (en) | Remote backup method for dispatcher station | |
CN109857720B (en) | Database table monitoring method, device, computer device and readable storage medium | |
CN108156192A (en) | Android RIL message handling systems and method | |
CN101977411A (en) | Communication method and communication device of double-network double-standby terminal | |
US20070123172A1 (en) | Corruption detection of digital hardware configuration |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |