CN114666779A - Device connection method and device, computer device and storage medium - Google Patents

Device connection method and device, computer device and storage medium Download PDF

Info

Publication number
CN114666779A
CN114666779A CN202210368190.7A CN202210368190A CN114666779A CN 114666779 A CN114666779 A CN 114666779A CN 202210368190 A CN202210368190 A CN 202210368190A CN 114666779 A CN114666779 A CN 114666779A
Authority
CN
China
Prior art keywords
connection
devices
connectable
equipment
current
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
CN202210368190.7A
Other languages
Chinese (zh)
Other versions
CN114666779B (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.)
Shenzhen Oribo Technology Co Ltd
Original Assignee
Shenzhen Oribo 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 Shenzhen Oribo Technology Co Ltd filed Critical Shenzhen Oribo Technology Co Ltd
Priority to CN202210368190.7A priority Critical patent/CN114666779B/en
Publication of CN114666779A publication Critical patent/CN114666779A/en
Application granted granted Critical
Publication of CN114666779B publication Critical patent/CN114666779B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application relates to a device connection method, an apparatus, a computer device, a storage medium and a computer program product, the method comprising: scanning the connectable device to obtain a scanning result; if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices; the plurality of connectable devices are connected according to an overall connection order. When detecting that a plurality of devices need to be connected, the influence of indirect connection equipment on direct connection equipment is reduced, the minimum mutual influence between the devices when being connected is ensured, and the efficiency and the accuracy of equipment connection are improved.

Description

