CN108419220A - Occur dodging the method moved back with bluetooth scanning failure for solving SDK - Google Patents

Occur dodging the method moved back with bluetooth scanning failure for solving SDK Download PDF

Info

Publication number
CN108419220A
CN108419220A CN201711477200.6A CN201711477200A CN108419220A CN 108419220 A CN108419220 A CN 108419220A CN 201711477200 A CN201711477200 A CN 201711477200A CN 108419220 A CN108419220 A CN 108419220A
Authority
CN
China
Prior art keywords
bluetooth
sdk
solving
beacon equipment
moved back
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
CN201711477200.6A
Other languages
Chinese (zh)
Other versions
CN108419220B (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.)
Wuhan Iron & Steel Engineering Technology Group Communications Co Ltd
Original Assignee
Wuhan Iron & Steel Engineering Technology Group Communications 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 Wuhan Iron & Steel Engineering Technology Group Communications Co Ltd filed Critical Wuhan Iron & Steel Engineering Technology Group Communications Co Ltd
Priority to CN201711477200.6A priority Critical patent/CN108419220B/en
Publication of CN108419220A publication Critical patent/CN108419220A/en
Application granted granted Critical
Publication of CN108419220B publication Critical patent/CN108419220B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Abstract

The present invention relates to Bluetooth technology field, provide it is a kind of occur dodging the method moved back with bluetooth scanning failure for solving SDK, include the following steps:S1, open a terminal on APP, obtain all Bluetooth base. station Beacon equipment of the terminal, peripheral;Each Bluetooth base. station Beacon equipment is put into same concurrent queue by S2;S3 incessantly one by one takes out the Bluetooth base. station Beacon equipment in the concurrent queue;S4 confirms in the concurrent queue whether there is task;It is then to judge whether beaconList is 0;It is no, then it returns in the S3 steps;S5 judges whether beaconList is 0;It is no, then judge whether number is more than the upper limit;It is then to restart scan service, then comes back in the S3 steps;S6 judges whether number is more than the upper limit;No, then count is incremented;It is then to return in the S3 steps.By equipment being put into same concurrent queue, to solve the problems, such as to dodge move back etc. it is unstable.

Description

