CN107835506A - A kind of Bluetooth communication method, bluetooth equipment and computer-readable recording medium - Google Patents

A kind of Bluetooth communication method, bluetooth equipment and computer-readable recording medium Download PDF

Info

Publication number
CN107835506A
CN107835506A CN201711020090.0A CN201711020090A CN107835506A CN 107835506 A CN107835506 A CN 107835506A CN 201711020090 A CN201711020090 A CN 201711020090A CN 107835506 A CN107835506 A CN 107835506A
Authority
CN
China
Prior art keywords
channel
channel number
bluetooth
frequency hopping
communication method
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
CN201711020090.0A
Other languages
Chinese (zh)
Other versions
CN107835506B (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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201711020090.0A priority Critical patent/CN107835506B/en
Publication of CN107835506A publication Critical patent/CN107835506A/en
Application granted granted Critical
Publication of CN107835506B publication Critical patent/CN107835506B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/18Network architectures or network communication protocols for network security using different networks or channels, e.g. using out of band channels

Abstract

The invention discloses a kind of Bluetooth communication method, bluetooth equipment and computer-readable recording medium, belong to communication technique field.Methods described includes:A, in communication process, binary system random code S is obtained;B, the binary system random code is converted into decimal system U;C, bring the decimal system U into default algorithms to be calculated, to obtain the channel number W being included in the channel number to prestore;D, judge whether channel is unoccupied corresponding to channel number W, if so, performing step E, otherwise performing step A;E, channel corresponding to frequency hopping to channel number W.Using the present invention, in communication process, utilize binary system random code and default algorithm, the numbering of available channel at random calculating, then frequency hopping is to changing in available channel, and not only algorithm is simple, and because the channel of its each frequency hopping is all random uncertain, therefore the risk that communication data is monitored and intercepts and captures is effectively reduced, improves the security of Bluetooth communication.

Description

A kind of Bluetooth communication method, bluetooth equipment and computer-readable recording medium
Technical field
The present invention relates to communication technique field, more particularly to a kind of Bluetooth communication method, bluetooth equipment and computer-readable Storage medium.
Background technology
Bluetooth is a kind of wireless technology standard, be can be achieved short between fixed equipment, mobile device and building personal area network Range data exchanges.Bluetooth equipment is generally operational in 2.4G ISM band.Because bluetooth is sent and received using radio wave Signal, therefore, it is easy to monitored and attacked.Prior art typically relies on blue to improve the security of Bluetooth communication The security mechanism of tooth agreement in itself, or the data content of communication is encrypted.
But not only algorithm is complicated for both approaches, and the risk that data are intercepted and cracked be present.Therefore, it is necessary to There is provided that a kind of algorithm is simple, data are not easy the Bluetooth communication method, bluetooth equipment and computer-readable storage medium being intercepted.
The content of the invention
In view of this, it is an object of the invention to provide a kind of Bluetooth communication method, bluetooth equipment and computer-readable deposit Storage media, to solve the problems, such as that prior art Bluetooth communication secure cryptographic algorithm is complicated and security is not high.
Technical scheme is as follows used by the present invention solves above-mentioned technical problem:
According to the first aspect of the invention, there is provided a kind of Bluetooth communication method, the communication means comprise the following steps:
A, in communication process, binary system random code S is obtained;
B, the binary system random code is converted into decimal system U;
C, bring the decimal system U into default algorithms to be calculated, be included in obtaining in the channel number to prestore Channel number W;
D, judge whether channel is unoccupied corresponding to channel number W, if so, performing step E, otherwise performing step A;
E, channel corresponding to frequency hopping to channel number W.
Preferably, the Bluetooth communication method also includes:
Prestore channel number corresponding to frequency hopping point;
Wherein, the frequency hopping point is the 79 frequency hopping points set up by bandwidth of 1MHz in bluetooth working frequency range, the channel Serial Number Range is 0 to 78 integer.
Preferably, it is described to bring the decimal system U into default algorithms and calculated, it is included in the channel to prestore to obtain Channel number W in numbering, including:
C1, the initial value of acquisition variable i are i=0;
C2, calculate W=U- (t-1) * 79, t=i+1;
C3, judge whether W meets 0≤W≤78, if so, performing step D, otherwise, make i=i+1, and perform step C2.
Preferably, the step A is in communication process, and before obtaining binary system random code S, the Bluetooth communication method is also Including:
Complete the transformation task of a packet.
Preferably, after the E frequency hoppings to channel corresponding to channel number W, the Bluetooth communication method also includes:
In the next packet of transmission corresponding to channel number W.
According to the second aspect of the invention, there is provided a kind of bluetooth equipment, the bluetooth equipment include:Memory, processing Device and the computer program that can be run on the memory and on the processor is stored in, the computer program is by institute Following steps are realized when stating computing device:
A, in communication process, binary system random code S is obtained;
B, the binary system random code is converted into decimal system U;
C, bring the decimal system U into default algorithms to be calculated, be included in obtaining in the channel number to prestore Channel number W;
D, judge whether channel is unoccupied corresponding to channel number W, if so, performing step E, otherwise performing step A;
E, channel corresponding to frequency hopping to channel number W.
Preferably, channel number corresponding to frequency hopping point has been prestored on the memory;
Wherein, the frequency hopping point is the 79 frequency hopping points set up by bandwidth of 1MHz in bluetooth working frequency range, the channel Serial Number Range is 0 to 78 integer.
Preferably, when performing the step C, the processor is additionally operable to perform the computer program, with realize with Lower step:
C1, the initial value of acquisition variable i are i=0;
C2, calculate W=U- (t-1) * 79, t=i+1;
C3, judge whether W meets 0≤W≤78, if so, performing step D, otherwise, make i=i+1, and perform step C2.
Preferably, before step A is performed, the processor is additionally operable to perform the computer program, following to realize Step:
Complete the transformation task of a packet.
Preferably, after step E is performed, the processor is additionally operable to perform the computer program, following to realize Step:
In the next packet of transmission corresponding to channel number W.
According to the third aspect of the present invention, there is provided a kind of computer-readable recording medium, the computer-readable storage Computer program is stored with medium, is realized when the computer program is executed by processor such as any one of claim 1 to 5 The step of described Bluetooth communication method.
Bluetooth communication method, bluetooth equipment and the computer-readable recording medium of the embodiment of the present invention, in communication process, Using binary system random code and default algorithm, the numbering of available channel at random calculating, then frequency hopping is to changing available letter In road, not only algorithm is simple, and because the channel of its each frequency hopping is all random uncertain, therefore effectively reduce logical The risk that letter data is monitored and intercepted and captured, improve the security of Bluetooth communication.
Brief description of the drawings
Fig. 1 is a kind of hardware architecture diagram for the mobile terminal for realizing each embodiment of the present invention;
Fig. 2 is a kind of flow chart for Bluetooth communication method that the embodiment of the present invention one provides;
Fig. 3 is the flow chart of the Bluetooth communication method between two bluetooth equipments in the embodiment of the present invention one;
Fig. 4 is the Bluetooth interface schematic diagram of the embodiment of the present invention;
Fig. 5 is the method flow diagram of step S305 in Fig. 3;
A kind of schematic diagram for bluetooth equipment that Fig. 6 embodiment of the present invention two provides.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is only Be advantageous to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can mix Ground uses.
Terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as mobile phone, flat board Computer, notebook computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable Media player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer etc. move Dynamic terminal, and the fixed terminal such as digital TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except special Outside element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its hardware architecture diagram for a kind of mobile terminal of each embodiment of the realization present invention, the shifting Dynamic terminal 100 can include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103rd, A/V (audio/video) input block 104, sensor 105, display unit 106, user input unit 107, interface unit 108th, the part such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1 Mobile terminal structure does not form the restriction to mobile terminal, and mobile terminal can be included than illustrating more or less parts, Either combine some parts or different parts arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base station Downlink information receive after, handled to processor 110;In addition, up data are sent to base station.Generally, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrate Frequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communication Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications System), GPRS (General Packet Radio ServicE, general packet radio service), CDMA2000 (Code Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division Multiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102 Sub- mail, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 1 shows Go out WiFi module 102, but it is understood that, it is simultaneously not belonging to must be configured into for mobile terminal, completely can be according to need To be omitted in the essential scope for do not change invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100 When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is receiving or It is sound that the voice data stored in memory 109, which is converted into audio signal and exported,.Moreover, audio output unit 103 The audio output related to the specific function that mobile terminal 100 performs can also be provided (for example, call signal receives sound, disappeared Breath receives sound etc.).Audio output unit 103 can include loudspeaker, buzzer etc..
A/V input blocks 104 are used to receive audio or video signal.A/V input blocks 104 can include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode Or the static images or the view data of video obtained in image capture mode by image capture apparatus (such as camera) are carried out Reason.Picture frame after processing may be displayed on display unit 106.Picture frame after the processing of graphics processor 1041 can be deposited Storage is transmitted in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042 Quiet down sound (voice data), and can be voice data by such acoustic processing.Audio (voice) data after processing can To be converted to the form output that mobile communication base station can be sent to via radio frequency unit 101 in the case of telephone calling model. Microphone 1042 can implement various types of noises and eliminate (or suppression) algorithm to eliminate (or suppression) in reception and send sound Caused noise or interference during frequency signal.
Mobile terminal 100 also includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity transducer can close when mobile terminal 100 is moved in one's ear Display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (general For three axles) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, The other sensors such as hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can wrap Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and produce the use with mobile terminal The key signals input that family is set and function control is relevant.Specifically, user input unit 107 may include contact panel 1071 with And other input equipments 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation of the user on or near it (for example user uses any suitable objects or annex such as finger, stylus on contact panel 1071 or in contact panel 1071 Neighbouring operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detection Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it Contact coordinate is converted into, then gives processor 110, and the order sent of reception processing device 110 and can be performed.In addition, can To realize contact panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap Include but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc. One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel 1061 be the part independent as two to realize the input of mobile terminal and output function, but in certain embodiments, can Input and the output function of mobile terminal are realized so that contact panel 1071 and display panel 1061 is integrated, is not done herein specifically Limit.
Interface unit 108 is connected the interface that can pass through as at least one external device (ED) with mobile terminal 100.For example, External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area And storage data field, wherein, storing program area can storage program area, application program (such as the sound needed at least one function Sound playing function, image player function etc.) etc.;Storage data field can store according to mobile phone use created data (such as Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the whole mobile terminal of connection Individual part, by running or performing the software program and/or module that are stored in memory 109, and call and be stored in storage Data in device 109, the various functions and processing data of mobile terminal are performed, so as to carry out integral monitoring to mobile terminal.Place Reason device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated Device is managed, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is main Handle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) to all parts power supply, it is preferred that power supply 111 Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, put The function such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also will not be repeated here including bluetooth module etc..
For the ease of understanding the embodiment of the present invention, the communications network system being based on below to the mobile terminal of the present invention enters Row description.
Based on above-mentioned mobile terminal hardware configuration, each embodiment of the inventive method is proposed.
The embodiment of the present invention one provides a kind of Bluetooth communication method.The Bluetooth communication of the present embodiment is applied to include movement Bluetooth equipment including terminal.Referring to Fig. 2, method flow includes:
S201, in communication process, obtain binary system random code S;
S202, the binary system random code is converted into decimal system U;
S203, bring decimal system U into default algorithms and calculated, be included in obtaining in the channel number to prestore Channel number W;
S204, judge whether channel is unoccupied corresponding to channel number W, if so, performing step S205, otherwise perform step Rapid S201;
S205, channel corresponding to frequency hopping to channel number W.
In a feasible scheme, the Bluetooth communication method also includes:
Prestore channel number corresponding to frequency hopping point;
Wherein, the frequency hopping point is the 79 frequency hopping points set up by bandwidth of 1MHz in bluetooth working frequency range, the channel number Scope is 0 to 78 integer.
In a feasible scheme, this is brought decimal system U into default algorithms and calculated, and is included in advance with obtaining Channel number W in the channel number deposited, including:
C1, the initial value of acquisition variable i are i=0;
C2, calculate W=U- (t-1) * 79, t=i+1;
C3, judge whether W meets 0≤W≤78, if so, performing step S204, otherwise, make i=i+1, and perform step C2。
In a feasible scheme, A is in communication process for the step, and before obtaining binary system random code S, the bluetooth is led to Letter method also includes:
Complete the transformation task of a packet.
In a feasible scheme, after channel corresponding to the E frequency hoppings to channel number W, the Bluetooth communication method is also Including:
In the next packet of transmission corresponding to channel number W.
In a feasible scheme, because 2.4GHz frequency ranges are a free wireless universal frequency ranges, so having a lot Equipment is operated in this frequency range, such as bluetooth, Wi-Fi and WLAN, and one may can be caused there is interference between these equipment The damage of a little channels, if frequency hopping is damaged on channels to these, data will be unable to effectively be transmitted, and therefore, this method is also It may include steps of:
After Bluetooth communication, which connects, to be established, damage channel record table is established;
Whenever packet transmission is completed, judge whether present channel is damaged;
If being damaged, current channel number is registered in damage channel registration form.
Then before step S205 is performed, this method also includes, and judges whether the destination channel of frequency hopping is registered in damage letter In road registration form;
If so, perform step S201;
Otherwise, step S205 is performed.
In practical application, whenever packet transmission is completed, judge whether present channel is damaged, such as lower section can be used Method is realized:
In bluetooth equipment after present channel receives packet, verification cyclic redundancy is calculated according to protocol Data Unit Check code A, and verification is compared with CRC A with the CRC received, comparison result differs Cause then thinks that CRC inspection fails;There is the failure of CRC inspection twice, then it is assumed that present channel damages.
The present embodiment is carried out exemplified by the communication between two bluetooth equipments (bluetooth equipment A, bluetooth equipment B) below detailed Describe in detail bright.
Referring to Fig. 3, method flow includes:
Bluetooth equipment in S301, bluetooth equipment A search coverage.
In practical application, because Bluetooth encryption can select various ways, safe choosing can be added in bluetooth sets interface , there is user to select encryption method.As shown in figure 4, when sovolin user enters Bluetooth interface, secure option can be put open, is selected Whether this communication is encrypted, and selection cipher mode.
As secure option includes in Fig. 4:Algorithm for encryption, frequency-hopping encryption.If selection algorithm is encrypted, built in communication connection After vertical, bluetooth equipment A will consult cipher mode with bluetooth equipment B, and key is sent into bluetooth equipment B.If selection Frequency-hopping encryption, frequency hopping point will be randomly choosed using binary system random code using the present embodiment, so as to be coated with by prevention data Monitoring and intercepting and capturing, improve the security of data transfer.Only the Bluetooth communication of frequency-hopping encryption is described in the present embodiment.
S302, bluetooth equipment A search out bluetooth equipment B, initiate to establish communication request to bluetooth equipment B.
S303, bluetooth equipment A are established and are connected with pairings of the bluetooth equipment B based on bluetooth applications.
It is frequency-hopping encryption that S304, bluetooth equipment A and bluetooth equipment B, which consult cipher mode,.
S305, bluetooth equipment A obtain the binary system random code S of its system distribution, and are calculated according to binary system random code S The channel number of frequency hopping point can be used.
Specific method is referring to Fig. 5, step S305 includes:
S501, the binary system random code for obtaining system distribution.
S502, binary system random code S is converted into decimal system U.
S503, the initial value of acquisition variable i are i=0.
S504, calculate W=U- (t-1) * 79, t=i+1.
S505, judge whether W meets 0≤W≤78, if so, performing step S506, otherwise, make i=i+1, and perform step S504。
S506, judge frequency W whether with wifi take channel confliction, if perform step S501, otherwise perform step S306。
With reference to instantiation, if it is 1101000 that system, which provides random code S, it is 104 to be converted into decimal system U, works as i=0 When, t=i+1=1, W=U- (1-1) * 79=104,0≤W≤78 are not met, make i=1, now t=i+1=2 recalculates W, W=W=U- (2-1) * 79=25 are obtained, qualified W is 25, then judges whether there are data to enter on the channel for being 25 in numbering Row transmission, carries out data transmission if not in 25 channels, if so, then system redistributes binary system random code, again Calculate.
Channel corresponding to S306, bluetooth equipment A frequency hoppings to the channel number of this available frequency hopping point calculated.
S307, bluetooth equipment A are to bluetooth equipment B transmission packets.
After S308, bluetooth equipment B receive the packet of bluetooth equipment A transmission, bluetooth equipment B system distribution is obtained Binary system random code, and the channel number of frequency hopping point can be used according to binary system random code calculating.
Channel corresponding to S309, bluetooth equipment B frequency hoppings to the channel number of this available frequency hopping point calculated.
S310, bluetooth equipment B are to bluetooth equipment A transmission packets.
So either bluetooth equipment A, or bluetooth equipment B, the transmission of packet is completed each time, can all be jumped to another Individual channel is communicated, and because its algorithm is simple, therefore the frequency of frequency hopping is fast, effectively data can be avoided to be intercepted, safety Property is higher.
The Bluetooth communication method of the present embodiment, in communication process, using binary system random code and default algorithm, at random The numbering of available channel at calculating, then frequency hopping is to changing in available channel, and not only algorithm is simple, and because it is jumped every time The channel of frequency is all random uncertain, therefore effectively reduces the risk that communication data is monitored and intercepts and captures, and improves indigo plant The security of tooth communication.
On the basis of previous embodiment, the embodiment of the present invention two provides a kind of bluetooth equipment, referring to Fig. 6, the indigo plant Tooth equipment includes:Memory 601, processor 602 and it is stored in the calculating that can be run on the memory and on the processor Machine program, the computer program realize following steps when being performed by the processor 602:
A, in communication process, binary system random code S is obtained;
B, the binary system random code is converted into decimal system U;
C, bring decimal system U into default algorithms to be calculated, to obtain the letter being included in the channel number to prestore Road numbering W;
D, judge whether channel is unoccupied corresponding to channel number W, if so, performing step E, otherwise performing step A;
E, channel corresponding to frequency hopping to channel number W.
In a feasible scheme, channel number corresponding to frequency hopping point has been prestored on the memory 601;
Wherein, the frequency hopping point is the 79 frequency hopping points set up by bandwidth of 1MHz in bluetooth working frequency range, the channel number Scope is 0 to 78 integer.
In a feasible scheme, when performing step C, the processor 602 is additionally operable to perform the computer program, To realize following steps:
C1, the initial value of acquisition variable i are i=0;
C2, calculate W=U- (t-1) * 79, t=i+1;
C3, judge whether W meets 0≤W≤78, if so, performing step D, otherwise, make i=i+1, and perform step C2.
In a feasible scheme, before step A is performed, the processor 602 is additionally operable to perform the computer program, To realize following steps:
Complete the transformation task of a packet.
In a feasible scheme, after step E is performed, the processor 602 is additionally operable to perform the computer program, To realize following steps:
In the next packet of transmission corresponding to channel number W.
Because 2.4GHz frequency ranges are a free wireless universal frequency ranges, so there are many equipment to be operated in this frequency range, Such as bluetooth, Wi-Fi and WLAN, the damage of some channels there is interference, may can be caused between these equipment, if jumped Frequency is damaged on channels to these, and data will be unable to effectively be transmitted, and therefore, the processor 602 is additionally operable to perform the calculating Machine program, to realize following steps:
After Bluetooth communication, which connects, to be established, damage channel record table is established;
Whenever packet transmission is completed, judge whether present channel is damaged;
If being damaged, current channel number is registered in damage channel registration form.
Before step E is performed, the processor 602 is additionally operable to perform the computer program, to realize following steps:
Judge whether the destination channel of frequency hopping is registered in damage channel registration form;
If so, perform step A;
Otherwise, step E is performed.
In bluetooth equipment after present channel receives packet, verification cyclic redundancy is calculated according to protocol Data Unit Check code A, and verification is compared with CRC A with the CRC received, comparison result differs Cause then thinks that CRC inspection fails;There is the failure of CRC inspection twice, then it is assumed that present channel damages.
The Bluetooth communication method of the present embodiment, in communication process, using binary system random code and default algorithm, at random The numbering of available channel at calculating, then frequency hopping is to changing in available channel, and not only algorithm is simple, and because it is jumped every time The channel of frequency is all random uncertain, therefore effectively reduces the risk that communication data is monitored and intercepts and captures, and improves indigo plant The security of tooth communication.
On the basis of previous embodiment, the embodiment of the present invention three provides a kind of computer-readable recording medium, the meter Computer program is stored with calculation machine readable storage medium storing program for executing, realizes that embodiment one such as should when the computer program is executed by processor Bluetooth communication method the step of.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or device including a series of elements not only include those key elements, and And also include the other element being not expressly set out, or also include for this process, method, article or device institute inherently Key element.In the absence of more restrictions, the key element limited by sentence " including one ... ", it is not excluded that including Other identical element also be present in the process of the key element, method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal (can be mobile phone, computer, service Device, air conditioner, or network equipment etc.) perform the method that each embodiment of the present invention is somebody's turn to do.
Embodiments of the invention are described above in conjunction with accompanying drawing, but the invention is not limited in above-mentioned specific Embodiment, above-mentioned embodiment is only schematical, rather than restricted, one of ordinary skill in the art Under the enlightenment of the present invention, in the case of present inventive concept and scope of the claimed protection is not departed from, it can also make a lot Form, these are belonged within the protection of the present invention.

Claims (11)

1. a kind of Bluetooth communication method, it is characterised in that the communication means comprises the following steps:
A, in communication process, binary system random code S is obtained;
B, the binary system random code is converted into decimal system U;
C, bring the decimal system U into default algorithms to be calculated, to obtain the channel being included in the channel number to prestore Numbering W;
D, judge whether channel is unoccupied corresponding to channel number W, if so, performing step E, otherwise performing step A;
E, channel corresponding to frequency hopping to channel number W.
2. Bluetooth communication method as claimed in claim 1, it is characterised in that the Bluetooth communication method also includes:
Prestore channel number corresponding to frequency hopping point;
Wherein, the frequency hopping point is the 79 frequency hopping points set up by bandwidth of 1MHz in bluetooth working frequency range, the channel number Scope is 0 to 78 integer.
3. Bluetooth communication method as claimed in claim 2, it is characterised in that the step C, the decimal system U brought into it is pre- If algorithm calculated, to obtain the channel number W being included in the channel number that prestores, including:
C1, the initial value of acquisition variable i are i=0;
C2, calculate W=U- (t-1) * 79, t=i+1;
C3, judge whether W meets 0≤W≤78, if so, performing step D, otherwise, make i=i+1, and perform step C2.
4. the Bluetooth communication method as described in any one of claims 1 to 3, it is characterised in that the step A, in communication process In, before obtaining binary system random code S, the Bluetooth communication method also includes:
Complete the transformation task of a packet.
5. method as claimed in claim 4, it is characterised in that channel corresponding to the step E, frequency hopping to channel number W it Afterwards, the Bluetooth communication method also includes:
In the next packet of transmission corresponding to channel number W.
6. a kind of bluetooth equipment, it is characterised in that the bluetooth equipment includes:Memory, processor and it is stored in described deposit On reservoir and the computer program that can run on the processor, realized when the computer program is by the computing device Following steps:
A, in communication process, binary system random code S is obtained;
B, the binary system random code is converted into decimal system U;
C, bring the decimal system U into default algorithms to be calculated, to obtain the channel being included in the channel number to prestore Numbering W;
D, judge whether channel is unoccupied corresponding to channel number W, if so, performing step E, otherwise performing step A;
E, channel corresponding to frequency hopping to channel number W.
7. bluetooth equipment as claimed in claim 6, it is characterised in that prestored on the memory corresponding to frequency hopping point Channel number;
Wherein, the frequency hopping point is the 79 frequency hopping points set up by bandwidth of 1MHz in bluetooth working frequency range, the channel number Scope is 0 to 78 integer.
8. bluetooth equipment as claimed in claim 7, it is characterised in that when performing the step C, the processor is additionally operable to The computer program is performed, to realize following steps:
C1, the initial value of acquisition variable i are i=0;
C2, calculate W=U- (t-1) * 79, t=i+1;
C3, judge whether W meets 0≤W≤78, if so, performing step D, otherwise, make i=i+1, and perform step C2.
9. the bluetooth equipment as described in any one of claim 6 to 8, it is characterised in that before step A is performed, the processing Device is additionally operable to perform the computer program, to realize following steps:
Complete the transformation task of a packet.
10. bluetooth equipment as claimed in claim 9, it is characterised in that after step E is performed, the processor is additionally operable to The computer program is performed, to realize following steps:
In the next packet of transmission corresponding to channel number W.
11. a kind of computer-readable recording medium, it is characterised in that be stored with computer on the computer-readable recording medium Program, the Bluetooth communication method as any one of claim 1 to 5 is realized when the computer program is executed by processor The step of.
CN201711020090.0A 2017-10-26 2017-10-26 Bluetooth communication method, Bluetooth device and computer readable storage medium Active CN107835506B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711020090.0A CN107835506B (en) 2017-10-26 2017-10-26 Bluetooth communication method, Bluetooth device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711020090.0A CN107835506B (en) 2017-10-26 2017-10-26 Bluetooth communication method, Bluetooth device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107835506A true CN107835506A (en) 2018-03-23
CN107835506B CN107835506B (en) 2022-04-22

Family

ID=61650713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711020090.0A Active CN107835506B (en) 2017-10-26 2017-10-26 Bluetooth communication method, Bluetooth device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107835506B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019204993A1 (en) * 2018-04-24 2019-10-31 华为技术有限公司 Data transmission method and device
CN112367649A (en) * 2020-09-29 2021-02-12 北京软慧科技有限公司 Data discovery method and device of low-power-consumption Bluetooth and electronic equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120328061A1 (en) * 2011-06-27 2012-12-27 Nokia Corporation Method, apparatus, and computer program product for using discovered clock in a first communications protocol to synchronize networking activity in a second communications protocol
CN104159312A (en) * 2013-05-14 2014-11-19 株式会社理光 Method and system for allocating wireless channel
CN104639209A (en) * 2015-02-13 2015-05-20 深圳市睿祺智尚科技有限公司 Self-adaptive frequency-hopping method of 2.4G transmission network
CN105187382A (en) * 2015-08-05 2015-12-23 西安电子科技大学 Multi-factor identity authentication method for preventing library collision attacks
CN105263129A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Data transmission method and device
CN105357632A (en) * 2015-11-30 2016-02-24 杭州朔天科技有限公司 Low-power-consumption bluetooth broadcast channel anti-collision method
CN105916177A (en) * 2016-05-30 2016-08-31 北京小米移动软件有限公司 Method and device for wireless communication
US20160277991A1 (en) * 2015-03-19 2016-09-22 Qualcomm Incorporated Location id based cell selection method for circuit switched fallback calls
US20160344443A1 (en) * 2015-05-22 2016-11-24 Texas Instruments Incorporated Enhanced channel hopping sequence
CN106549737A (en) * 2016-11-07 2017-03-29 清华大学 A kind of data transmission method and device
CN107272506A (en) * 2017-07-27 2017-10-20 福州台江区超人电子有限公司 A kind of shared electric bicycle system for parking registration in order

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120328061A1 (en) * 2011-06-27 2012-12-27 Nokia Corporation Method, apparatus, and computer program product for using discovered clock in a first communications protocol to synchronize networking activity in a second communications protocol
CN104159312A (en) * 2013-05-14 2014-11-19 株式会社理光 Method and system for allocating wireless channel
CN104639209A (en) * 2015-02-13 2015-05-20 深圳市睿祺智尚科技有限公司 Self-adaptive frequency-hopping method of 2.4G transmission network
US20160277991A1 (en) * 2015-03-19 2016-09-22 Qualcomm Incorporated Location id based cell selection method for circuit switched fallback calls
US20160344443A1 (en) * 2015-05-22 2016-11-24 Texas Instruments Incorporated Enhanced channel hopping sequence
CN105187382A (en) * 2015-08-05 2015-12-23 西安电子科技大学 Multi-factor identity authentication method for preventing library collision attacks
CN105263129A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Data transmission method and device
CN105357632A (en) * 2015-11-30 2016-02-24 杭州朔天科技有限公司 Low-power-consumption bluetooth broadcast channel anti-collision method
CN105916177A (en) * 2016-05-30 2016-08-31 北京小米移动软件有限公司 Method and device for wireless communication
CN106549737A (en) * 2016-11-07 2017-03-29 清华大学 A kind of data transmission method and device
CN107272506A (en) * 2017-07-27 2017-10-20 福州台江区超人电子有限公司 A kind of shared electric bicycle system for parking registration in order

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
冯卫忠等: "基于蓝牙技术的便携式心率数据采集仪的设计", 《医疗卫生装备》 *
孙保群等: "基于nRF2401软件跳频协议的设计与实现", 《电子技术应用》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019204993A1 (en) * 2018-04-24 2019-10-31 华为技术有限公司 Data transmission method and device
CN112367649A (en) * 2020-09-29 2021-02-12 北京软慧科技有限公司 Data discovery method and device of low-power-consumption Bluetooth and electronic equipment

Also Published As

Publication number Publication date
CN107835506B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN106961706A (en) Method, mobile terminal and the computer-readable recording medium of communication pattern switching
CN107302624A (en) A kind of screen prjection method, terminal and computer-readable recording medium
CN107463481A (en) Data interactive method, mobile terminal and storage medium
CN107343083A (en) One kind lifting game experiencing method, apparatus and computer-readable recording medium
CN107678614A (en) A kind of method, equipment and computer-readable recording medium for realizing information alert
CN107229389A (en) A kind of method of shared file, equipment and computer-readable recording medium
CN107862196A (en) Fingerprint verification method, mobile terminal and computer-readable recording medium
CN107272906A (en) Using many account display control methods and mobile terminal
CN107506039A (en) Mobile terminal, data transmission method and computer-readable storage medium
CN107181865A (en) Processing method, terminal and the computer-readable recording medium of unread short messages
CN107517208A (en) Apparatus control method, device and computer-readable recording medium
CN107153500A (en) It is a kind of to realize the method and apparatus that image is shown
CN107809534A (en) A kind of control method, terminal and computer-readable storage medium
CN107888759A (en) A kind of method, equipment and computer-readable recording medium realized information and sent
CN107360312A (en) Control method, equipment and the computer of screen can storage medium
CN107682541A (en) Audio control method, mobile terminal and the storage medium of screen prjection
CN107423065A (en) Method, mobile terminal and the computer-readable recording medium that a kind of application is attended to anything else
CN107273024A (en) A kind of method and apparatus for realizing application data processing
CN109445945A (en) Memory allocation method, mobile terminal, server and the storage medium of application program
CN107835506A (en) A kind of Bluetooth communication method, bluetooth equipment and computer-readable recording medium
CN109462732A (en) A kind of image processing method, equipment and computer readable storage medium
CN108037880A (en) A kind of Curved screen control method, terminal and computer-readable recording medium
CN107809527A (en) A kind of method and apparatus that prompt operation is presented
CN107463647A (en) Audio identification method to set up, application method, terminal and computer-readable recording medium
CN107239690A (en) Unlocking screen method and mobile terminal

Legal Events

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