Device connection method and device, computer device and storage medium
Technical Field
The present application relates to the field of terminal network access technologies, and in particular, to a device connection method, apparatus, computer device, storage medium, and computer program product.
Background
The intelligent home is characterized in that a house is used as a platform, and facilities related to home life are inherited by utilizing a comprehensive wiring technology, a network communication technology, an intelligent home-system design scheme safety precaution technology, an automatic control technology and an audio and video technology, so that an efficient management system for house facilities and family schedule things is constructed.
In an actual application scenario, a user generally manages the smart home devices installed in a home through application software on a terminal, and a plurality of different communication protocols exist between different smart home devices and the terminal, such as low-power bluetooth, Wi-Fi, ZigBee and the like. When the terminal establishes connection with the smart home device by using a Wi-Fi AP (Access Point), the terminal needs to acquire critical data of the Wi-Fi AP device, and the critical data can be acquired only when the terminal is connected with a router corresponding to the AP node. In addition, when the terminal is connected with the intelligent household equipment in other connection modes, the terminal needs to be connected with the server by means of an external network.
Therefore, when the terminal is connected with a plurality of intelligent household devices, the Wi-Fi AP device can cause network switching and the terminal cannot be connected with the server, and further the connection of other devices is influenced.
Disclosure of Invention
In view of the above, it is necessary to provide a device connection method, an apparatus, a computer device, a computer readable storage medium, and a computer program product, which can be efficiently and stably provided to solve the above technical problems.
In a first aspect, the present application provides a device connection method, including:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
In one embodiment, after connecting the plurality of connectable devices according to the overall connection order, the method further comprises:
scanning connectable equipment in real time, and updating an overall connection order based on the currently connectable equipment to obtain a current overall connection order under the condition that the currently connectable equipment is scanned and the currently existing equipment is connected with the terminal;
and after the equipment currently connected with the terminal completes connection, connecting the currently connectable equipment according to the current overall connection sequence.
In one embodiment, after scanning the connectable device in real time, the method further includes:
when the current connectable equipment is scanned, the connection mode of the current connectable equipment and the terminal is indirect connection and the current connectable equipment is the current first scanned equipment, taking the current connectable equipment as the equipment to be connected, and timing by a timer from the moment when the equipment to be connected is scanned;
and under the condition that the accumulated time of the timer reaches the preset time and the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
In one embodiment, connecting the devices to be connected according to the current overall connection order includes:
and setting the connection order of the devices waiting for connection as the highest priority in the current overall connection order, and preferentially connecting the devices waiting for connection.
In one embodiment, updating the current overall connection order comprises:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
In one embodiment, the connection mode between the device and the terminal is determined based on the type of communication protocol used when the device and the terminal are connected.
In one embodiment, the communication protocol type used by the device directly connected with the terminal is any one of the following protocol types, including bluetooth low energy, ZigBee and WDS.
In a second aspect, the present application also provides an apparatus for connecting devices, the apparatus comprising:
the scanning module is used for scanning the connectable equipment to obtain a scanning result;
a determining module, configured to determine an overall connection order of the plurality of connectable devices if the scan result includes a plurality of connectable devices, and the plurality of connectable devices include devices whose connection manners are direct connection and devices whose connection manners are indirect connection, where the overall connection order is determined based on the connection manners of the plurality of connectable devices, and the connection manner is that the connection order of the directly connected devices is prior to the connection manner of the indirectly connected devices;
and the connecting module is used for connecting the plurality of connectable devices according to the overall connecting sequence.
In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
In a fourth aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, the computer program when executed by a processor implementing the steps of:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
In a fifth aspect, the present application further provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
The device connection method, the device, the computer device, the storage medium and the computer program product are used for scanning connectable devices to obtain scanning results; if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices; the plurality of connectable devices are connected according to an overall connection order. When detecting that a plurality of devices need to be connected, the mutual influence among the devices can be ensured to be minimum during connection, and the efficiency of device connection is improved.
Drawings
FIG. 1 is a diagram of an application environment of a device connection method according to an embodiment;
FIG. 2 is a flow diagram illustrating a method for device attachment according to one embodiment;
FIG. 3 is a flowchart illustrating a method for device connection according to another embodiment;
FIG. 4 is a flowchart illustrating a method for device connection in accordance with yet another embodiment;
FIG. 5 is a diagram illustrating an interaction of information for a device connection method in one embodiment;
FIG. 6 is a block diagram showing the structure of a device connecting apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The intelligent home is characterized in that a house is used as a platform, and facilities related to home life are inherited by utilizing a comprehensive wiring technology, a network communication technology, an intelligent home-system design scheme safety precaution technology, an automatic control technology and an audio and video technology, so that an efficient management system for house facilities and family schedule things is constructed.
Terminals in this application include, but are not limited to: the smart home equipment comprises electronic equipment with data operation capability, such as a mobile phone, a smart watch, a tablet personal computer, a smart bracelet, a smart television, a smart control panel, a notebook computer, a desktop computer and a smart sound box, in an actual application scene, a user generally manages the smart home equipment installed in a family through application software on a terminal, and different communication protocols, such as Bluetooth, Wi-Fi and ZigBee exist between different smart home equipment and terminals. Different communication protocols are adopted to cause different time sequences of information interaction between the server and the terminal and the equipment, under general conditions, if the terminal is directly connected with the intelligent household equipment, the terminal can send the identified information of the equipment to the server for verification after identifying the equipment, and after the server passes the verification, the terminal can be connected with the equipment. For example, when the terminal adopts a bluetooth mode to carefully connect with the terminal, after the terminal device scans and identifies the bluetooth of the available device, the device information of the device is acquired and sent to the server, whether the device is in the managed device range is verified, and if yes, the connection between the terminal and the device is successful.
When the terminal establishes connection with the smart home device by using a Wi-Fi AP (Access Point), the terminal needs to acquire critical data of the Wi-Fi AP device, and the critical data can be acquired only when the terminal is connected with a router corresponding to the AP node.
In addition, when the terminal is connected with the intelligent household equipment in other connection modes, the terminal needs to be connected with the server by means of an external network. For example, in an application scenario, a terminal is connected with a server through a router a to acquire a network, that is, a commonly used mobile phone surfs the internet through the router a by using Wi-Fi, a home device 1 is connected with the terminal through a bluetooth mode, a home device 2 is connected with a router B through an AP node, when the home device 2 is connected with the mobile phone, because a Wi-Fi AP adding mode is adopted, the terminal (mobile phone) needs to acquire some critical data in Wi-Fi AP devices, the critical data cannot be directly acquired, and the critical data can be acquired only after the terminal is connected with the router B.
In the prior art, one terminal can only be connected with one router, so that when the terminal is connected with multiple intelligent household devices, the Wi-Fi AP equipment can cause network switching of the terminal and the terminal can not be connected with a server, and further connection of other devices is influenced.
In addition, it should be noted that the device in the embodiment of the present application is not limited to the smart home device, and may also be a device used in industrial production and needing management and control, and the type and the use scenario of the device are not specifically limited in the present application.
The device connection method provided by the embodiment of the application can be applied to the application environment shown in fig. 1, and connection management and control of multiple terminal devices are achieved. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In an embodiment, as shown in fig. 2, a device connection method is provided, which is described by taking an example that the method is applied to a terminal, and includes the following steps:
step 202, scanning the connectable device to obtain a scanning result;
the connectable device is a device which communicates with the terminal by using a communication protocol allowed by the terminal, and it can be understood that if an agreement cannot be reached between one device and the terminal, the device cannot be scanned and identified by the terminal.
Specifically, the device management module of the terminal may be started to perform device scanning through a trigger instruction, after discovered device data reported by the device management module is received, a communication protocol type used between the scanned device and the terminal is identified, and a device adding mode, such as traditional bluetooth adding, ZigBee adding, and Wi-Fi adding, is determined, where the Wi-Fi adding includes Wi-Fi AP, Wi-Fi SSID, and the like, is generally adopted between each device and the terminal, and a fixed adding mode, such as bluetooth adding for a bluetooth sound device and Wi-Fi adding for an intelligent refrigerator is adopted.
Step 204, if the scanning result includes a plurality of connectable devices, and the plurality of connectable devices include devices whose connection modes are direct connection and devices whose connection modes are indirect connection, determining an overall connection order of the plurality of connectable devices, where the overall connection order is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection order of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the direct connection device is directly connected between the equipment and the terminal without other equipment, for example, a mobile phone is directly connected with the sound through wireless Bluetooth; the indirect connection refers to the contact that the device needs to get with the terminal through other devices, for example, the intelligent water dispenser is connected with the router B through the wireless AP, and at this time, if the connection needs to be established with the mobile phone, the mobile phone needs to be connected with the router B, and the connection is established with the intelligent water dispenser through the router B.
It can be understood that the directly connected device is relatively fast when being connected with the terminal, and generally does not affect the connection of other devices; indirectly connected devices are inefficient in connection and may affect the connection of other devices. Therefore, when a plurality of connectable devices are identified, the devices connected in the direct connection manner are connected first, and the devices connected in the indirect connection manner are considered.
Specifically, the connection modes of all connectable devices are identified, the connections of the multiple devices are sorted according to the connection modes, and when the connection order of all connectable devices is determined, the terminal can simultaneously connect the multiple devices or connect the devices one by one. For example, when the connection order is determined by the connection order table, the sorting result is shown in the following connection order table: device 1 (bluetooth add), device 2 (bluetooth low energy), device 3(ZigBee add), device 4(Wi-Fi AP add).
And step 206, connecting the plurality of connectable devices according to the overall connection sequence.
It should be noted that, the connections of the multiple devices are ordered according to the connection modes, and when determining the connection order of all the connectable devices, the terminal may simultaneously connect the multiple devices or may connect the devices one by one. According to the above example, when determining the connection order through the connection order table, the order of actually establishing connections according to the connection order table may be sequential connections: device 1, device 2, device 3, device 4; can also be connected simultaneously in the same way: device 1, device 2 and device 3 are connected first, and device 4 is connected second.
In the method provided in the above embodiment, scanning is performed for the connectable device to obtain a scanning result; if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices; the plurality of connectable devices are connected according to an overall connection order. When detecting that a plurality of devices need to be connected, the mutual influence among the devices can be ensured to be minimum during connection, and the efficiency of device connection is improved.
In one embodiment, referring to fig. 3, after connecting the plurality of connectable devices according to the overall connection order, the method further includes:
step 302, scanning the connectable devices in real time, and updating the overall connection order based on the currently connectable devices to obtain the current overall connection order under the condition that the currently connectable devices are scanned and the currently existing devices are connected with the terminal;
and step 304, after the device currently connected with the terminal completes connection, connecting the currently connectable device according to the current overall connection sequence.
When the terminal is used for managing the equipment in the environment, the equipment is disconnected or connected, so that the equipment in the surrounding environment can be scanned according to a preset period after the equipment identified by first scanning is connected, and if the connectable equipment is scanned, the current overall connection sequence is updated according to the connection mode of the connectable equipment. For example, after the user goes home, the mobile phone is turned on to scan the smart home devices in the home environment, the connection of the connectable devices is completed, the mobile phone turns off the device scanning function, then automatic scanning is performed every 10min, and the scanned connectable devices are connected according to the updated overall connection sequence.
Specifically, if the connection mode of the currently real-time scanning identified device is direct connection, after the currently connected device is connected, the sequence of the currently scanned device may be determined by referring to the sequence of the devices whose connection modes are direct connection in the overall connection sequence, and if the connection mode of the currently real-time scanning identified device is indirect connection, the currently scanned device may be placed at the end of the overall connection sequence, or behind the device whose connection mode is direct connection.
In the method provided in the foregoing embodiment, the connectable devices are scanned in real time, and when the current connectable device is scanned and the current connectable device is connected to the terminal, the overall connection order is updated based on the current connectable device to obtain the current overall connection order; and after the equipment currently connected with the terminal completes connection, connecting the currently connectable equipment according to the current overall connection sequence. After the connectable equipment is detected in real time, the overall connection sequence is updated according to the connection mode of the connectable equipment, so that the minimum mutual influence among multiple pieces of equipment during connection can be ensured, and the equipment connection efficiency is improved.
In one embodiment, referring to fig. 4, after scanning the connectable device in real time, the method further includes:
step 402, when the current connectable device is scanned, the connection mode of the current connectable device and the terminal is indirect connection, and the current connectable device is the current first scanned device, the current connectable device is used as a waiting connection device, and timing is performed by a timer from the moment when the waiting connection device is scanned;
and step 404, when the accumulated time of the timer reaches the preset time and all the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
Considering that the device adopting the indirect connection mode affects the connection of other devices, if the device adopting the direct connection mode is scanned when the terminal is connected with the indirect connection device, the information authentication of the device adopting the direct connection mode is affected, so that when the device scanning in real time adopts the indirect connection mode, the device can wait for a period of time to connect, for example, within a short period of time for starting scanning, the WI-FI AP device is firstly found and is not urgently added, the time for providing other devices possibly found next can be given, and then after the period of time, if the bluetooth adding device and the ZigBee adding device exist, the WI-FI AP device is preferentially added. And after the addition is finished, adding WI-FI AP equipment.
In the method provided in the foregoing embodiment, when the currently connectable device is scanned, the connection mode between the currently connectable device and the terminal is indirect connection, and the currently connectable device is a device that is currently scanned first, the currently connectable device is used as a device to be connected, and timing is performed by using a timer from a time when the device to be connected is scanned; and under the condition that the accumulated time of the timer reaches the preset time and all the devices which are directly connected in the current overall connection sequence in the connection mode are connected, connecting the devices to be connected according to the current overall connection sequence. Through setting the preset time length, the influence of indirect connection equipment on the direct connection equipment scanned in real time is reduced, the equipment connection efficiency is improved, and the connection quality is guaranteed.
In one embodiment, connecting the devices to be connected according to the current overall connection order includes:
and setting the connection order of the devices waiting for connection to be the highest priority in the current overall connection order, and preferentially connecting the devices waiting for connection.
It should be noted that, after the waiting time of the indirect connection device exceeds the preset time, the current indirect connection device needs to be considered in a limited manner. It can be understood that, after considering the influence of the indirect connection device on other devices, when the set time length is exceeded, the connection of the identified indirect device needs to be completed first, so as to avoid that the indirect connection device cannot obtain a connection response in a long time, and at this time, the indirect connection device is placed at the most advanced position of the overall connection sequence.
In one embodiment, updating the current overall connection order includes:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
In one embodiment, the connection mode between the device and the terminal is determined based on the type of communication protocol used when the device and the terminal are connected.
In one embodiment, the communication protocol type used by the device directly connected with the terminal is any one of the following protocol types, including bluetooth low energy, ZigBee and WDS.
It should be understood that, although the steps in the flowcharts related to the embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
To facilitate understanding, a specific embodiment is given, see fig. 5, as follows:
the mobile phone terminal comprises a quick connection module, an equipment management module, a system module and a display module, and is used for realizing the following functions:
and the quick connection module starts the equipment management module and the equipment scanning of the system module through mobile phone information, and confirms the equipment of the WI-FI AP, the Bluetooth, the ZigBee and the low power consumption Bluetooth by distinguishing the protocol types of various equipment after receiving the discovered equipment data reported by the equipment management module and the system module.
During a short period of time when scanning is started, the WI-FI AP equipment is found out and is not added urgently, other equipment which is possibly found next is given time, and then after the period of time, if equipment of Bluetooth, ZigBee and low-power-consumption Bluetooth exists, the equipment is added preferentially. And after the addition is finished, adding the WI-FI AP equipment.
When a plurality of WI-FI AP devices are added, if Bluetooth, ZigBee and low-power Bluetooth devices are found, after the current WI-FI AP is added, the adding of the WI-FI AP devices is suspended, and the adding of the Bluetooth, ZigBee and low-power Bluetooth devices is preferentially completed.
Based on the same inventive concept, the embodiment of the present application further provides a device connection apparatus for implementing the device connection method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above method, so specific limitations in one or more embodiments of the apparatus connection apparatus provided below may refer to the limitations on the apparatus connection method in the foregoing, and details are not described here.
In one embodiment, as shown in fig. 6, there is provided a device connecting apparatus including: a scanning module 601, a determining module 602, and a connecting module 603, wherein:
a scanning module 601, configured to scan for a connectable device to obtain a scanning result;
a determining module 602, configured to determine an overall connection order of the multiple connectable devices if the scan result includes multiple connectable devices, and the multiple connectable devices include devices with direct connection and devices with indirect connection, where the overall connection order is determined based on connection manners of the multiple connectable devices, and the connection manner is that a connection order of a directly connected device is prior to a connection order of a device with indirect connection;
a connecting module 603 configured to connect the plurality of connectable devices according to an overall connection order.
In one embodiment, the apparatus further comprises an update module configured to:
scanning connectable equipment in real time, and updating an overall connection order based on the currently connectable equipment to obtain a current overall connection order under the condition that the currently connectable equipment is scanned and the currently existing equipment is connected with the terminal;
and after the equipment currently connected with the terminal completes connection, connecting the currently connectable equipment according to the current overall connection sequence.
In one embodiment, the apparatus further comprises a timing module configured to:
when the current connectable equipment is scanned, the connection mode of the current connectable equipment and the terminal is indirect connection and the current connectable equipment is the current first scanned equipment, taking the current connectable equipment as the equipment to be connected, and timing by a timer from the moment when the equipment to be connected is scanned;
and under the condition that the accumulated time of the timer reaches the preset time and the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
In one embodiment, the apparatus further comprises a timing module configured to:
and setting the connection order of the devices waiting for connection to be the highest priority in the current overall connection order, and preferentially connecting the devices waiting for connection.
In one embodiment, the apparatus further comprises an update module configured to:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
In one embodiment, the connection mode between the device and the terminal involved in the apparatus is determined based on the type of communication protocol used when the device and the terminal are connected.
In one embodiment, the communication protocol type adopted by the device directly connected with the terminal in the apparatus is any one of the following protocol types, wherein the following protocol types comprise low power consumption Bluetooth, ZigBee and WDS.
The respective modules in the above-described device connection apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing device connection communication protocol mode data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a device connection method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
scanning connectable equipment in real time, and updating an overall connection order based on the currently connectable equipment to obtain a current overall connection order under the condition that the currently connectable equipment is scanned and the currently existing equipment is connected with the terminal;
and after the equipment currently connected with the terminal completes connection, connecting the currently connectable equipment according to the current overall connection sequence.
In one embodiment, the processor when executing the computer program further performs the steps of:
when the current connectable equipment is scanned, the connection mode of the current connectable equipment and the terminal is indirect connection and the current connectable equipment is the current first scanned equipment, taking the current connectable equipment as the equipment to be connected, and timing by a timer from the moment when the equipment to be connected is scanned;
and under the condition that the accumulated time of the timer reaches the preset time and the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and setting the connection order of the devices waiting for connection to be the highest priority in the current overall connection order, and preferentially connecting the devices waiting for connection.
In one embodiment, the processor when executing the computer program further performs the steps of:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the connection mode between the device and the terminal is determined based on the type of communication protocol used when the device and the terminal are connected.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the communication protocol type adopted by the device directly connected with the terminal is any one of the following protocol types, wherein the following protocol types comprise low-power Bluetooth, ZigBee and WDS.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
In one embodiment, the computer program when executed by the processor further performs the steps of:
scanning connectable equipment in real time, and updating an overall connection order based on the currently connectable equipment to obtain a current overall connection order under the condition that the currently connectable equipment is scanned and the currently existing equipment is connected with the terminal;
and after the equipment currently connected with the terminal completes connection, connecting the currently connectable equipment according to the current overall connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the current connectable equipment is scanned, the connection mode of the current connectable equipment and the terminal is indirect connection and the current connectable equipment is the current first scanned equipment, taking the current connectable equipment as the equipment to be connected, and timing by a timer from the moment when the equipment to be connected is scanned;
and under the condition that the accumulated time of the timer reaches the preset time and the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and setting the connection order of the devices waiting for connection to be the highest priority in the current overall connection order, and preferentially connecting the devices waiting for connection.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
In one embodiment, the computer program when executed by the processor further performs the steps of: the connection mode between the device and the terminal is determined based on the type of communication protocol used when the device and the terminal are connected.
In one embodiment, the computer program when executed by the processor further performs the steps of: the communication protocol type adopted by the device directly connected with the terminal is any one of the following protocol types, wherein the following protocol types comprise low-power Bluetooth, ZigBee and WDS.
In one embodiment, a computer program product is provided, comprising a computer program which when executed by a processor performs the steps of:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining the overall connection sequence of the plurality of connectable devices, wherein the overall connection sequence is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection sequence of the directly connected devices is prior to the connection mode of the indirectly connected devices;
the plurality of connectable devices are connected according to an overall connection order.
In one embodiment, the computer program when executed by the processor further performs the steps of:
scanning connectable equipment in real time, and updating an overall connection order based on the currently connectable equipment to obtain a current overall connection order under the condition that the currently connectable equipment is scanned and the currently existing equipment is connected with the terminal;
and after the equipment currently connected with the terminal completes connection, connecting the currently connectable equipment according to the current overall connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the current connectable equipment is scanned, the connection mode of the current connectable equipment and the terminal is indirect connection and the current connectable equipment is the current first scanned equipment, taking the current connectable equipment as the equipment to be connected, and timing by a timer from the moment when the equipment to be connected is scanned;
and under the condition that the accumulated time of the timer reaches the preset time and the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and setting the connection order of the devices waiting for connection to be the highest priority in the current overall connection order, and preferentially connecting the devices waiting for connection.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
In one embodiment, the computer program when executed by the processor further performs the steps of: the connection mode between the device and the terminal is determined based on the type of communication protocol used when the device and the terminal are connected.
In one embodiment, the computer program when executed by the processor further performs the steps of: the communication protocol type adopted by the device directly connected with the terminal is any one of the following protocol types, wherein the following protocol types comprise low-power Bluetooth, ZigBee and WDS.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases involved in the embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the various embodiments provided herein may be, without limitation, general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, or the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. The equipment connection method is characterized in that the method is applied to a scene that a terminal is connected with a plurality of equipment; the method comprises the following steps:
scanning the connectable device to obtain a scanning result;
if the scanning result comprises a plurality of connectable devices, and the plurality of connectable devices comprise devices with direct connection modes and devices with indirect connection modes, determining an overall connection order of the plurality of connectable devices, wherein the overall connection order is determined based on the connection modes of the plurality of connectable devices, and the connection mode is that the connection order of the directly connected devices is prior to the connection mode of the indirectly connected devices;
connecting the plurality of connectable devices according to the overall connection order.
2. The method of claim 1, wherein after connecting the plurality of connectable devices according to the overall connection order, further comprising:
scanning connectable equipment in real time, and updating the overall connection order based on the currently connectable equipment to obtain the current overall connection order under the condition that the currently connectable equipment is scanned and the currently existing equipment is connected with the terminal;
and after the equipment currently connected with the terminal finishes connection, connecting the currently connectable equipment according to the current overall connection sequence.
3. The method of claim 2, wherein after the real-time scanning for connectable devices, further comprising:
when the current connectable equipment is scanned, the connection mode of the current connectable equipment and the terminal is indirect connection and the current connectable equipment is the current first scanned equipment, taking the current connectable equipment as the equipment to be connected, and timing by a timer from the moment when the equipment to be connected is scanned;
and under the condition that the accumulated time of the timer reaches the preset time and all the devices which are directly connected in the current overall connection sequence are connected, connecting the devices to be connected according to the current overall connection sequence.
4. The method of claim 3, wherein said connecting the devices waiting to be connected according to the current overall connection order comprises:
and setting the connection order of the equipment waiting for connection to be the highest priority in the current overall connection order, and preferentially connecting the equipment waiting for connection.
5. The method of claim 2, wherein the updating the current overall connection order comprises:
if the connection mode of the current connectable equipment is indirect connection, determining the connection order of the current connectable equipment as the position behind the equipment with the direct connection mode in the current overall connection order;
and if the connection mode of the current connectable equipment is direct connection, determining the connection order of the current connectable equipment to be before the equipment with the indirect connection mode in the current overall connection order.
6. The method according to any one of claims 1 to 5, wherein the connection mode between the device and the terminal is determined based on the type of communication protocol used when the device is connected to the terminal.
7. The method according to claim 6, wherein the communication protocol type adopted by the device directly connected with the terminal is any one of the following protocol types, wherein the following protocol types comprise Bluetooth Low energy, ZigBee and WDS.
8. An apparatus for connecting devices, the apparatus comprising:
the scanning module is used for scanning the connectable equipment to obtain a scanning result;
a determining module, configured to determine an overall connection order of the plurality of connectable devices if the scan result includes a plurality of connectable devices, and the plurality of connectable devices include devices whose connection manners are direct connection and devices whose connection manners are indirect connection, where the overall connection order is determined based on the connection manners of the plurality of connectable devices, and the connection manner is that the connection order of the directly connected devices is prior to the connection manner of the indirectly connected devices;
a connection module for connecting the plurality of connectable devices according to the overall connection order.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202210368190.7A 2022-04-08 2022-04-08 Device connection method, device, computer device, and storage medium Active CN114666779B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210368190.7A CN114666779B (en) 2022-04-08 2022-04-08 Device connection method, device, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210368190.7A CN114666779B (en) 2022-04-08 2022-04-08 Device connection method, device, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN114666779A true CN114666779A (en) 2022-06-24
CN114666779B CN114666779B (en) 2024-02-20