Occur dodging the method moved back with bluetooth scanning failure for solving SDK
Technical field
The present invention relates to Bluetooth technology field, specially a kind of for solving, SDK appearance sudden strains of a muscle are moved back and bluetooth scans failure Method.
Background technology
As cell phone application, wechat using face are more and more wider, IBeacon --- it is based on 4.0 technology of low-power consumption bluetooth (BLE) A kind of hardware, can be played by special interface link up bridge beam action and user realization include sound, depending on, scheme, text etc. it is a variety of The interaction function of media, for example wechat is shaken, automatic trigger audio and video explanation etc. in guide to visitors of travelling, and has been present information The indispensable hot technology of society.The Bluetooth base. station equipment for also having profession in the market provides integrated bluetooth and connects SDK is met, developer is also greatly facilitated and carries out secondary development.
But find in the process of development, the SDK which provides is called for a long time on the mobile phone of part When will appear scanning failure and unstable lead to APP sudden strains of a muscle the phenomenon that moving back.
Invention content
Occur dodging the method moved back with bluetooth scanning failure for solving SDK the purpose of the present invention is to provide a kind of, at least It can solve segmental defect in the prior art.
To achieve the above object, the embodiment of the present invention provides the following technical solutions:One kind is moved back for solving SDK appearance sudden strains of a muscle With bluetooth scanning failure method, S1, open a terminal on APP, obtain all Bluetooth base. stations of the terminal, peripheral Beacon equipment;Each Bluetooth base. station Beacon equipment is put into same concurrent queue by S2;S3, incessantly one by one The Bluetooth base. station Beacon equipment in the concurrent queue is taken out;Whether S4, confirming has had in the concurrent queue Task;It is then to judge whether beaconList is 0;It is no, then it returns in the S3 steps;Whether S5 judges beaconList It is 0;It is no, then judge whether number is more than the upper limit;It is then to restart scan service, then comes back in the S3 steps; S6 judges whether number is more than the upper limit;No, then count is incremented;It is then to return in the S3 steps.
Further, APP saves all Bluetooth base. station Beacon equipment per second scanned, and judges to work as The number of the preceding Bluetooth base. station Beacon equipment, if within one continuous time, the Bluetooth base. station that neighboring scan arrives The number of Beacon equipment is all 0, then judges the information of the scanned Bluetooth base. station Beacon equipment less than periphery of SDK.
Further, all Bluetooth base. station Beacon equipment on the periphery per second scanned are put into same concurrent team In row, which does not do any other logical process and business operation, but carries out logic in another concurrent queue Processing and business operation.
Further, set sizes judgement and counting are carried out to the Bluetooth base. station Beacon equipment taken out, if continuous 8 The set sizes of secondary taking-up are all 0, then execute the operation for restarting bluetooth scan service, if the set sizes taken out not are 0, are counted Number plus 1.
Further, arbitrary adjustment and setting are carried out to counts using file interface.
Further, using Java language, beaconList and atom variable are constructed;The beaconList, for storing The Bluetooth base. station Beacon equipment that Current Scan arrives;The atom variable, the size for storing current beaconList Continuous is 0 number.
Further, the beaconList is stored using concurrent queue ConcurrentLinkedQueue.
Further, threading service TaskThread is recycled using safety, incessantly from the concurrent queue Poll goes out object in ConcurrentLinkedQueue, the size and the information content of beaconList described in dynamic analysis.
Further, it is customized using PrintWriter and generates serve log, safeguarded convenient for developer.
Compared with prior art, the beneficial effects of the invention are as follows:
1, by the way that each Bluetooth base. station Beacon equipment to be put into same concurrent queue, by monitor method and very Positive operation flow is effectively separated, and to reduce the load of monitor, ensures the thread-safe of high concurrent logical operation, from And solve the problems, such as to dodge move back etc. it is unstable.
2, it controls whether to restart scan service by judging whether beaconList is 0, to solving bluetooth SDK in portion The problem of will appear scanning failure when being called for a long time on departure machine.
Description of the drawings
Fig. 1 is provided in an embodiment of the present invention a kind of to occur dodging the method moved back with bluetooth scanning failure for solving SDK Flow chart of steps;
Fig. 2 is provided in an embodiment of the present invention a kind of to occur dodging the method moved back with bluetooth scanning failure for solving SDK Flow diagram.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts all other Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, the embodiment of the present invention provide it is a kind of for solve SDK occur dodge move back with bluetooth scanning failure side Method includes the following steps:S1, open a terminal on APP, all Bluetooth base. station Beacon for obtaining the terminal, peripheral set It is standby;Each Bluetooth base. station Beacon (Bi Ken) equipment is put into same concurrent queue by S2;S3 one by one will incessantly The Bluetooth base. station Beacon equipment in the concurrent queue is taken out;Whether S4 confirms to have had in the concurrent queue and appoint Business;It is then to judge whether beaconList (Bi Ken lists) is 0;It is no, then it returns in the S3 steps;S5 judges Whether beaconList is 0;It is no, then judge whether number is more than the upper limit;It is then to restart scan service, then comes back to institute It states in S3 steps;S6 judges whether number is more than the upper limit;No, then count is incremented;It is then to return in the S3 steps.This Invention keeps stablizing, carries out periphery bluetooth in the case of calling the SDK long-plays of third party's IBeacon Bluetooth base. stations Base station scans and logic judgment find out the bluetooth equipment nearest from mobile phone, and nearest Bluetooth base. station information is provided for upper layer software (applications) Form logic function flow closed loop.By the way that each Bluetooth base. station Beacon equipment to be put into same concurrent queue, will supervise It listens device method and real operation flow to be effectively separated, to reduce the load of monitor, ensures high concurrent logical operation Thread-safe, to solve the problems, such as to dodge move back etc. it is unstable.And it is controlled whether by judging whether beaconList is 0 Restart scan service, will appear when being called for a long time on the mobile phone of part to solve bluetooth SDK (Software Development Kit) The problem of scanning failure.
As the prioritization scheme of the embodiment of the present invention, APP is by all Bluetooth base. station Beacon per second scanned Equipment saves, and judges the number of presently described Bluetooth base. station Beacon equipment, if within one continuous time, periphery The number of the Bluetooth base. station Beacon equipment scanned is all 0, then judges the scanned Bluetooth base. stations less than periphery of SDK The information of Beacon equipment.Solve the problems, such as the Bluetooth base. station information for how judging Current Scan less than periphery.
As the prioritization scheme of the embodiment of the present invention, by all Bluetooth base. stations on the periphery per second scanned Beacon equipment is put into same concurrent queue, which does not do any other logical process and business operation, but Logical process and business operation are carried out in another concurrent queue.Solve that bluetooth SDK monitor threads are dangerous to be caused not Stablize and dodges the problem of moving back.
It is big into row set to the Bluetooth base. station Beacon equipment taken out as the prioritization scheme of the embodiment of the present invention Small judgement and counting execute the operation for restarting bluetooth scan service if the set sizes of continuous 8 taking-ups are all 0, if taking out Set sizes not be 0, then count is incremented.Solve how to carry out restoring when finding scanning less than periphery Bluetooth base. station information sweeping It retouches.
As the prioritization scheme of the embodiment of the present invention, using file interface can counts carry out arbitrary adjustment and set It sets, convenient for choosing whether adjustment counts according to actual conditions.
BeaconList and atom variable are constructed using Java language as the prioritization scheme of the embodiment of the present invention;It is described BeaconList, the Bluetooth base. station Beacon equipment arrived for storing Current Scan;The atom variable is worked as storing The size of preceding beaconList is continuously 0 number.BeaconList and atom variable are all made of Java language exploitation, atom Variable can ensure the uniqueness in concurrent operations.
As the prioritization scheme of the embodiment of the present invention, described in concurrent queue ConcurrentLinkedQueue storages beaconList.Specifically, in the monitor method that Bluetooth base. station SDK is provided, the periphery scanned will only be housed The beaconList of Bluetooth base. station beacon equipment is put into this concurrent queue, and pipe is carried out to the task of each cycle criterion Reason.
As the prioritization scheme of the embodiment of the present invention, threading service TaskThread is recycled using safety, incessantly from Poll (choosing) goes out object in the concurrent queue ConcurrentLinkedQueue, being capable of beaconList described in dynamic analysis Size and the information content.
As the prioritization scheme of the embodiment of the present invention, is customized using PrintWriter and generate serve log, convenient for exploitation Personnel safeguard.
It although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, can be with Understanding without departing from the principles and spirit of the present invention can carry out these embodiments a variety of variations, modification, replace And modification, the scope of the present invention is defined by the appended.

