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

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

Info

Publication number
CN114666779B
CN114666779B CN202210368190.7A CN202210368190A CN114666779B CN 114666779 B CN114666779 B CN 114666779B CN 202210368190 A CN202210368190 A CN 202210368190A CN 114666779 B CN114666779 B CN 114666779B
Authority
CN
China
Prior art keywords
connection
connectable
devices
current
equipment
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
CN202210368190.7A
Other languages
Chinese (zh)
Other versions
CN114666779A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to a device connection method, apparatus, computer device, storage medium and computer program product, the method comprising: scanning the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode; the plurality of connectable devices are connected according to the overall connection order. When detecting that a plurality of devices need to be connected, the influence of indirect connection devices on direct connection devices is reduced, the minimum interaction force between the plurality of devices is ensured when the plurality of devices are connected, and the efficiency and the accuracy of device connection are improved.

Description

Device connection method, device, computer device, and storage medium
Technical Field
The present invention relates to the field of terminal network access technologies, and in particular, to a device connection method, an apparatus, a computer device, a storage medium, and a computer program product.
Background
The intelligent home uses the home as a platform, and uses comprehensive wiring technology, communication technology, intelligent home-system design scheme safety precaution technology, automatic control technology and audio-video technology to inherit facilities related to home life, so as to construct an efficient management system for home facilities and family schedule things.
In an actual application scenario, a user generally manages 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 bluetooth low energy, wi-Fi, zigBee, and the like. When the terminal establishes connection with the intelligent home equipment by adopting a Wi-Fi AP (wireless Access Point), the terminal needs to acquire the key data of the Wi-Fi AP equipment, and the key data can be acquired only when the terminal is connected with a router corresponding to an AP node. In addition, when the terminal is connected with the intelligent home equipment in other connection modes, the terminal needs to be connected with a server by means of an external network.
Therefore, when the terminal is connected with a plurality of intelligent home devices, the Wi-Fi AP device can cause network switching, the terminal is connected with a server, and connection of other devices is affected.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a device connection method, apparatus, computer device, computer-readable storage medium, and computer program product that can be efficiently and stably implemented.
In a first aspect, the present application provides a device connection method, the method including:
scanning the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
the plurality of connectable devices are connected according to the overall connection order.
In one embodiment, after the plurality of connectable devices are connected according to the overall connection order, the method further includes:
scanning connectable equipment in real time, and updating the whole connection sequence based on the current connectable equipment under the condition that the current connectable equipment is scanned and the current equipment and the terminal are connected, so as to obtain the current whole connection sequence;
After the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order.
In one embodiment, after scanning the connectable device in real time, further comprising:
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 first scanned device, the current connectable device is used as a waiting connection device, and the timer is used for timing from the moment of scanning to the waiting connection device;
and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices to be connected according to the current integral connection sequence.
In one embodiment, according to the current overall connection order, connecting the devices to be connected comprises:
the connection order of the devices waiting to be connected is set to be the most preferable in the current overall connection order, and the devices waiting to be connected are prioritized to be connected.
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 sequence of the current connectable equipment as equipment with the direct connection mode in the current integral connection sequence;
if the connection mode of the current connectable device is direct connection, determining the connection sequence of the current connectable device as the front of the device with the indirect connection mode in the current overall connection sequence.
In one embodiment, the manner of connection between the device and the terminal is determined based on the type of communication protocol used when the device is connected to the terminal.
In one embodiment, the type of communication protocol used by the device directly connected to the terminal is any one of the following protocol types, including bluetooth low energy, zigBee, and WDS.
In a second aspect, the present application further provides a device connection apparatus, 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 the plurality of connectable devices, and the plurality of connectable devices includes a device whose connection manner is direct connection and a device whose connection manner is indirect connection, where the overall connection order is determined based on the connection manner of the plurality of connectable devices, and the connection manner is that of the directly connected device prior to the connection manner being that of the indirectly connected device;
And the connection module is used for connecting the plurality of connectable devices according to the whole connection sequence.
In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the following steps when executing the computer program:
scanning the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
the plurality of connectable devices are connected according to the overall connection order.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
scanning the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
the plurality of connectable devices are connected according to the overall connection order.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
scanning the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
The plurality of connectable devices are connected according to the overall connection order.
The device connection method, apparatus, computer device, storage medium and computer program product described above, by scanning for connectable devices 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode; the plurality of connectable devices are connected according to the overall connection order. When detecting that a plurality of devices need to be connected, the method can ensure that the mutual influence force among the plurality of devices is minimum during connection, and improves the efficiency of device connection.
Drawings
FIG. 1 is an application environment diagram of a device connection method in one embodiment;
FIG. 2 is a flow diagram of a method of device connection in one embodiment;
FIG. 3 is a flow chart of a method of device connection in another embodiment;
FIG. 4 is a flow chart of a method of device connection in yet another embodiment;
FIG. 5 is a diagram of device connection method information interaction in one embodiment;
FIG. 6 is a block diagram of the device connection apparatus in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The intelligent home uses the home as a platform, and uses comprehensive wiring technology, communication technology, intelligent home-system design scheme safety precaution technology, automatic control technology and audio-video technology to inherit facilities related to home life, so as to construct an efficient management system for home facilities and family schedule things.
Terminals in this application include, but are not limited to: electronic equipment with data computing capability such as mobile phones, smart watches, tablet personal computers, smart bracelets, smart televisions, intelligent control panels, notebook computers, desktop computers and intelligent sound equipment, and in actual application scenes, a user generally manages intelligent household equipment installed in a household through application software on a terminal, and a plurality of different communication protocols exist between different intelligent household equipment and the terminal, such as Bluetooth, wi-Fi, zigBee and the like. The time sequence of information interaction between the server and the terminal and between the devices is different due to the adoption of different communication protocols, and in general, if the terminal is directly connected with the intelligent home device, the information of the identified device is sent to the server for verification after the terminal identifies the device, and the terminal can establish connection with the device after the server passes the verification. For example, when the terminal is connected with the terminal in a bluetooth mode, after the terminal device scans and identifies bluetooth of the available device, device information of the device is acquired and sent to the server, whether the device is in the managed device range is verified, if yes, the connection between the terminal and the device is calculated to be successful.
When the terminal establishes connection with the intelligent home equipment by adopting a Wi-Fi AP (wireless Access Point), the terminal needs to acquire the key data of the Wi-Fi AP equipment, and the key data can be acquired only when the terminal is connected with a router corresponding to an AP node.
In addition, when the terminal is connected with the intelligent home equipment in other connection modes, the terminal needs to be connected with a server by means of an external network. For example, in an application scenario, a terminal is connected to a server through a router a to obtain a network, that is, a commonly used mobile phone uses Wi-Fi to access the internet through the router a, a home device 1 is connected to the terminal through a bluetooth mode, a home device 2 is connected to a router B through an AP node, and when the home device 2 is connected to the mobile phone, the terminal (mobile phone) needs to obtain some critical data in the Wi-Fi AP device due to the Wi-Fi AP adding mode, the critical data cannot be directly obtained, and the critical data cannot be obtained only after the terminal is connected to the router B.
In the prior art, a terminal can only be connected with one router, so when the terminal is connected with a plurality of intelligent home devices, wi-Fi AP equipment can cause network switching of the terminal, the terminal is connected with a server, and connection of other devices is affected.
In addition, it should be noted that the device in the embodiment of the present application is not limited to smart home devices, but may be a device that needs to be controlled and used in industrial production, and the type and the usage 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 an application environment shown in fig. 1, and connection control of a plurality of terminal devices is 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 a 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, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, etc. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, there is provided a device connection method, which is described by taking application of the method to a terminal as an example, including the following steps:
Step 202, scanning the connectable equipment to obtain a scanning result;
the connectable device refers to a device that communicates with a terminal by adopting a communication protocol allowed by the terminal, and it can be understood that if a device cannot "reach a protocol" with the terminal, the terminal cannot scan and identify the device.
Specifically, the device management module of the terminal can be started to scan the device by triggering the command, after the discovered device data reported by the device management module is received, the type of a communication protocol used between the scanned device and the terminal is identified, the adding mode of the device is determined, such as traditional Bluetooth adding, zigBee adding and Wi-Fi adding, the Wi-Fi adding comprises Wi-Fi AP, wi-Fi SSID and the like, a fixed adding mode is generally adopted between each device and the terminal, such as Bluetooth adding by Bluetooth sound and Wi-Fi adding by an intelligent refrigerator.
Step 204, if the scan result includes a plurality of connectable devices, and the plurality of connectable devices includes a device with a direct connection and a device with an indirect connection, determining an overall connection order of the plurality of connectable devices, where the overall connection order is determined based on the connection manners of the plurality of connectable devices, and the connection order of the device with the direct connection is prior to the connection manner being the device with the indirect connection;
The direct connection device is used for directly connecting the device with the terminal, and other devices are not needed, for example, a mobile phone is directly connected with the sound through wireless Bluetooth; the indirect connection means that the device needs to be contacted with the terminal through other devices, for example, the intelligent water dispenser is connected with the router B through a wireless AP point, at this time, if the device needs to be connected with the mobile phone, the mobile phone needs to be connected with the router B, and the device needs to be connected with the intelligent water dispenser through the router B.
It can be appreciated that the directly connected device has a relatively high speed when connected with the terminal, and generally does not affect the connection of other devices; the connection efficiency of the indirectly connected device is low, and the connection of other devices may be affected. Therefore, when a plurality of connectable devices are identified, the devices are connected in a direct connection manner, and then the indirectly connected devices are considered.
Specifically, the connection modes of all connectable devices are identified, the connection of the plurality of devices is ordered according to the connection modes, and when the connection sequence of all the connectable devices is determined, the terminal can simultaneously connect the plurality of devices or connect the devices one by one. For example, when determining the connection order through the connection order table, the ordering result is found in the following connection order table: device 1 (bluetooth addition), device 2 (bluetooth low energy), device 3 (ZigBee addition), device 4 (Wi-Fi AP addition).
Step 206, connecting the plurality of connectable devices according to the overall connection order.
It should be noted that, when the connection orders of all connectable devices are determined, the terminal may connect the plurality of devices at the same time 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 the connection according to the connection order table may be sequentially connected: device 1, device 2, device 3, device 4; can also be connected simultaneously in the same connection mode: device 1, device 2 and device 3 are connected first, followed by device 4.
In the method provided by the embodiment, scanning is performed on the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode; the plurality of connectable devices are connected according to the overall connection order. When detecting that a plurality of devices need to be connected, the method can ensure that the mutual influence force among the plurality of devices is minimum during connection, and improves the efficiency of device connection.
In one embodiment, referring to fig. 3, after the plurality of connectable devices are connected according to the overall connection order, the method further includes:
step 302, scanning connectable equipment in real time, and updating the overall connection order based on the current connectable equipment to obtain the current overall connection order under the condition that the current connectable equipment is scanned and the current equipment and the terminal are being connected;
step 304, after the device currently connected with the terminal completes the connection, the currently connectable device is connected according to the current overall connection order.
When the terminal is used for managing the equipment in the environment, the equipment is disconnected or connected, so after the equipment identified by the first scanning is connected, the equipment in the surrounding environment can be scanned according to a preset period, 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 returns home, the mobile phone is opened to scan the intelligent home equipment in the home environment, the connection of the connectable equipment is completed, the mobile phone closes the equipment scanning function, then the automatic scanning is performed every 10 minutes, and the scanned connectable equipment is connected according to the updated whole connection sequence.
Specifically, if the connection mode of the device identified by the current real-time scanning is direct connection, after the connection of the device being connected is completed, the sequence of the device being scanned can be determined by referring to the sequence of the device with the direct connection mode in the overall connection sequence.
In the method provided by the embodiment, the connectable equipment is scanned in real time, and the current integral connection order is obtained based on the current connectable equipment when the current connectable equipment is scanned and the current equipment and the terminal are connected; after the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order. After the connectable equipment is detected in real time, the whole connection sequence is updated according to the connection mode of the connectable equipment, so that the minimum interaction force among a plurality 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 comprises:
step 402, in the case that 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 device currently scanned for the first time, the current connectable device is used as a waiting connection device, and timing is performed by a timer from the moment of scanning to the waiting connection device;
and step 404, connecting the devices to be connected according to the current integral connection sequence when the accumulated time length of the timer reaches the preset time length and the devices connected directly in the current integral connection sequence are connected.
Considering that the device adopting the indirect connection mode can affect the connection of other devices, if the device which is directly connected is scanned when the terminal is connected with the indirect connection device, the information authentication of the directly connected device can be affected, so when the device which is scanned in real time adopts the indirect connection mode, the device can wait for a period of time to connect, for example, in a short period of time when the device starts scanning, the WI-FI AP device is discovered first, the device is not urgently added, the time of other devices which can be discovered immediately is given, and then after the period of time, if the Bluetooth adding device and the ZigBee adding device exist, the device is added preferentially. After the addition is completed, WI-FI AP equipment is added.
In the method provided in the above embodiment, when the current connectable device is scanned, the connection mode between the current connectable device and the terminal is indirect connection, and the current connectable device is the device currently scanned for the first time, the current connectable device is used as a waiting connection device, and the timer is used for counting time from the moment of scanning to the waiting connection device; and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices to be connected according to the current integral connection sequence. By setting the preset time length, the influence of the 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 ensured.
In one embodiment, according to the current overall connection order, connecting the devices to be connected comprises:
the connection order of the devices waiting to be connected is set to be the most preferable in the current overall connection order, and the devices waiting to be connected are prioritized to be connected.
It should be noted that, after the waiting time of the indirect connection apparatus exceeds the preset time, the current indirect connection apparatus needs to be considered in a limited manner. It will be appreciated that after considering the influence of the indirect connection device on other devices, when the set period of time is exceeded, the identified indirect connection device needs to be connected first, so as to avoid that the indirect connection device cannot obtain a connection response for a long time, and the indirect connection device is placed at the most preferred 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 sequence of the current connectable equipment as equipment with the direct connection mode in the current integral connection sequence;
if the connection mode of the current connectable device is direct connection, determining the connection sequence of the current connectable device as the front of the device with the indirect connection mode in the current overall connection sequence.
In one embodiment, the manner of connection between the device and the terminal is determined based on the type of communication protocol used when the device is connected to the terminal.
In one embodiment, the type of communication protocol used by the device directly connected to 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 above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
For ease of 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 scanning of the equipment management module and the system module through the mobile phone message, 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 equipment data reported by the equipment management module and the system module.
The WI-FI AP device is discovered first and not immediately added for a short period of time to begin scanning, giving time to other devices that may be discovered immediately, and then after this time, adding preferentially if bluetooth, zigBee, and bluetooth low energy devices are present. After the addition is completed, WI-FI AP equipment is added.
When a plurality of WI-FI AP devices are added, if Bluetooth, zigBee and low-power consumption Bluetooth devices are found, after the addition of the WI-FI AP device is finished from the current WI-FI AP, the addition of the WI-FI AP device is suspended, and the addition of the Bluetooth, zigBee and low-power consumption Bluetooth devices is finished preferentially.
Based on the same inventive concept, the embodiment of the application also provides a device connection apparatus for implementing the above-mentioned related device connection method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiment of one or more device connection devices provided below may refer to the limitation of the device connection method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 6, there is provided a device connection apparatus including: a scanning module 601, a determining module 602 and a connecting module 603, wherein:
a scanning module 601, configured to scan for connectable devices to obtain a scanning result;
a determining module 602, configured to determine an overall connection order of the plurality of connectable devices if the scan result includes the plurality of connectable devices, and the plurality of connectable devices includes a device whose connection is a direct connection and a device whose connection is an indirect connection, where the overall connection order is determined based on the connection of the plurality of connectable devices, and the connection order of the device whose connection is a direct connection precedes the connection of the device whose connection is an indirect connection;
the connection module 603 is configured to connect the plurality of connectable devices according to an overall connection order.
In one embodiment, the apparatus further comprises an update module for:
scanning connectable equipment in real time, and updating the whole connection sequence based on the current connectable equipment under the condition that the current connectable equipment is scanned and the current equipment and the terminal are connected, so as to obtain the current whole connection sequence;
after the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order.
In one embodiment, the apparatus further comprises a timing module for:
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 first scanned device, the current connectable device is used as a waiting connection device, and the timer is used for timing from the moment of scanning to the waiting connection device;
and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices to be connected according to the current integral connection sequence.
In one embodiment, the apparatus further comprises a timing module for:
the connection order of the devices waiting to be connected is set to be the most preferable in the current overall connection order, and the devices waiting to be connected are prioritized to be connected.
In one embodiment, the apparatus further comprises an update module for:
if the connection mode of the current connectable equipment is indirect connection, determining the connection sequence of the current connectable equipment as equipment with the direct connection mode in the current integral connection sequence;
If the connection mode of the current connectable device is direct connection, determining the connection sequence of the current connectable device as the front of the device with the indirect connection mode in the current overall connection sequence.
In one embodiment, the manner of connection between the device and the terminal involved in the apparatus is determined based on the type of communication protocol employed when the device is connected to the terminal.
In one embodiment, the type of communication protocol used by the device directly connected to the terminal in the apparatus is any one of the following protocol types, where the following protocol types include bluetooth low energy, 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 combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above 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, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing the data of the connection communication protocol mode of the device. 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.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than 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 stored therein a computer program, the processor when executing the computer program performing the steps of:
scanning the connectable equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
the plurality of connectable devices are connected according to the 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 the whole connection sequence based on the current connectable equipment under the condition that the current connectable equipment is scanned and the current equipment and the terminal are connected, so as to obtain the current whole connection sequence;
after the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order.
In one embodiment, the processor when executing the computer program further performs the steps of:
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 first scanned device, the current connectable device is used as a waiting connection device, and the timer is used for timing from the moment of scanning to the waiting connection device;
and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices to be connected according to the current integral connection sequence.
In one embodiment, the processor when executing the computer program further performs the steps of:
the connection order of the devices waiting to be connected is set to be the most preferable in the current overall connection order, and the devices waiting to be connected are prioritized to be connected.
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 sequence of the current connectable equipment as equipment with the direct connection mode in the current integral connection sequence;
if the connection mode of the current connectable device is direct connection, determining the connection sequence of the current connectable device as the front of the device with the indirect connection mode in the current overall connection sequence.
In one embodiment, the processor when executing the computer program further performs the steps of: the manner of connection between the device and the terminal is determined based on the type of communication protocol employed when the device is connected to the terminal.
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 Bluetooth low energy, 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 equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
the plurality of connectable devices are connected according to the 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 the whole connection sequence based on the current connectable equipment under the condition that the current connectable equipment is scanned and the current equipment and the terminal are connected, so as to obtain the current whole connection sequence;
after the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order.
In one embodiment, the computer program when executed by the processor further performs the steps of:
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 first scanned device, the current connectable device is used as a waiting connection device, and the timer is used for timing from the moment of scanning to the waiting connection device;
and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices to be connected according to the current integral connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of:
the connection order of the devices waiting to be connected is set to be the most preferable in the current overall connection order, and the devices waiting to be connected are prioritized to be connected.
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 sequence of the current connectable equipment as equipment with the direct connection mode in the current integral connection sequence;
If the connection mode of the current connectable device is direct connection, determining the connection sequence of the current connectable device as the front of the device with the indirect connection mode in the current overall connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of: the manner of connection between the device and the terminal is determined based on the type of communication protocol employed when the device is connected to the terminal.
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 Bluetooth low energy, 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 equipment 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 and devices with indirect connection, 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 sequence of the devices with direct connection is the device with indirect connection prior to the connection mode;
The plurality of connectable devices are connected according to the 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 the whole connection sequence based on the current connectable equipment under the condition that the current connectable equipment is scanned and the current equipment and the terminal are connected, so as to obtain the current whole connection sequence;
after the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order.
In one embodiment, the computer program when executed by the processor further performs the steps of:
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 first scanned device, the current connectable device is used as a waiting connection device, and the timer is used for timing from the moment of scanning to the waiting connection device;
and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices to be connected according to the current integral connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of:
the connection order of the devices waiting to be connected is set to be the most preferable in the current overall connection order, and the devices waiting to be connected are prioritized to be connected.
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 sequence of the current connectable equipment as equipment with the direct connection mode in the current integral connection sequence;
if the connection mode of the current connectable device is direct connection, determining the connection sequence of the current connectable device as the front of the device with the indirect connection mode in the current overall connection sequence.
In one embodiment, the computer program when executed by the processor further performs the steps of: the manner of connection between the device and the terminal is determined based on the type of communication protocol employed when the device is connected to the terminal.
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 Bluetooth low energy, zigBee and WDS.
It should be noted that, user information (including but not limited to user equipment 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.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various 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 (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (9)

1. A device connection method, wherein the method is applied to a scenario in which a terminal is connected to a plurality of devices; the method comprises the following steps:
scanning the connectable equipment 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 sequence of the devices with direct connection modes is prior to the connection mode of the devices with indirect connection modes;
Connecting the plurality of connectable devices according to the overall connection order;
wherein after the plurality of connectable devices are connected according to the overall connection order, the method further comprises:
scanning connectable equipment in real time, and updating the integral connection order based on the current connectable equipment to obtain a current integral connection order under the condition that the current connectable equipment is scanned and the current equipment is connected with the terminal;
and after the equipment currently connected with the terminal is connected, connecting the currently connectable equipment according to the current integral connection sequence.
2. The method of claim 1, further comprising, after the scanning the connectable device in real time:
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 device which is scanned currently for the first time, the current connectable device is used as a waiting connection device, and the time is counted by a timer from the moment of scanning the waiting connection device;
and under the condition that the accumulated time length of the timer reaches the preset time length and the devices which are directly connected in the current integral connection sequence are connected, connecting the devices waiting for connection according to the current integral connection sequence.
3. The method of claim 2, wherein said connecting the waiting connection devices according to the current overall connection order comprises:
setting the connection sequence of the waiting connection equipment to be the most preferable in the current overall connection sequence, and preferentially connecting the waiting connection equipment.
4. The method of claim 1, wherein the updating the current overall connection order comprises:
if the connection mode of the current connectable equipment is indirect connection, determining the connection sequence of the current connectable equipment as equipment with a direct connection mode in the current overall connection sequence;
and if the connection mode of the current connectable equipment is direct connection, determining the connection sequence of the current connectable equipment as the front of the equipment with the indirect connection mode in the current integral connection sequence.
5. A method according to any of claims 1-4, characterized in that the connection between a device and the terminal is determined based on the type of communication protocol used when the device is connected to the terminal.
6. The method of claim 5, wherein the type of communication protocol employed by the device directly connected to the terminal is any one of the following protocol types, including bluetooth low energy, zigBee, and WDS.
7. A device connection apparatus, 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 includes a device whose connection manner is direct connection and a device whose connection manner is indirect connection, where the overall connection order is determined based on the connection manner of the plurality of connectable devices, and the connection manner is that of the directly connected device prior to the connection manner being that of the indirectly connected device;
the connection module is used for connecting the plurality of connectable devices according to the integral connection sequence;
an updating module for:
scanning connectable equipment in real time, and updating the whole connection sequence based on the current connectable equipment under the condition that the current connectable equipment is scanned and the current equipment and the terminal are connected, so as to obtain the current whole connection sequence;
after the device currently being connected with the terminal completes the connection, the currently connectable devices are connected according to the current overall connection order.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
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 CN114666779A (en) 2022-06-24
CN114666779B true 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 (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
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
CN114666779A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
US10715381B2 (en) Intelligent role selection for dual-role devices
CN111800462B (en) Micro service instance processing method, micro service instance processing device, computer equipment and storage medium
US9348858B2 (en) Methods and systems for dynamically changing contact information
CN109144232A (en) Process handling method and device, electronic equipment, computer readable storage medium
CN105844869A (en) Information prompting method and device
CN107844341B (en) Process starting control method and device, storage medium and mobile terminal
CN109582547A (en) Electronic device, monitoring data alarm method and storage medium
CN111047425A (en) Behavior prediction method and device
CN108605373A (en) Method for providing network share service and electronic device
CN112131015B (en) Information processing method and device, cloud server and storage medium
CN110008037A (en) Message treatment method, device and storage medium
CN103905595A (en) Contact person information displaying method and mobile terminal
CN107231620A (en) Wireless awakening equipment for cell module
CN110912990A (en) Method and related equipment for updating consensus period
WO2017206318A1 (en) Mobile device, and method and apparatus for sharing location thereof
CN114666779B (en) Device connection method, device, computer device, and storage medium
US20230206870A1 (en) Synchronous display blinking
CN107168648B (en) File storage method and device and terminal
CN109992369B (en) Application program processing method and device, electronic equipment and computer readable storage medium
US20150280933A1 (en) Electronic device and connection method thereof
CN115914375A (en) Disaster tolerance processing method and device for distributed message platform
CN114374614A (en) Network topology configuration method and device
CN107734715B (en) Network connection processing method of mobile terminal, storage device and mobile terminal
CN105282818A (en) Method for connecting wireless speaker to network and user terminal
CN108605070A (en) A kind of method and apparatus of management address list

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