Family

ID=82034833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210368190.7A Active CN114666779B (en) 2022-04-08 2022-04-08 Device connection method, device, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN114666779B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003169375A (en) * 2001-11-30 2003-06-13 Konica Corp Electronic apparatus
CN103561480A (en) * 2013-10-21 2014-02-05 广东明创软件科技有限公司 Data transmission method
CN104581999A (en) * 2014-12-11 2015-04-29 惠州Tcl移动通信有限公司 Connecting strategy selection method and terminal
CN105392213A (en) * 2015-11-27 2016-03-09 小米科技有限责任公司 Method and apparatus for connection of controlled intelligent device
CN111065137A (en) * 2019-12-17 2020-04-24 海信集团有限公司 Method for accessing intelligent equipment to network based on Bluetooth and wireless network
CN111343055A (en) * 2018-12-18 2020-06-26 美的集团股份有限公司 Network connection method, Internet of things system and Internet of things equipment
CN113556715A (en) * 2021-07-02 2021-10-26 Oppo广东移动通信有限公司 Device connection method and apparatus, computer readable medium, and electronic device
WO2022006908A1 (en) * 2020-07-10 2022-01-13 Oppo广东移动通信有限公司 Internet-of-things device control method and communication apparatus

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003169375A (en) * 2001-11-30 2003-06-13 Konica Corp Electronic apparatus
CN103561480A (en) * 2013-10-21 2014-02-05 广东明创软件科技有限公司 Data transmission method
CN104581999A (en) * 2014-12-11 2015-04-29 惠州Tcl移动通信有限公司 Connecting strategy selection method and terminal
CN105392213A (en) * 2015-11-27 2016-03-09 小米科技有限责任公司 Method and apparatus for connection of controlled intelligent device
US20170156166A1 (en) * 2015-11-27 2017-06-01 Xiaomi Inc. Method and Apparatus for Connecting With Controlled Smart Device, and Storage Medium
CN111343055A (en) * 2018-12-18 2020-06-26 美的集团股份有限公司 Network connection method, Internet of things system and Internet of things equipment
CN111065137A (en) * 2019-12-17 2020-04-24 海信集团有限公司 Method for accessing intelligent equipment to network based on Bluetooth and wireless network
WO2022006908A1 (en) * 2020-07-10 2022-01-13 Oppo广东移动通信有限公司 Internet-of-things device control method and communication apparatus
CN113556715A (en) * 2021-07-02 2021-10-26 Oppo广东移动通信有限公司 Device connection method and apparatus, computer readable medium, and electronic device