Claims (9)

1. a kind of occur dodging the method moved back with bluetooth scanning failure for solving SDK, which is characterized in that include the following steps:
S1, open a terminal on APP, obtain all Bluetooth base. station Beacon equipment of the terminal, peripheral;
Each Bluetooth base. station Beacon equipment is put into same concurrent queue by S2;
S3 incessantly one by one takes out the Bluetooth base. station Beacon equipment in the concurrent queue;
S4 confirms in the concurrent queue whether there is task;It is then to judge whether beaconList is 0;It is no, then it returns In the S3 steps;
S5 judges whether beaconList is 0;It is no, then judge whether number is more than the upper limit;It is then to restart scan service, then It comes back in the S3 steps;
S6 judges whether number is more than the upper limit;No, then count is incremented;It is then to return in the S3 steps.
2. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:APP saves all Bluetooth base. station Beacon equipment per second scanned, and judges presently described bluetooth base The number for Beacon equipment of standing, if within one continuous time, the Bluetooth base. station Beacon equipment that neighboring scan arrives Number is all 0, then judges the information of the scanned Bluetooth base. station Beacon equipment less than periphery of SDK.
3. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:All Bluetooth base. station Beacon equipment on the periphery per second scanned are put into same concurrent queue, this is concurrent Any other logical process and business operation are not done in queue, but logical process and business behaviour are carried out in another concurrent queue Make.
4. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:Set sizes judgement and counting are carried out to the Bluetooth base. station Beacon equipment taken out, if the set of continuous 8 taking-ups Size is all 0, then executes the operation for restarting bluetooth scan service, if the set sizes taken out not are 0, count is incremented.
5. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:Arbitrary adjustment and setting are carried out to counts using file interface.
6. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:
Using Java language, beaconList and atom variable are constructed;
The beaconList, the Bluetooth base. station Beacon equipment arrived for storing Current Scan;
The atom variable, the size for storing current beaconList are continuously 0 number.
7. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:The beaconList is stored using concurrent queue ConcurrentLinkedQueue.
8. a kind of as claimed in claim 7 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:Threading service TaskThread is recycled using safety, incessantly from the concurrent queue ConcurrentLinkedQueue Middle poll goes out object, the size and the information content of beaconList described in dynamic analysis.
9. a kind of as described in claim 1 occur dodging the method moved back and failed with bluetooth scanning for solving SDK, feature exists In:It is customized using PrintWriter and generates serve log, safeguarded convenient for developer.
CN201711477200.6A 2017-12-29 2017-12-29 Method for solving flash back and Bluetooth scanning failure of SDK Active CN108419220B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711477200.6A CN108419220B (en) 2017-12-29 2017-12-29 Method for solving flash back and Bluetooth scanning failure of SDK

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711477200.6A CN108419220B (en) 2017-12-29 2017-12-29 Method for solving flash back and Bluetooth scanning failure of SDK

