CN111510896B - Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium - Google Patents

Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium Download PDF

Info

Publication number
CN111510896B
CN111510896B CN202010177731.9A CN202010177731A CN111510896B CN 111510896 B CN111510896 B CN 111510896B CN 202010177731 A CN202010177731 A CN 202010177731A CN 111510896 B CN111510896 B CN 111510896B
Authority
CN
China
Prior art keywords
equipment
bluetooth
password
mac address
legal
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
Application number
CN202010177731.9A
Other languages
Chinese (zh)
Other versions
CN111510896A (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.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun 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 Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010177731.9A priority Critical patent/CN111510896B/en
Publication of CN111510896A publication Critical patent/CN111510896A/en
Application granted granted Critical
Publication of CN111510896B publication Critical patent/CN111510896B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/20Transfer of user or subscriber data
    • H04W8/205Transfer to or from user equipment or user record carrier

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

In the bluetooth connection method and apparatus, the internet of things system, the electronic device, and the storage medium provided in this embodiment, the server receives the MAC address of the first device and the serial number of the second device, which are sent by the first device, and obtains a preset legal MAC address table, so as to determine whether the first device is legal according to the legal MAC address table, and under the condition that the first device is legal, the bluetooth password corresponding to the serial number of the second device is sent to the first device, so that the first device performs bluetooth communication with the second device according to the bluetooth password. The server is legally verified in the Bluetooth connection process through the method, the Bluetooth password of the second device is sent to the first device under the condition that the first device is legal, the legality of the device connected with the second device in a Bluetooth mode is guaranteed, the fact that the illegal device attacks the second device through the Bluetooth connection mode is avoided, and the safety of Bluetooth communication is improved.

Description

Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium
Technical Field
The application relates to the field of internet of things, in particular to a Bluetooth connection method and device, an internet of things system, electronic equipment and a storage medium.
Background
Along with the continuous update of the science and technology of the internet of things, the application of the internet of things in life is more and more extensive, the distribution network mode of the internet of things generally has the modes of one-key distribution network, equipment hotspot distribution network, Bluetooth distribution network, routing distribution network and the like, and the application of the Bluetooth distribution network is relatively more extensive.
The bluetooth is distributed to networks, usually the devices communicate with each other through bluetooth connection, and with the development of the network era, the network security problem is paid more and more attention, and as many devices as connected devices have no security verification in the process of establishing bluetooth connection with other devices, any device can establish bluetooth connection with the connected devices, so that the devices are easily attacked by illegal devices or invaded by illegal devices in the bluetooth communication process.
Disclosure of Invention
In order to solve the technical problem that current bluetooth communication security is low, this application provides one kind.
In a first aspect, an embodiment of the present invention provides a bluetooth connection method, which is applied to a server, and the method includes:
receiving the MAC address of the first device and the serial number of the second device, which are sent by the first device;
acquiring a preset legal MAC address table;
determining whether the legal MAC address table contains the MAC address of the first device;
if yes, determining that the first equipment is legal, and sending a pre-stored Bluetooth password corresponding to the serial number of the second equipment to the first equipment so that the first equipment performs Bluetooth communication with the second equipment according to the Bluetooth password.
In one possible implementation, the obtaining a preset legal MAC address table includes:
determining the security level of the second equipment according to the serial number of the second equipment;
and acquiring a preset legal MAC address table corresponding to the security level according to the security level.
In a second aspect, an embodiment of the present invention further provides a bluetooth connection method, which is applied to a first device, and the method includes:
when a Bluetooth hotspot of a second device is searched, a Bluetooth connection request is sent to the second device, wherein the name of the Bluetooth hotspot comprises a serial number of the second device;
receiving a password verification request returned by the second equipment;
sending the MAC address of the server and the serial number of the second device to a server so that the server can verify whether the first device is legal or not;
receiving a Bluetooth password returned by the server, wherein the Bluetooth password is the Bluetooth password which is sent by the server and corresponds to the serial number of the second device under the condition that the server verifies that the first device is legal;
and sending the Bluetooth password to the second device in response to the password verification request so that the second device communicates with the first device if the Bluetooth password is correct.
In a third aspect, an embodiment of the present invention further provides a bluetooth connection method, which is applied to a second device, where the method includes:
receiving a Bluetooth connection request sent by first equipment;
sending a password authentication request to the first device in response to the Bluetooth connection request;
receiving a Bluetooth password sent by the first equipment;
verifying whether the Bluetooth password is correct;
and if the Bluetooth password is correct, carrying out Bluetooth communication with the first equipment.
In a fourth aspect, an embodiment of the present invention further provides an internet of things system, where the system includes: the system comprises a server, a first device and a second device;
the first device is used for sending a Bluetooth connection request to the second device when a Bluetooth hotspot of the second device is searched, wherein the name of the Bluetooth hotspot comprises a serial number of the second device;
the second device is used for receiving the Bluetooth connection request sent by the first device and sending a password verification request to the first device in response to the Bluetooth connection request;
the first device is further configured to receive a password authentication request returned by the second device, and send an MAC address of the first device and a serial number of the second device to the server;
the server is used for receiving the MAC address of the first equipment and the serial number of the second equipment sent by the first equipment, acquiring a preset legal MAC address table, determining whether the MAC address of the first equipment is contained in the legal MAC address table, if so, determining that the first equipment is legal, and sending a pre-stored Bluetooth password corresponding to the serial number of the second equipment to the first equipment;
the first device is further used for receiving the Bluetooth password returned by the server and responding to the password verification request to send the Bluetooth password to the second device;
the second device is further configured to receive the bluetooth password sent by the first device, verify whether the bluetooth password is correct, and perform bluetooth communication with the first device if the bluetooth password is correct.
In a fifth aspect, an embodiment of the present invention further provides a bluetooth connection apparatus, which is applied to a server, where the apparatus includes:
the receiving module is used for receiving the MAC address of the first equipment and the serial number of the second equipment, which are sent by the first equipment;
the address table acquisition module is used for acquiring a preset legal MAC address table;
a checking module, configured to determine whether the legal MAC address table includes the MAC address of the first device;
and the sending module is used for determining that the first equipment is legal if the first equipment is contained in the second equipment, and sending a pre-stored Bluetooth password corresponding to the serial number of the second equipment to the first equipment so that the first equipment performs Bluetooth communication with the second equipment according to the Bluetooth password.
In a sixth aspect, an embodiment of the present invention further provides a bluetooth connection apparatus, which is applied to a first device, and the apparatus includes:
the request sending module is used for sending a Bluetooth connection request to the second equipment when a Bluetooth hotspot of the second equipment is searched, wherein the name of the Bluetooth hotspot comprises a serial number of the second equipment;
the request receiving module is used for receiving a password verification request returned by the second equipment;
the information sending module is used for sending the MAC address of the information sending module and the serial number of the second equipment to a server so that the server can verify whether the first equipment is legal or not;
the password receiving module is used for receiving the Bluetooth password returned by the server, wherein the Bluetooth password is the Bluetooth password which is sent by the server and corresponds to the serial number of the second device under the condition that the server verifies that the first device is legal;
and the password sending module is used for responding to the password verification request and sending the Bluetooth password to the second equipment so as to enable the second equipment to communicate with the first equipment under the condition that the Bluetooth password is correct.
In a seventh aspect, an embodiment of the present invention further provides a bluetooth connection apparatus, which is applied to a second device, where the apparatus includes:
the request receiving module is used for receiving a Bluetooth connection request sent by first equipment;
a request sending module, configured to send a password verification request to the first device in response to the bluetooth connection request;
the password receiving module is used for receiving the Bluetooth password sent by the first equipment;
the password verification module is used for verifying whether the Bluetooth password is correct or not;
and the communication connection module is used for carrying out Bluetooth communication with the first equipment if the Bluetooth password is correct.
In an eighth aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a memory, the processor is configured to execute a data processing program stored in the memory to implement the bluetooth connection method according to the first aspect, the second aspect, or the third aspect.
In a ninth aspect, an embodiment of the present invention further provides a storage medium, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the bluetooth connection method according to one aspect, the second aspect, or the third aspect.
In the bluetooth connection method provided in this embodiment, the server receives the MAC address of the first device and the serial number of the second device, which are sent by the first device, and obtains a preset legal MAC address table, so as to determine whether the first device is legal according to the legal MAC address table, and send the bluetooth password corresponding to the serial number of the second device to the first device under the condition that the first device is legal, so that the first device performs bluetooth communication with the second device according to the bluetooth password. The server carries out legal verification on the first equipment in the process of carrying out Bluetooth connection in the mode, and under the condition of ensuring that the first equipment is legal, the Bluetooth password of the second equipment is sent to the first equipment, so that the legality of the equipment connected with the second equipment in a Bluetooth mode is ensured, and the second equipment is prevented from being attacked by illegal equipment in a Bluetooth connection mode.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of an internet of things system provided in an embodiment of the present application;
fig. 2 is a flowchart of a bluetooth connection method according to an embodiment of the present application;
fig. 3 is a flowchart of a bluetooth connection method according to an embodiment of the present application;
fig. 4 is a flowchart of a bluetooth connection method according to an embodiment of the present application;
fig. 5 is a block diagram of a bluetooth connection apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a bluetooth connection apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of a bluetooth connection apparatus according to an embodiment of the present application;
fig. 8 is a schematic view of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic diagram of an internet of things system according to an embodiment of the present invention, and the system shown in fig. 1 may include: the server, the first equipment and the second equipment are both provided with Bluetooth modules, and Bluetooth communication is adopted between the first equipment and the second equipment. In order to ensure the safety of Bluetooth communication between devices, a serial number is set for the devices when the devices are generated, the serial number is a unique serial number and is a unique identifier of the devices, the devices can be determined according to the serial number, Bluetooth passwords corresponding to the serial number are randomly generated and stored in a server, the server can be a cloud server, and an interface for communicating with the devices is arranged on the server, so that the devices can acquire the Bluetooth passwords from the server.
After the equipment starts the bluetooth function, can generate the bluetooth hotspot, the bluetooth hotspot can be searched by other equipment that starts the bluetooth function, and wherein the name of bluetooth hotspot contains the serial number of equipment, is convenient for other equipment to discern the equipment that the bluetooth hotspot corresponds.
The first device is used for sending a Bluetooth connection request to the second device when the searched Bluetooth hotspot of the second device is found, and the name of the Bluetooth hotspot contains the serial number of the second device.
Specifically, the bluetooth connection request may be sent to the second device by clicking a bluetooth hotspot name of the second device displayed on the first device.
The second device is used for receiving the Bluetooth connection request sent by the first device and sending a password verification request to the first device in response to the Bluetooth connection request.
In order to ensure the safety of Bluetooth communication, after receiving a Bluetooth connection request of a first device, whether the first device is a legal device is determined through password verification.
The first device is further configured to receive a password verification request returned by the second device, and send its MAC address and the serial number of the second device to the server.
And after receiving the password verification request, the first equipment requests the server for the Bluetooth password of the second equipment.
The server is used for receiving the MAC address of the first device and the serial number of the second device sent by the first device, acquiring a preset legal MAC address table, determining whether the MAC address of the first device is contained in the legal MAC address table, if so, determining that the first device is legal, and sending a pre-stored Bluetooth password corresponding to the serial number of the second device to the first device.
The server verifies whether the first equipment is preset legal equipment or not according to the MAC address sent by the first equipment and the sequence number of the second equipment, if so, the Bluetooth password of the second equipment is sent to the first equipment, so that the first equipment completes password verification by using the Bluetooth password, if the first equipment is not legal equipment, namely if the first equipment is illegal equipment, the Bluetooth password of the second equipment is not sent to the first equipment, therefore, the first equipment does not know the Bluetooth password of the second equipment, the password verification cannot be completed, and Bluetooth communication cannot be carried out with the second equipment, so that the damage to the second equipment caused by the Bluetooth communication between the illegal equipment and the second equipment is avoided.
The first device is further configured to receive a bluetooth password returned by the server, and send the bluetooth password to the second device in response to the password verification request.
After receiving the Bluetooth password, the first device sends the Bluetooth password to the second device, so that the second device determines whether the first device is legal or not according to the Bluetooth password sent by the first device.
The second device is further configured to receive the bluetooth password sent by the first device, verify whether the bluetooth password is correct, and perform bluetooth communication with the first device if the bluetooth password is correct.
The second equipment judges whether the first equipment is legal or not by verifying whether the password sent by the first equipment is correct or not, if the Bluetooth password is correct, the first equipment is determined to be legal, so that Bluetooth communication is carried out with the first equipment, if the Bluetooth password is incorrect, the first equipment is determined to be illegal, namely the first equipment is illegal, Bluetooth communication is not carried out with the first equipment, and the safety problem caused by Bluetooth communication with the illegal equipment is avoided.
The following describes a bluetooth connection method provided by an embodiment of the present invention in detail, with a first device, a server, and a second device as execution subjects.
Fig. 2 is a flowchart of a bluetooth connection method according to an embodiment of the present invention, where the bluetooth connection method is a method for performing bluetooth pairing connection between two devices, and the method is applied to a server, as shown in fig. 2, the method includes the following steps:
and S21, receiving the MAC address of the first equipment and the serial number of the second equipment, which are sent by the first equipment.
And S22, acquiring a preset legal MAC address table.
The device corresponding to the MAC address contained in the legal MAC address table is legal device, the device not corresponding to the MAC address in the MAC address table is illegal device, the legal device can carry out Bluetooth communication with the second device, and the illegal device can not carry out Bluetooth communication with the second device.
S23, determining whether the legal MAC address table contains the MAC address of the first device.
Whether the first device is a legal device capable of performing bluetooth communication with the second device is determined by determining whether the MAC address of the first device is included in a legal MAC address table, and specifically, whether the MAC address of the first device is included in the legal MAC address table may be determined by means of lookup.
If the legal MAC address table contains the MAC address of the first device, the first device is determined to be legal, namely the first device is legal and can communicate with the second device in a Bluetooth mode, and if the legal MAC address table does not contain the MAC address of the first device, the first device is determined to be illegal, namely the first device is illegal and cannot communicate with the second device in the Bluetooth mode.
And S24, if the Bluetooth password is contained, determining that the first equipment is legal, and sending the prestored Bluetooth password corresponding to the serial number of the second equipment to the first equipment so that the first equipment performs Bluetooth communication with the second equipment according to the Bluetooth password.
The server stores the serial number and the Bluetooth password of the equipment in advance, and the Bluetooth password of the equipment can be obtained according to the serial number of the equipment, so that the corresponding Bluetooth password is determined according to the serial number of the second equipment under the condition that the first equipment is determined to be legal, and the Bluetooth password is sent to the first equipment, so that the first equipment completes password verification of the second equipment by using the Bluetooth password, and further the first equipment and the second equipment carry out Bluetooth communication.
If the first equipment is illegal, the server does not send the Bluetooth password of the second equipment to the first equipment, so that the first equipment cannot carry out Bluetooth communication with the second equipment, and the safety of the Bluetooth communication is ensured.
In the bluetooth connection method provided in this embodiment, the server receives the MAC address of the first device and the serial number of the second device, which are sent by the first device, and obtains a preset legal MAC address table, so as to determine whether the first device is legal according to the legal MAC address table, and send the bluetooth password corresponding to the serial number of the second device to the first device under the condition that the first device is legal, so that the first device performs bluetooth communication with the second device according to the bluetooth password. The server carries out legal verification on the first equipment in the process of carrying out Bluetooth connection in the mode, and under the condition of ensuring that the first equipment is legal, the Bluetooth password of the second equipment is sent to the first equipment, so that the legality of the equipment connected with the second equipment in a Bluetooth mode is ensured, and the second equipment is prevented from being attacked by illegal equipment in a Bluetooth connection mode.
On the basis of the above embodiment, the security level of the device and the legal MAC address table corresponding to the security level of the device are preset, the corresponding relationship between the security level of the device and the serial number of the device and the legal MAC address table is established, and the corresponding relationship is stored in the server in advance, and both the security level of the device and the legal MAC address table corresponding to the security level are set according to specific conditions.
On the basis of the foregoing embodiment, the step S22 of obtaining a preset legal MAC address table may include:
and determining the security level of the second equipment according to the serial number of the second equipment, and acquiring a preset legal MAC address table corresponding to the security level according to the security level.
In this embodiment, the legal MAC address table corresponding to the device is set according to the security level of the device, which is equivalent to setting the bluetooth communication authority of the device according to the security level of the device, so that different devices can have different bluetooth communication authorities, and the security of the bluetooth communication is further improved.
Fig. 3 is a flowchart of a bluetooth connection method according to an embodiment of the present invention, where the method is applied to a first device, and the first device is an initiator of a bluetooth connection, as shown in fig. 3, the method includes the following steps:
and S31, when a Bluetooth hotspot of second equipment is searched, sending a Bluetooth connection request to the second equipment, wherein the name of the Bluetooth hotspot comprises a sequence number of the second equipment.
The equipment needs to start the Bluetooth function when carrying out Bluetooth connection, after the Bluetooth function is started, a Bluetooth hotspot corresponding to the equipment can be generated, the Bluetooth hotspot can be searched by other equipment which starts the Bluetooth function around, meanwhile, the equipment can also search the Bluetooth hotspot of other equipment which starts the Bluetooth function around, in order to identify the equipment corresponding to the Bluetooth hotspot, the name of the Bluetooth hotspot can contain the serial number of the corresponding equipment, the serial number is the unique identifier of the equipment, and the unique equipment can be determined according to the requirement.
When the first device searches the Bluetooth hotspot of the second device, if the first device wants to perform Bluetooth communication with the second device, a Bluetooth connection request is sent to the second device.
And S32, receiving a password authentication request returned by the second equipment.
After receiving the bluetooth connection request sent by the first device, the second device requests the first device to send a corresponding bluetooth password to verify whether the first device is legal or not in order to ensure that the first device is legal and sends a password verification request to the first device.
And S33, sending the MAC address of the server and the serial number of the second equipment to a server so that the server can verify whether the first equipment is legal or not.
The first device receives a password verification request sent by the second device, and then requests the server for a Bluetooth password corresponding to the second device, because the Bluetooth password is stored in the server in correspondence with the serial number, the first device needs to send the serial number of the second device to the server, and the serial number of the second device can be obtained from a Bluetooth hotspot name of the second device.
And S34, receiving the Bluetooth password returned by the server, wherein the Bluetooth password is the Bluetooth password which is sent by the server and corresponds to the serial number of the second equipment under the condition that the server verifies that the first equipment is legal.
And when the server verifies that the first equipment is legal, the server sends the Bluetooth password corresponding to the serial number of the second equipment to the first equipment.
S35, responding to the password verification request, sending the Bluetooth password to the second equipment, so that the second equipment communicates with the first equipment under the condition that the Bluetooth password is correct.
The first device sends the Bluetooth password to the second device after receiving the Bluetooth password sent by the server, so that the second device determines whether the first device is legal or not by judging whether the Bluetooth password is correct or not, and the second device starts Bluetooth communication with the first device under the condition that the second device verifies that the first device is legal.
The embodiment of the application provides a bluetooth connection method, when the bluetooth hotspot of second equipment that first equipment searched for, to second equipment sends bluetooth connection request, and the name of bluetooth hotspot contains the sequence number of second equipment receives the password authentication request that second equipment returned, with self MAC address with the sequence number of second equipment sends to the server, so that the server verifies whether first equipment is legal, receives the bluetooth password that the server returned, the bluetooth password be the server verifies under the legal circumstances of first equipment, the bluetooth password that sends with the bluetooth password that the sequence number of second equipment corresponds, respond to the password authentication request will the bluetooth password send to the second equipment, so that the second equipment is in with first equipment communication under the correct circumstances of bluetooth password. In the process of carrying out Bluetooth connection between the first equipment and the second equipment in the above mode, the server can verify whether the first equipment is legal, and only sends the Bluetooth password of the second equipment to the first equipment under the condition of ensuring the first equipment to be legal, so that the legality of the equipment connected with the second equipment in a Bluetooth mode is ensured, and the second equipment is prevented from being attacked by illegal equipment in a Bluetooth connection mode.
Fig. 4 is a flowchart of a bluetooth connection method according to an embodiment of the present invention, where the method is applied to a second device, that is, a receiver of a bluetooth connection, and the second device is a device with a bluetooth function turned on, and as shown in fig. 4, the method may include the following steps:
s41, receiving a Bluetooth connection request sent by the first equipment.
And S42, responding to the Bluetooth connection request, and sending a password verification request to the first equipment.
To secure bluetooth communications, the legitimacy of the first device is verified by sending a password verification request to the first device.
S43, receiving the Bluetooth password sent by the first equipment.
And when the Bluetooth password sent by the first equipment is not received within the preset time length, the first equipment is determined to be illegal equipment, and a Bluetooth communication link is not established with the first equipment.
And S44, verifying whether the Bluetooth password is correct.
Because the first device may not obtain the bluetooth password sent by the server due to being illegal, in this case, the first device may generate an error password to send to the second device, and therefore the second device needs to verify the bluetooth password sent by the first device, and perform bluetooth communication again when the bluetooth password is determined to be correct, thereby ensuring the security of bluetooth communication.
The method includes the steps that whether a Bluetooth password sent by first equipment is correct or not is verified, namely whether the Bluetooth password sent by the first equipment is consistent with the Bluetooth password of second equipment or not is verified, the Bluetooth password of the second equipment used for verifying whether the Bluetooth password sent by the first equipment is correct or not can be stored in the second equipment in advance, or a password request can be sent to a server through the second equipment to be obtained from the server, wherein the password request comprises a serial number of the second equipment, and when the server determines that the serial number of the equipment sending the password request is consistent with the equipment serial number contained in the password request, the server sends the corresponding Bluetooth password to the equipment sending the password request.
If the bluetooth password transmitted by the first device is consistent with the bluetooth password of the second device, determining that the bluetooth password transmitted by the first device is correct, and performing S45, and if not, determining that the bluetooth password transmitted by the first device is incorrect, and not performing S45.
In a possible implementation manner, when the bluetooth password sent by the first device is incorrect, a prompt message may be generated to prompt the user that an illegal user wants to connect to the second device, so that the user may take corresponding measures.
And S45, if the Bluetooth password is correct, carrying out Bluetooth communication with the first equipment.
And when the Bluetooth password sent by the first device is determined to be the Bluetooth password of the second device, establishing a Bluetooth communication link with the first device, so as to start Bluetooth communication with the first device.
In the bluetooth connection method provided in this embodiment, when the second device receives the bluetooth connection request sent by the first device, the second device sends a password verification request to the first device in order to verify the validity of the first device, receives the bluetooth password returned by the first device, and verifies whether the received bluetooth password is correct, and performs bluetooth communication with the first device under the condition that the bluetooth password is correct. The second equipment carries out password verification on the first equipment before Bluetooth communication, so that the first equipment which carries out Bluetooth communication with the second equipment is guaranteed to be legal equipment, and the safety of the Bluetooth communication is guaranteed.
Fig. 5 is a bluetooth connection apparatus according to an embodiment of the present invention, which is applied to a server, and as shown in fig. 5, the apparatus includes:
a receiving module 501, configured to receive an MAC address of a first device and a serial number of a second device sent by the first device;
an address table obtaining module 502, configured to obtain a preset legal MAC address table;
a checking module 503, configured to determine whether the legal MAC address table includes the MAC address of the first device;
a sending module 504, configured to determine that the first device is legal if the first device is included in the second device, and send a pre-stored bluetooth password corresponding to the serial number of the second device to the first device, so that the first device performs bluetooth communication with the second device according to the bluetooth password.
On the basis of the foregoing embodiment, the address table obtaining module 502 is specifically configured to:
and determining the security level of the second equipment according to the serial number of the second equipment, and acquiring a preset legal MAC address table corresponding to the security level according to the security level.
Fig. 6 is a bluetooth connection apparatus according to an embodiment of the present invention, which is applied to a first device, and as shown in fig. 6, the apparatus may include:
a request sending module 601, configured to send a bluetooth connection request to a second device when a bluetooth hotspot of the second device is searched, where a name of the bluetooth hotspot includes a serial number of the second device;
a request receiving module 602, configured to receive a password authentication request returned by the second device;
the information sending module is used for sending the MAC address of the information sending module and the serial number of the second equipment to a server so that the server can verify whether the first equipment is legal or not;
a password receiving module 603, configured to receive a bluetooth password returned by the server, where the bluetooth password is a bluetooth password that is sent by the server and corresponds to the serial number of the second device when the server verifies that the first device is legal;
a password sending module 604, configured to send the bluetooth password to the second device in response to the password verification request, so that the second device communicates with the first device when the bluetooth password is correct.
Fig. 7 further provides a bluetooth connection apparatus for a second device according to an embodiment of the present invention, as shown in fig. 7, the apparatus includes:
a request receiving module 701, configured to receive a bluetooth connection request sent by a first device;
a request sending module 702, configured to send a password verification request to the first device in response to the bluetooth connection request;
a password receiving module 703, configured to receive a bluetooth password sent by the first device;
a password verification module 704, configured to verify whether the bluetooth password is correct;
a communication connection module 705, configured to perform bluetooth communication with the first device if the bluetooth password is correct.
In another embodiment of the present application, an electronic device is further provided, as shown in fig. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804;
a memory 803 for storing a computer program;
the processor 801 is configured to implement the following steps when executing the program stored in the memory 803:
the method comprises the steps of receiving an MAC address of first equipment and a sequence number of second equipment, sent by the first equipment, obtaining a preset legal MAC address table, determining whether the MAC address of the first equipment is contained in the legal MAC address table, if so, determining that the first equipment is legal, and sending a pre-stored Bluetooth password corresponding to the sequence number of the second equipment to the first equipment so that the first equipment can carry out Bluetooth communication with the second equipment according to the Bluetooth password.
Or
When a Bluetooth hotspot of a second device is searched, a Bluetooth connection request is sent to the second device, wherein the name of the Bluetooth hotspot comprises a serial number of the second device;
receiving a password verification request returned by the second equipment;
and sending the MAC address of the server and the sequence number of the second equipment to a server so as to enable the server to verify whether the first equipment is legal or not, receiving a Bluetooth password returned by the server, wherein the Bluetooth password is the Bluetooth password sent by the server under the condition that the first equipment is legal and corresponds to the sequence number of the second equipment, responding to the password verification request, and sending the Bluetooth password to the second equipment so as to enable the second equipment to be communicated with the first equipment under the condition that the Bluetooth password is correct.
Or
Receiving a Bluetooth connection request sent by first equipment, responding to the Bluetooth connection request, sending a password verification request to the first equipment, receiving a Bluetooth password sent by the first equipment, verifying whether the Bluetooth password is correct, and carrying out Bluetooth communication with the first equipment if the Bluetooth password is correct.
The communication bus 804 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 804 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The communication interface 802 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory 803 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor 801 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores thereon a data processing method program, and when the data processing method program is executed by a processor, the data processing method program implements any of the steps of the bluetooth connection method described above.
When the embodiment of the invention is specifically implemented, reference can be made to the above embodiments, and corresponding technical effects are achieved.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (5)

1. A Bluetooth connection method is applied to a server, and comprises the following steps:
receiving the MAC address of the first device and the serial number of the second device, which are sent by the first device;
acquiring a preset legal MAC address table;
determining whether the legal MAC address table contains the MAC address of the first device;
if yes, determining that the first equipment is legal, and sending a pre-stored Bluetooth password corresponding to the serial number of the second equipment to the first equipment so that the first equipment performs Bluetooth communication with the second equipment according to the Bluetooth password;
acquiring a preset legal MAC address table, comprising:
determining the security level of the second equipment according to the serial number of the second equipment;
and acquiring a preset legal MAC address table corresponding to the security level according to the security level.
2. An internet of things system, the system comprising: the system comprises a server, a first device and a second device;
the first device is used for sending a Bluetooth connection request to the second device when a Bluetooth hotspot of the second device is searched, wherein the name of the Bluetooth hotspot comprises a serial number of the second device;
the second device is used for receiving the Bluetooth connection request sent by the first device and sending a password verification request to the first device in response to the Bluetooth connection request;
the first device is further configured to receive a password authentication request returned by the second device, and send an MAC address of the first device and a serial number of the second device to the server;
the server is used for receiving the MAC address of the first equipment and the serial number of the second equipment sent by the first equipment, acquiring a preset legal MAC address table, determining whether the MAC address of the first equipment is contained in the legal MAC address table, if so, determining that the first equipment is legal, and sending a pre-stored Bluetooth password corresponding to the serial number of the second equipment to the first equipment;
the first device is further used for receiving the Bluetooth password returned by the server and responding to the password verification request to send the Bluetooth password to the second device;
the second device is also used for receiving the Bluetooth password sent by the first device, verifying whether the Bluetooth password is correct or not, and if so, performing Bluetooth communication with the first device;
the server acquires a preset legal MAC address table, and the method comprises the following steps:
determining the security level of the second equipment according to the serial number of the second equipment;
and acquiring a preset legal MAC address table corresponding to the security level according to the security level.
3. A Bluetooth connection device, applied to a server, the device comprising:
the receiving module is used for receiving the MAC address of the first equipment and the serial number of the second equipment, which are sent by the first equipment;
the address table acquisition module is used for acquiring a preset legal MAC address table;
a checking module, configured to determine whether the legal MAC address table includes the MAC address of the first device;
the sending module is used for determining that the first equipment is legal if the first equipment is contained in the second equipment, and sending a pre-stored Bluetooth password corresponding to the serial number of the second equipment to the first equipment so that the first equipment can perform Bluetooth communication with the second equipment according to the Bluetooth password;
the address table obtaining module is specifically configured to:
and determining the security level of the second equipment according to the serial number of the second equipment, and acquiring a preset legal MAC address table corresponding to the security level according to the security level.
4. An electronic device, comprising: a processor and a memory, the processor being configured to execute a data processing program stored in the memory to implement the bluetooth connection method of claim 1.
5. A storage medium storing one or more programs, the one or more programs executable by one or more processors to implement the bluetooth connection method of claim 1.
CN202010177731.9A 2020-03-13 2020-03-13 Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium Active CN111510896B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010177731.9A CN111510896B (en) 2020-03-13 2020-03-13 Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010177731.9A CN111510896B (en) 2020-03-13 2020-03-13 Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111510896A CN111510896A (en) 2020-08-07
CN111510896B true CN111510896B (en) 2021-09-14

Family

ID=71871539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010177731.9A Active CN111510896B (en) 2020-03-13 2020-03-13 Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111510896B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112039737B (en) * 2020-08-26 2021-07-20 珠海格力电器股份有限公司 Equipment network distribution method, equipment control method, terminal equipment and equipment control system
CN113395741B (en) * 2021-05-24 2023-03-10 珠海格力电器股份有限公司 Network distribution system, method and device of equipment, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2924742A1 (en) * 2013-09-20 2015-03-26 Lucova Inc. Systems and methods for facilitating mobile commerce interactions between customers and merchants
CN105491511A (en) * 2015-12-30 2016-04-13 北京华大智宝电子系统有限公司 Bluetooth device matching method, Bluetooth device and Bluetooth device matching system
CN108471610A (en) * 2018-03-02 2018-08-31 杨宪国 Bluetooth connection control system
CN109640326A (en) * 2018-11-16 2019-04-16 深圳绿米联创科技有限公司 Right management method, device, system and mobile terminal
CN109862560A (en) * 2017-11-30 2019-06-07 阿里巴巴集团控股有限公司 A kind of bluetooth authentication method, apparatus, equipment and medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104918237B (en) * 2014-03-13 2019-03-15 阿里巴巴集团控股有限公司 The method, communication master device, communication of wireless communication connection are established from equipment, server and system
CN104320412B (en) * 2014-11-11 2018-04-17 福建联迪商用设备有限公司 A kind of method and device of Bluetooth POS, Bluetooth POS secure connection
CN104378145B (en) * 2014-11-27 2018-08-31 北京深思数盾科技股份有限公司 The matching method and system of bluetooth equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2924742A1 (en) * 2013-09-20 2015-03-26 Lucova Inc. Systems and methods for facilitating mobile commerce interactions between customers and merchants
CN105491511A (en) * 2015-12-30 2016-04-13 北京华大智宝电子系统有限公司 Bluetooth device matching method, Bluetooth device and Bluetooth device matching system
CN109862560A (en) * 2017-11-30 2019-06-07 阿里巴巴集团控股有限公司 A kind of bluetooth authentication method, apparatus, equipment and medium
CN108471610A (en) * 2018-03-02 2018-08-31 杨宪国 Bluetooth connection control system
CN109640326A (en) * 2018-11-16 2019-04-16 深圳绿米联创科技有限公司 Right management method, device, system and mobile terminal

Also Published As

Publication number Publication date
CN111510896A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
CN109862043B (en) Terminal authentication method and device
CN107579966B (en) Control method, device and system for remotely accessing intranet and terminal equipment
CN109583181B (en) Authentication method, authentication device and machine-readable storage medium
CN111510896B (en) Bluetooth connection method and device, Internet of things system, electronic equipment and storage medium
JP2018173921A (en) Network device, authentication management system, and control methods and control programs therefor
CN111431844B (en) Authority authentication method and device
CN111783049A (en) User information processing method and system based on block chain
CN111786996A (en) Cross-domain synchronous login state method and device and cross-domain synchronous login system
CN112448930A (en) Account registration method, device, server and computer readable storage medium
CN112437071B (en) Method, system, device and storage medium for controlling device
CN109729045B (en) Single sign-on method, system, server and storage medium
CN107770143B (en) Method and device for verifying client validity
CN113596823B (en) Slice network protection method and device
CN115499199A (en) Vehicle safety communication method and device, vehicle and storage medium
JP5654669B2 (en) Real name registration status acquisition method, acquisition device and terminal
CN111835504A (en) Identification code generation method and server
CN112822172B (en) Login verification method and device, electronic equipment and storage medium
KR101874815B1 (en) Method for examining change of dns address and terminal apparatus for the same
CN114978544A (en) Access authentication method, device, system, electronic equipment and medium
WO2006059852A1 (en) Method and system for providing resources by using virtual path
CN106953728B (en) Data transmission method and electronic equipment
CN111046383B (en) Terminal attack defense method and device, terminal and cloud server
CN112532423A (en) Equipment access method, device and system
CN111918268A (en) Control method and device of intelligent equipment, electronic equipment and storage medium
CN112654039B (en) Terminal validity identification method, device and system

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