Also Published As

Publication number Publication date
CN114666779B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
US11282520B2 (en) Method, apparatus and device for interaction of intelligent voice devices, and storage medium
CN111800462B (en) Micro service instance processing method, micro service instance processing device, computer equipment and storage medium
WO2015131679A1 (en) Task process processing method and device
CN104156246B (en) The method and device of gray scale upgrading
CN104735671A (en) Malicious call recognition method and device
US10303135B2 (en) Method and apparatus for controlling smart home device
US9348858B2 (en) Methods and systems for dynamically changing contact information
US20130055271A1 (en) Apparatus and method for controlling polling
CN105844869A (en) Information prompting method and device
CN110933733A (en) Network distribution method, device, computer equipment and storage medium
CN112601201A (en) Method for automatically distributing network, routing equipment and computer readable storage medium
CN113656176A (en) Cloud equipment distribution method, device, system, electronic equipment, medium and product
CN108428310A (en) Doorbell management method, electric terminal and storage medium
CN110912990A (en) Method and related equipment for updating consensus period
WO2017206318A1 (en) Mobile device, and method and apparatus for sharing location thereof
CN107302591A (en) Method of data synchronization, device, storage medium and electronic equipment
CN104869445A (en) A method for realizing content sharing between intelligent terminals based on a cloud system and the cloud system
CN114666779B (en) Device connection method, device, computer device, and storage medium
CN105323373A (en) Mobile terminal, and method and device for initializing subscriber identity module card of mobile terminal
CN104735643A (en) Information processing method and data server
CN111813529B (en) Data processing method, device, electronic equipment and storage medium
CN104918301B (en) A kind of method and grid network door access device of MESH network addition equipment
CN105282818A (en) Method for connecting wireless speaker to network and user terminal
CN112954760A (en) Connection method and device of Bluetooth equipment and electronic equipment
CN107734715B (en) Network connection processing method of mobile terminal, storage device 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