Publications (2)

Publication Number Publication Date
CN108419220A true CN108419220A (en) 2018-08-17
CN108419220B CN108419220B (en) 2020-12-01

Family

ID=63125658

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711477200.6A Active CN108419220B (en) 2017-12-29 2017-12-29 Method for solving flash back and Bluetooth scanning failure of SDK

Country Status (1)

Country Link
CN (1) CN108419220B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612593A (en) * 2020-12-28 2021-04-06 深圳Tcl新技术有限公司 Bluetooth control method, device, terminal equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813365A (en) * 2014-03-11 2014-05-21 福州瑞芯微电子有限公司 WDS support system, device and method based on Android system
US20160095063A1 (en) * 2014-09-30 2016-03-31 Apple Inc. Scoring Beacon Messages for Mobile Device Wake-Up
US20160148270A1 (en) * 2014-11-26 2016-05-26 Apple Inc. Campaign Management Systems for Creating and Managing Beacon Based Campaigns
US9398519B2 (en) * 2012-06-22 2016-07-19 Apple Inc. Beacon frame monitoring

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9398519B2 (en) * 2012-06-22 2016-07-19 Apple Inc. Beacon frame monitoring
CN103813365A (en) * 2014-03-11 2014-05-21 福州瑞芯微电子有限公司 WDS support system, device and method based on Android system
US20160095063A1 (en) * 2014-09-30 2016-03-31 Apple Inc. Scoring Beacon Messages for Mobile Device Wake-Up
US20160148270A1 (en) * 2014-11-26 2016-05-26 Apple Inc. Campaign Management Systems for Creating and Managing Beacon Based Campaigns

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612593A (en) * 2020-12-28 2021-04-06 深圳Tcl新技术有限公司 Bluetooth control method, device, terminal equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN108419220B (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN104539815B (en) Method and device for performing multi-party call in communication terminal
CN107688422A (en) Notification message display methods and device
CN108810275A (en) A kind of information displaying method and device
CN102968274A (en) Free screen capturing method and free screen capturing system in mobile device
CN103049274A (en) Device and method for task event processing
CN104363335A (en) Intelligent incoming call answering method and mobile terminals
CN112887927B (en) Voice fallback method and device and user equipment
CN104679330B (en) Control method and device based on Rimless terminal
CN107864297A (en) Group's adding method, device, terminal and storage medium
CN105516638B (en) A kind of video call method, device and system
CN105260086A (en) Notice viewing method, notice viewing device and terminal
CN106155721A (en) The deployment method of application program, the generation method and device of the recommendation page
CN108055404A (en) Reminder announced method, apparatus, terminal and storage medium
CN104602277B (en) A kind of optimized treatment method switched extremely and system
US10116780B2 (en) Quick communication method and device, and storage medium
CN105262881A (en) Communication control method and electronic equipment
CN105988886B (en) Fault handling method and device during a kind of O&M
CN108419220A (en) Occur dodging the method moved back with bluetooth scanning failure for solving SDK
CN103974216A (en) Information processing method and electronic equipment
CN107450952A (en) Using management-control method, device, storage medium and electronic equipment
US20120173636A1 (en) Creating implicit instant messaging contact list groups
CN104244220B (en) Communication service processing method and communication terminal
CN107368326A (en) Course control method and device
CN104219361B (en) The method and mobile terminal of double card information searching
CN106339155A (en) File sharing 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
CB02 Change of applicant information

Address after: 430000 gate 1, changqian, Qingshan District, Wuhan City, Hubei Province

Applicant after: Wuhan WISCO Green City Technology Development Co.,Ltd.

Address before: 430000 WISCO communication company, No. two, industrial road ten, Qingshan District, Wuhan, Hubei

Applicant before: WUHAN STEELS ENGINEERING TECHNOLOGY GROUP TELECOMMUNICATION Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant