[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113556715B - Device connection method and apparatus, computer readable medium and electronic device - Google Patents

Device connection method and apparatus, computer readable medium and electronic device Download PDF

Info

Publication number
CN113556715B
CN113556715B CN202110753573.1A CN202110753573A CN113556715B CN 113556715 B CN113556715 B CN 113556715B CN 202110753573 A CN202110753573 A CN 202110753573A CN 113556715 B CN113556715 B CN 113556715B
Authority
CN
China
Prior art keywords
priority
connectable
equipment
connection
information
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
CN202110753573.1A
Other languages
Chinese (zh)
Other versions
CN113556715A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110753573.1A priority Critical patent/CN113556715B/en
Publication of CN113556715A publication Critical patent/CN113556715A/en
Priority to PCT/CN2022/092781 priority patent/WO2023273639A1/en
Application granted granted Critical
Publication of CN113556715B publication Critical patent/CN113556715B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

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

Abstract

The disclosure provides a device connection method, a device connection apparatus, a computer readable medium and an electronic device, and relates to the technical field of wireless connection. The method comprises the following steps: reading the connection state of the connectable device in response to receiving a connection request sent by the first device; when the connection state is the connected state, reading second equipment information of a second equipment and first equipment information of a first equipment which are connected with the connectable equipment currently; the method includes determining a priority order of the first device and the second device for the connectable device based on the first device information and the second device information to determine a connection of the connectable device with the device to be connected. The present disclosure may enable automated connection between devices and connectable devices; meanwhile, the connection between the connectable equipment and the equipment to be connected can be determined according to the priority order, so that the problem of collision possibly occurring when the connectable equipment simultaneously has a plurality of equipment capable of establishing connection is avoided.

Description

设备连接方法及装置、计算机可读介质和电子设备Equipment connection methods and devices, computer-readable media and electronic equipment

技术领域Technical field

本公开涉及无线连接技术领域,具体涉及一种设备连接方法、设备连接装置、计算机可读介质和电子设备。The present disclosure relates to the field of wireless connection technology, and specifically relates to a device connection method, a device connection device, a computer-readable medium and an electronic device.

背景技术Background technique

随着科技的不断发展,越来越多的可连接设备可以通过无线的方式与终端设备连接。例如,在手机为可连接设备时,手机和电脑之间可以通过无线网络、蓝牙等方式建立连接,手机和手机之间则可以通过无线网络、蓝牙以及近场通信(Near FieldCommunication,NFC)等方式建立连接。With the continuous development of technology, more and more connectable devices can be connected to terminal devices wirelessly. For example, when a mobile phone is a connectable device, the connection between the mobile phone and the computer can be established through wireless network, Bluetooth, etc., and the connection between the mobile phone and the mobile phone can be established through wireless network, Bluetooth, Near Field Communication (NFC), etc. establish connection.

以蓝牙耳机为例,在相关技术中,终端设备连接蓝牙设备时,通常需要用户主动打开蓝牙设置界面,手动从蓝牙设置界面中显示的蓝牙配对列表中选择目标蓝牙设备进行配对。然而,这种连接方式主要依赖于用户的手段连接,操作较为繁琐。Taking Bluetooth headsets as an example, in related technologies, when a terminal device connects to a Bluetooth device, the user usually needs to actively open the Bluetooth settings interface and manually select the target Bluetooth device from the Bluetooth pairing list displayed in the Bluetooth settings interface for pairing. However, this connection method mainly relies on the user's means to connect, and the operation is relatively cumbersome.

发明内容Contents of the invention

本公开的目的在于提供一种设备连接方法、设备连接装置、计算机可读介质和电子设备,进而至少在一定程度上提高可连接设备连接的自动化程度,同时避免了可连接设备同时具有多个可以建立连接的设备时,可能出现的冲突问题。The purpose of the present disclosure is to provide a device connection method, a device connection device, a computer-readable medium and an electronic device, thereby improving the automation level of connectable device connection at least to a certain extent, while avoiding the possibility that the connectable device has multiple devices that can be connected at the same time. Conflict issues that may arise when establishing connected devices.

根据本公开的第一方面,提供一种设备连接方法,应用于可连接设备,包括:响应于接收到第一设备发送的连接请求,读取可连接设备的连接状态;在连接状态为已连接状态时,读取当前与可连接设备连接的第二设备的第二设备信息和第一设备的第一设备信息;基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接。According to a first aspect of the present disclosure, a device connection method is provided, which is applied to a connectable device, including: in response to receiving a connection request sent by a first device, reading the connection status of the connectable device; when the connection status is connected status, read the second device information of the second device currently connected to the connectable device and the first device information of the first device; determine based on the first device information and the second device information the first device and the second device for the connectable device. The priority order of connected devices to determine the connection between connectable devices and devices to be connected.

根据本公开的第二方面,提供一种设备连接装置,包括:状态读取模块,用于响应于接收到第一设备发送的连接请求,读取可连接设备的连接状态;设备读取模块,用于在连接状态为已连接状态时,读取当前与可连接设备连接的第二设备的第二设备信息和第一设备的第一设备信息;连接调整模块,用于基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接。。According to a second aspect of the present disclosure, a device connection device is provided, including: a status reading module, configured to read the connection status of a connectable device in response to receiving a connection request sent by the first device; the device reading module, Used to read the second device information of the second device currently connected to the connectable device and the first device information of the first device when the connection state is the connected state; the connection adjustment module is used to read the second device information of the second device currently connected to the connectable device and the connection adjustment module based on the first device information and The second device information determines the priority order of the first device and the second device with respect to the connectable device to determine the connection between the connectable device and the device to be connected. .

根据本公开的第三方面,提供一种计算机可读介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述的方法。According to a third aspect of the present disclosure, a computer-readable medium is provided, a computer program is stored thereon, and when the computer program is executed by a processor, the above method is implemented.

根据本公开的第四方面,提供一种电子设备,其特征在于,包括:处理器;以及存储器,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现上述的方法。According to a fourth aspect of the present disclosure, an electronic device is provided, characterized by comprising: a processor; and a memory for storing one or more programs, when the one or more programs are executed by the one or more processors , causing one or more processors to implement the above method.

本公开的一种实施例所提供的设备连接方法,在可连接设备接收到第一设备发送的连接请求时,读取可连接设备的连接状态,如果可连接设备已经与第二设备连接,即可连接设备处于已连接状态时,可以通过第一设备的第一设备信息和第二设备的第二设备信息确定第一设备和第二设备针对该可连接设备的优先顺序,来确定可连接设备与待连接设备的连接。通过第一设备和第二设备针对可连接设备的优先顺序,可以实现设备与可连接设备之间的自动化连接;同时,由于可以根据该优先顺序确定可连接设备与待连接设备的连接,因此避免了可连接设备同时具有多个可以建立连接的设备时,可能出现的冲突问题。A device connection method provided by an embodiment of the present disclosure reads the connection status of the connectable device when the connectable device receives a connection request sent by the first device. If the connectable device has been connected to the second device, that is, When the connectable device is in a connected state, the connectable device can be determined by determining the priority order of the first device and the second device for the connectable device through the first device information of the first device and the second device information of the second device. Connection to the device to be connected. Through the priority order of the first device and the second device for connectable devices, automatic connection between the device and the connectable device can be realized; at the same time, since the connection of the connectable device and the device to be connected can be determined according to the priority order, it is avoided Conflict issues that may arise when there are multiple devices that can establish connections at the same time.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.

附图说明Description of the drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts. In the attached picture:

图1示出了可以应用本公开实施例的一种示例性系统架构的示意图;Figure 1 shows a schematic diagram of an exemplary system architecture to which embodiments of the present disclosure may be applied;

图2示出了可以应用本公开实施例的一种电子设备的示意图;Figure 2 shows a schematic diagram of an electronic device to which embodiments of the present disclosure can be applied;

图3示意性示出本公开示例性实施例中一种设备连接方法的流程图;Figure 3 schematically shows a flow chart of a device connection method in an exemplary embodiment of the present disclosure;

图4示意性示出本公开示例性实施例中一种设备连接方法的示意图;Figure 4 schematically shows a schematic diagram of a device connection method in an exemplary embodiment of the present disclosure;

图5示意性示出本公开示例性实施例中一种配置第一优先级设备的交互示意图;Figure 5 schematically shows an interaction diagram for configuring a first priority device in an exemplary embodiment of the present disclosure;

图6示意性示出本公开示例性实施例中一种配置第二优先级设备的交互示意图;Figure 6 schematically shows an interaction diagram for configuring a second priority device in an exemplary embodiment of the present disclosure;

图7示意性示出本公开示例性实施例中另一种设备连接方法的示意图;Figure 7 schematically shows a schematic diagram of another device connection method in an exemplary embodiment of the present disclosure;

图8示意性示出本公开示例性实施例中一种设备连接装置的组成示意图;Figure 8 schematically shows the composition of a device connection device in an exemplary embodiment of the present disclosure;

图9示意性示出本公开示例性实施例中另一种设备连接装置的组成示意图。FIG. 9 schematically shows the composition of another device connection device in an exemplary embodiment of the present disclosure.

具体实施方式Detailed ways

现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concepts of the example embodiments. To those skilled in the art. The described features, structures or characteristics may be combined in any suitable manner in one or more embodiments.

此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices.

图1示出了可以应用本公开实施例的一种设备连接方法及装置的示例性应用环境的系统架构的示意图。FIG. 1 shows a schematic diagram of the system architecture of an exemplary application environment in which a device connection method and apparatus according to embodiments of the present disclosure can be applied.

如图1所示,系统架构100可以包括终端设备101、102、103中的一个或多个,网络104和可连接设备105、可连接设备106、可连接设备107中的一个或多个。网络104用以在终端设备101、102、103和可连接设备105、可连接设备106、可连接设备107之间提供通信链路的介质。网络104可以包括各种无线连接类型,例如wifi、蓝牙、NFC等等。终端设备101、102、103可以是各种具有无线连接功能的电子设备,包括但不限于台式计算机、便携式计算机、智能手机和平板电脑等等;可连接设备105、可连接设备106、可连接设备107可以包括各种可以通过无线连接功能与电子设备连接的可连接设备,例如,蓝牙耳机、无线鼠标、无线键盘等。应该理解,图1中的终端设备、网络和可连接设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和可连接设备。As shown in Figure 1, the system architecture 100 may include one or more of the terminal devices 101, 102, and 103, a network 104, and one or more of the connectable devices 105, 106, and 107. The network 104 is used as a medium for providing communication links between the terminal devices 101, 102, 103 and the connectable devices 105, 106, and 107. Network 104 may include various wireless connection types, such as wifi, Bluetooth, NFC, and so on. Terminal devices 101, 102, and 103 can be various electronic devices with wireless connection functions, including but not limited to desktop computers, portable computers, smart phones, tablets, etc.; connectable devices 105, 106, and 107 may include various connectable devices that can be connected to electronic devices through wireless connection functions, such as Bluetooth headsets, wireless mice, wireless keyboards, etc. It should be understood that the number of terminal devices, networks and connectable devices in Figure 1 is only illustrative. You can have any number of end devices, networks, and connectable devices depending on your implementation needs.

本公开实施例所提供的设备连接方法一般由可连接设备105、可连接设备106、可连接设备107执行,相应地,设备连接装置一般设置于可连接设备105、可连接设备106、可连接设备107中。但本领域技术人员容易理解的是,由于终端设备101、102、103具有无线连接功能,因此在一些实施例中,终端设备101、102、103也可以作为可连接设备,用于执行上述设备连接方法,相应的,设备连接装置也可以设置于终端设备101、102、103中,本示例性实施例中对此不做特殊限定。The device connection method provided by the embodiment of the present disclosure is generally executed by the connectable device 105, the connectable device 106, and the connectable device 107. Correspondingly, the device connection device is generally provided on the connectable device 105, the connectable device 106, and the connectable device. 107 in. However, those skilled in the art can easily understand that since the terminal devices 101, 102, and 103 have wireless connection functions, in some embodiments, the terminal devices 101, 102, and 103 can also be used as connectable devices for performing the above device connection. method, correspondingly, the device connection device can also be provided in the terminal devices 101, 102, and 103, which is not particularly limited in this exemplary embodiment.

本公开的示例性实施方式提供一种用于实现设备连接方法的电子设备,其可以是图1中的终端设备101、102、103或可连接设备105、可连接设备106、可连接设备107。该电子设备至少包括处理器和存储器,存储器用于存储处理器的可执行指令,处理器配置为经由执行可执行指令来执行设备连接方法。Exemplary embodiments of the present disclosure provide an electronic device for implementing a device connection method, which may be the terminal devices 101, 102, 103 or the connectable device 105, the connectable device 106, and the connectable device 107 in FIG. 1 . The electronic device at least includes a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the device connection method by executing the executable instructions.

下面以图2中的移动终端200为例,对电子设备的构造进行示例性说明。本领域技术人员应当理解,除了特别用于移动目的的部件之外,图2中的构造也能够应用于固定类型的设备。在另一些实施方式中,移动终端200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件、软件或软件和硬件的组合实现。各部件间的接口连接关系只是示意性示出,并不构成对移动终端200的结构限定。在另一些实施方式中,移动终端200也可以采用与图2不同的接口连接方式,或多种接口连接方式的组合。The following takes the mobile terminal 200 in FIG. 2 as an example to illustrate the structure of the electronic device. It will be understood by those skilled in the art that, in addition to components specifically intended for mobile purposes, the configuration in Figure 2 can also be applied to stationary type equipment. In other embodiments, the mobile terminal 200 may include more or fewer components than shown, or some components may be combined, or some components may be separated, or may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware. The interface connection relationships between the components are only schematically shown and do not constitute a structural limitation on the mobile terminal 200 . In other embodiments, the mobile terminal 200 may also adopt an interface connection method different from that shown in FIG. 2 , or a combination of multiple interface connection methods.

如图2所示,移动终端200具体可以包括:处理器210、内部存储器221、外部存储器接口222、通用串行总线(Universal Serial Bus,USB)接口230、充电管理模块240、电源管理模块241、电池242、天线1、天线2、移动通信模块250、无线通信模块260、音频模块270、扬声器271、受话器272、麦克风273、耳机接口274、传感器模块280、显示屏290、摄像模组291、指示器292、马达293、按键294以及用户标识模块(subscriber identification module,SIM)卡接口295等。其中传感器模块280可以包括深度传感器2801、压力传感器2802、陀螺仪传感器2803等。As shown in Figure 2, the mobile terminal 200 may specifically include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, Battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 271, receiver 272, microphone 273, headphone interface 274, sensor module 280, display screen 290, camera module 291, instructions 292, motor 293, button 294 and subscriber identification module (subscriber identification module, SIM) card interface 295, etc. The sensor module 280 may include a depth sensor 2801, a pressure sensor 2802, a gyroscope sensor 2803, etc.

处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(Application Processor,AP)、调制解调处理器、图形处理器(Graphics ProcessingUnit,GPU)、图像信号处理器(Image Signal Processor,ISP)、控制器、视频编解码器、数字信号处理器(Digital Signal Processor,DSP)、基带处理器和/或神经网络处理器(Neural-Network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor ( Image Signal Processor (ISP), controller, video codec, digital signal processor (Digital Signal Processor, DSP), baseband processor and/or neural network processor (Neural-Network Processing Unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.

处理器210中设置有存储器。存储器可以存储用于实现六个模块化功能的指令:检测指令、连接指令、信息管理指令、分析指令、数据传输指令和通知指令,并由处理器210来控制执行。The processor 210 is provided with a memory. The memory can store instructions for implementing six modular functions: detection instructions, connection instructions, information management instructions, analysis instructions, data transmission instructions, and notification instructions, and are controlled and executed by the processor 210.

移动终端200的无线通信功能可以通过天线1、天线2、移动通信模块250、无线通信模块260、调制解调处理器以及基带处理器等实现。其中,天线1和天线2用于发射和接收电磁波信号;移动通信模块250可以提供应用在移动终端200上的包括2G/3G/4G/5G等无线通信的解决方案;调制解调处理器可以包括调制器和解调器;无线通信模块260可以提供应用在移动终端200上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络)、蓝牙(Bluetooth,BT)等无线通信的解决方案。在一些实施例中,移动终端200的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得移动终端200可以通过无线通信技术与网络以及其他设备通信;此外,在一些实施例中,移动终端200还可以通过无线局域网、蓝牙等无线通信网络与其他设备通信。The wireless communication function of the mobile terminal 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor. Among them, antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals; the mobile communication module 250 can provide wireless communication solutions including 2G/3G/4G/5G applied to the mobile terminal 200; the modem processor can include Modulator and demodulator; the wireless communication module 260 can provide wireless local area networks (Wireless Local Area Networks, WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (Bluetooth) for use on the mobile terminal 200. , BT) and other wireless communication solutions. In some embodiments, the antenna 1 of the mobile terminal 200 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the mobile terminal 200 can communicate with the network and other devices through wireless communication technology; in addition, in some embodiments, , the mobile terminal 200 can also communicate with other devices through wireless communication networks such as wireless LAN and Bluetooth.

移动终端200通过GPU、显示屏290及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏290和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。在一些实施例中,可以在第一优先级设备中显示第二优先级设备和第三优先级设备,以对第二优先级设备进行调整。The mobile terminal 200 implements display functions through a GPU, a display screen 290, an application processor, and the like. The GPU is an image processing microprocessor and is connected to the display screen 290 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information. In some embodiments, the second priority device and the third priority device may be displayed among the first priority devices to make adjustments to the second priority device.

外部存储器接口222可以用于连接外部存储卡,例如Micro SD卡,实现扩展移动终端200的存储能力。外部存储卡通过外部存储器接口222与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile terminal 200 . The external memory card communicates with the processor 210 through the external memory interface 222 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.

内部存储器221可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储移动终端200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(Universal Flash Storage,UFS)等。处理器210通过运行存储在内部存储器221的指令和/或存储在设置于处理器中的存储器的指令,执行移动终端200的各种功能应用以及数据处理。Internal memory 221 may be used to store computer executable program code, which includes instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area may store data created during use of the mobile terminal 200 (such as audio data, phone book, etc.). In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the mobile terminal 200 by executing instructions stored in the internal memory 221 and/or instructions stored in a memory provided in the processor.

移动终端200可以通过音频模块270、扬声器271、受话器272、麦克风273、耳机接口274及应用处理器等实现音频功能。例如音乐播放、录音等。The mobile terminal 200 can implement audio functions through the audio module 270, the speaker 271, the receiver 272, the microphone 273, the headphone interface 274, and the application processor. For example, music playback, recording, etc.

深度传感器2801用于获取景物的深度信息。压力传感器2802用于感受压力信号,可以将压力信号转换成电信号。陀螺仪传感器2803可以用于确定移动终端200的运动姿态。此外,还可以根据实际需要在传感器模块280中设置其他功能的传感器,例如气压传感器、磁传感器、加速度传感器、距离传感器、接近光传感器、指纹传感器、温度传感器、触摸传感器、环境光传感器、骨传导传感器等。The depth sensor 2801 is used to obtain depth information of the scene. The pressure sensor 2802 is used to sense the pressure signal and convert the pressure signal into an electrical signal. The gyro sensor 2803 may be used to determine the motion posture of the mobile terminal 200 . In addition, sensors with other functions can also be set in the sensor module 280 according to actual needs, such as air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor, and bone conduction. Sensors etc.

移动终端200中还可包括其它提供辅助功能的设备。例如,按键294包括开机键,音量键等,用户可以通过按键输入,产生与移动终端200的用户设置以及功能控制有关的键信号输入。再如,指示器292、马达293、SIM卡接口295等。The mobile terminal 200 may also include other devices that provide auxiliary functions. For example, the keys 294 include a power key, a volume key, etc., and the user can input key signals to generate key signal input related to user settings and function control of the mobile terminal 200 . Another example is the indicator 292, the motor 293, the SIM card interface 295, etc.

在与无线连接相关的技术中,其主要的研究方向通常有两种:一种是设备连接、断开的智能化。例如,降低蓝牙设备在连接、断开时的耗时,确保用户在使用蓝牙设备的体验感;另一种是设备连接的安全性。例如,蓝牙设备的数据交互过程中的安全性,确保蓝牙传送数据的安全性和可靠性。Among technologies related to wireless connections, there are usually two main research directions: one is the intelligence of device connection and disconnection. For example, reducing the time it takes for Bluetooth devices to connect and disconnect to ensure users’ experience when using Bluetooth devices; the other is the security of device connections. For example, the security during the data interaction process of Bluetooth devices ensures the security and reliability of data transmitted by Bluetooth.

然而,这两种研究方向均没有考虑到以下情况:以蓝牙设备为可连接设备为例,假设用户使用的蓝牙设备(例如蓝牙耳机)连接过终端设备A,那么当下一次打开蓝牙设备时,其会优先和终端设备A相连接;但此时若终端设备B想连接蓝牙设备,则会发现蓝牙设备已经被终端设备A连接,从而终端设备B无法连接;假设蓝牙设备和终端设备B在我们手中,此时想让两者连接只有两个办法:(1)找到连接蓝牙设备的终端设备A,再其上面断开与蓝牙设备的连接(2)将终端设备B和蓝牙设备拿到远离终端设备A的地方,然后再进行连接。然而,上述两种方式均依赖于用户的手动操作,操作复杂且耗时较长。However, these two research directions do not take into account the following situation: taking a Bluetooth device as a connectable device as an example, assuming that the Bluetooth device (such as a Bluetooth headset) used by the user has been connected to terminal device A, then the next time the Bluetooth device is turned on, its Will give priority to connecting to terminal device A; but if terminal device B wants to connect to a Bluetooth device at this time, it will find that the Bluetooth device has been connected to terminal device A, so terminal device B cannot connect; assuming that the Bluetooth device and terminal device B are in our hands , there are only two ways to connect the two: (1) Find the terminal device A connected to the Bluetooth device, and then disconnect the Bluetooth device from it (2) Move the terminal device B and the Bluetooth device away from the terminal device A, and then connect. However, the above two methods both rely on the user's manual operation, which is complex and time-consuming.

基于上述一个或多个问题,本示例实施方式提供了一种设备连接方法。该设备连接方法可以应用于上述可连接设备105、106、107中的一个或多个,也可以应用于终端设备101、102、103中的一个或多个,本示例性实施例中对此不做特殊限定。参考图3所示,该设备连接方法可以包括以下步骤S310至S330:Based on one or more of the above problems, this example implementation provides a device connection method. This device connection method can be applied to one or more of the above-mentioned connectable devices 105, 106, and 107, and can also be applied to one or more of the terminal devices 101, 102, and 103. This is not the case in this exemplary embodiment. Make special restrictions. Referring to Figure 3, the device connection method may include the following steps S310 to S330:

在步骤S310中,响应于接收到第一设备发送的连接请求,读取可连接设备的连接状态。In step S310, in response to receiving the connection request sent by the first device, the connection status of the connectable device is read.

其中,可连接设备包括可以通过任意一种无线连接方式与其他设备进行连接的设备。例如,蓝牙耳机可以通过蓝牙这种无线连接方式与手机、平板电脑、电脑等设备实现连接。Among them, connectable devices include devices that can be connected to other devices through any wireless connection method. For example, Bluetooth headsets can be connected to mobile phones, tablets, computers and other devices through Bluetooth wireless connection.

其中,第一设备包括可以通过可连接设备对应的无线连接方式与可连接设备建立连接的设备,例如,可连接设备为可以通过wifi方式进行连接的设备,那么第一设备则为可以通过wifi方式与可连接设备建立连接的设备。The first device includes a device that can establish a connection with the connectable device through a wireless connection method corresponding to the connectable device. For example, if the connectable device is a device that can be connected through wifi, then the first device is a device that can be connected through wifi. A device that establishes a connection with a connectable device.

其中,连接请求包括第一设备发送的,与可连接设备对应的无线连接方式一致的连接请求。例如,可连接设备对应的无线连接方式为蓝牙,则第一设备发送的连接请求则是蓝牙连接请求。The connection request includes a connection request sent by the first device that is consistent with the wireless connection mode corresponding to the connectable device. For example, if the wireless connection mode corresponding to the connectable device is Bluetooth, then the connection request sent by the first device is a Bluetooth connection request.

其中,可连接设备的连接状态包括可连接设备对应的无线连接方式在第一设备发送连接请求时的是否与设备连接的状态。例如,在上例中,第一设备在当前时刻发送了蓝牙连接请求时,可连接设备对应的连接状态即为可连接设备在当前时刻,是否通过蓝牙的方式建立连接。Wherein, the connection status of the connectable device includes the status of whether the wireless connection mode corresponding to the connectable device is connected to the device when the first device sends the connection request. For example, in the above example, when the first device sends a Bluetooth connection request at the current moment, the connection status corresponding to the connectable device is whether the connectable device establishes a connection through Bluetooth at the current moment.

此外,可连接设备与设备之间的连接模式可以是一对一、一对多、多对多等模式。其中,一对多和多对多模式是指同一可连接设备可以有多个备选的设备进行连接,同一个设备也可以和多个可连接设备连接。In addition, the connection mode between connectable devices can be one-to-one, one-to-many, many-to-many, etc. Among them, one-to-many and many-to-many modes mean that the same connectable device can be connected to multiple alternative devices, and the same device can also be connected to multiple connectable devices.

在步骤S320中,在连接状态为已连接状态时,读取当前与可连接设备连接的第二设备的第二设备信息和第一设备的第一设备信息。In step S320, when the connection state is the connected state, the second device information of the second device currently connected to the connectable device and the first device information of the first device are read.

其中,第二设备包括可以通过可连接设备对应的无线连接方式与可连接设备建立连接的设备,例如,可连接设备为可以通过wifi方式进行连接的设备,那么第二设备则为可以通过wifi方式与可连接设备建立连接的设备。需要说明的是,在可连接设备可以通过多种方式连接时,若第一设备发送了连接方式1对应的连接请求,对应的连接状态也为该连接方式1的连接状态,那么获取的第二设备也为发送连接请求时,通过该连接方式1与可连接设备连接的第二设备。例如,某一可连接设备可以通过蓝牙和wifi方式与其他设备建立连接,若第一设备发送的连接请求为蓝牙方式对应的连接请求,那么第二设备则为当前与可连接设备通过蓝牙建立连接的设备。The second device includes a device that can establish a connection with the connectable device through a wireless connection method corresponding to the connectable device. For example, if the connectable device is a device that can be connected through wifi, then the second device can be connected through wifi. A device that establishes a connection with a connectable device. It should be noted that when a connectable device can be connected in multiple ways, if the first device sends a connection request corresponding to connection mode 1, and the corresponding connection status is also the connection status of connection mode 1, then the second obtained The device is also the second device that connects to the connectable device through this connection method 1 when sending a connection request. For example, a certain connectable device can establish connections with other devices through Bluetooth and wifi. If the connection request sent by the first device is a connection request corresponding to Bluetooth, then the second device will establish a connection with the connectable device through Bluetooth. device of.

其中,第一设备信息和第二设备信息可以包括能够准确确定第一设备的信息,即可连接设备可以通过设备信息准确确定一个唯一的设备。The first device information and the second device information may include information that can accurately determine the first device, that is, the connected device can accurately determine a unique device through the device information.

在步骤S330中,基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接。In step S330, the priority order of the first device and the second device with respect to the connectable devices is determined based on the first device information and the second device information to determine the connection between the connectable device and the device to be connected.

其中,待连接设备可以包括第一设备或第二设备,即确定优先顺序后,可以确定可连接设备与第一设备或第二设备连接。The device to be connected may include a first device or a second device. That is, after determining the priority order, it may be determined that the connectable device is connected to the first device or the second device.

在一示例性实施例中,在确定了当前已经与可连接设备建立连接的第二设备之后,可以根据第一设备的第一设备信息和第二设备的第二设备信息确定第一设备和第二设备针对该可连接设备的优先顺序,进而确定该可连接设备与待连接设备的连接。例如,可以针对历史每个与可连接设备建立连接的设备设置对应的优先顺序,进而在存在第一设备发送的连接请求时,可以根据连接请求携带的第一设备对应的第一设备信息和当前连接的第二设备的第二设备信息确定第一设备和第二设备的优先顺序,进而根据优先顺序确定可连接设备与第一设备或第二设备的连接。In an exemplary embodiment, after determining the second device that has currently established a connection with the connectable device, the first device and the second device may be determined based on the first device information of the first device and the second device information of the second device. The two devices prioritize the connectable device and then determine the connection between the connectable device and the device to be connected. For example, a corresponding priority can be set for each device that has established a connection with a connectable device in history. Then, when there is a connection request sent by the first device, the first device information corresponding to the first device carried in the connection request and the current The second device information of the connected second device determines the priority of the first device and the second device, and further determines the connection between the connectable device and the first device or the second device according to the priority.

需要说明的是,在确定可连接设备与第一设备或第二设备的连接时,如果优先顺序为越靠前越优先,则可以通过确定可连接设备与待连接设备的连接,保证可连接设备始终保持与优先顺序靠前的设备建立连接。具体的,假设第一设备的优先顺序在第二设备之前,则可以断开第一设备与可连接设备之间的连接,建立与第二设备之间的连接;假设第一设备的优先顺序在第二设备之后,则可以保持可连接设备与第二设备之间的连接。It should be noted that when determining the connection between the connectable device and the first device or the second device, if the priority order is the higher the priority, the connectable device can be ensured by determining the connection between the connectable device and the device to be connected. Always maintain a connection to the device with the highest priority. Specifically, assuming that the priority of the first device is before the second device, you can disconnect the first device from the connectable device and establish a connection with the second device; assuming that the priority of the first device is before After the second device, the connection between the connectable device and the second device can be maintained.

在一示例性实施例中,除了上述针对每个设备设置优先顺序以外,还可以设置预设数量的优先级,每个优先级对应至少一个该优先级对应的优先级设备,并按照优先级的顺序确定优先级设备的优先顺序。例如,假设可以设置3个优先级,分别为优先级A、优先级B和优先级C,每一优先级可以对应至少一个优先级设备。如,优先级A设备、优先级B设备和优先级C设备,在优先级的顺序为优先级A、优先级B、优先级C时,优先级设备的优先顺序即为优先级A设备、优先级B设备、优先级C设备。In an exemplary embodiment, in addition to setting the priority order for each device as described above, a preset number of priorities can also be set. Each priority level corresponds to at least one priority device corresponding to the priority level, and according to the priority level, The order determines the order in which priority devices are prioritized. For example, assume that three priorities can be set, namely priority A, priority B and priority C. Each priority level can correspond to at least one priority device. For example, if priority A equipment, priority B equipment and priority C equipment are in the priority order of priority A, priority B and priority C, the priority order of priority equipment is priority A equipment, priority level equipment. Class B equipment, priority C equipment.

在一示例性实施例中,在基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接时,若第二设备为第一优先级设备(第一优先级设备的优先顺序是所有优先级设备中最优先的)时,由于第二设备为第一优先级设备,因此其他所有设备的优先级均低于该第二设备,此时可以拒绝第一设备对应的连接请求,并保持可连接设备与第二设备之间的连接。In an exemplary embodiment, when determining the priority order of the first device and the second device with respect to the connectable devices based on the first device information and the second device information to determine the connection between the connectable device and the device to be connected, if the first device When the second device is the first priority device (the priority of the first priority device is the highest priority among all priority devices), since the second device is the first priority device, the priority of all other devices is lower than The second device can reject the connection request corresponding to the first device and maintain the connection between the connectable device and the second device.

需要说明的是,由于第一优先级设备为优先顺序最优先的设备,即可连接设备对应的第一优先级设备对可连接设备具有绝对连接权,因此在某一设备同一时间通过某一连接方式只能连接N个可连接设备时,为了避免绝对连接权之间的冲突,第一优先级设备的数量通常等于N。例如,假设某一手机在同一时间通过蓝牙的方式仅可连接一个蓝牙设备(可连接设备),则通常情况下第一优先级设备仅有1个;再如,假设无线路由器为可连接设备,在物联网的架构中,无线路由器可以通过wifi同时与3个家用电器相连,因此,可以设置无线路由器对应的第一优先级设备数量为3。需要说明的是,在一些实施例中,在可连接设备对应的第一优先级设备为多个时,多个可连接设备可以是相同类型的设备,例如,上例中无线路由可以同时连接3台空调;也可以是不同类型的设备,例如,一台空调、一台电视、一个智能门锁,本公开对此不做特殊限定。It should be noted that since the first priority device is the device with the highest priority, the first priority device corresponding to the connectable device has absolute connection rights to the connectable device. Therefore, a certain device can connect through a certain connection at the same time. When the method can only connect N connectable devices, in order to avoid conflicts between absolute connection rights, the number of first priority devices is usually equal to N. For example, assuming that a mobile phone can only connect to one Bluetooth device (connectable device) through Bluetooth at the same time, there is usually only one first priority device; for another example, assuming that the wireless router is a connectable device, In the architecture of the Internet of Things, the wireless router can be connected to 3 household appliances at the same time through WiFi. Therefore, the number of first priority devices corresponding to the wireless router can be set to 3. It should be noted that in some embodiments, when there are multiple first priority devices corresponding to connectable devices, the multiple connectable devices may be devices of the same type. For example, in the above example, the wireless router may connect 3 devices at the same time. An air conditioner; it can also be different types of equipment, such as an air conditioner, a TV, and a smart door lock, which is not specifically limited in this disclosure.

在一示例性实施例中,在基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接时,若第二设备为第二优先级设备(第二优先级设备的优先顺序低于第一优先级设备)时,即可能存在优先顺序高于第二设备的设备。此时,在第一设备为第一优先级设备时,可以断开可连接设备与第二设备之间的连接,并建立第一设备与可连接设备之间的连接;而在第一设备的优先顺序低于第二优先级设备,或者第一设备也为第二优先级设备时,可以拒绝连接请求并保持可连接设备与第二设备之间的连接。In an exemplary embodiment, when determining the priority order of the first device and the second device with respect to the connectable devices based on the first device information and the second device information to determine the connection between the connectable device and the device to be connected, if the first device When the second device is a second priority device (the second priority device has a lower priority than the first priority device), there may be a device with a higher priority than the second device. At this time, when the first device is the first priority device, the connection between the connectable device and the second device can be disconnected, and the connection between the first device and the connectable device can be established; while on the first device When the priority is lower than that of the second priority device, or the first device is also a second priority device, the connection request can be rejected and the connection between the connectable device and the second device can be maintained.

在一示例性实施例中,在基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接时,若第二设备为第三优先级设备(第三优先级设备的优先顺序低于第一优先级设备和第二优先级设备、第二优先级设备的优先顺序低于第一优先级设备)时,如果第一设备为第一优先级设备或第二优先级设备时,可以断开可连接设备与第二设备之间的连接,并建立第一设备与可连接设备之间的连接;如果第一设备为第三优先级设备时,则可以拒绝连接请求并保持可连接设备与第二设备之间的连接。In an exemplary embodiment, when determining the priority order of the first device and the second device with respect to the connectable devices based on the first device information and the second device information to determine the connection between the connectable device and the device to be connected, if the first device When the second device is a third-priority device (the third-priority device has a lower priority than the first-priority device and the second-priority device, and the second-priority device has a lower priority than the first-priority device), if When the first device is a first priority device or a second priority device, the connection between the connectable device and the second device can be disconnected, and the connection between the first device and the connectable device can be established; if the first device When it is a third priority device, the connection request can be rejected and the connection between the connectable device and the second device can be maintained.

需要说明的是,优先顺序最低的设备,通常情况下即为除了优先顺序在先的设备之外的所有设备。例如,在上述实施例中,可以在可连接设备中建立第一优先级设备对应的设备信息清单以及第二优先级设备对应的设备信息清单。此时,若某一设备发送的连接请求中携带的设备信息既不属于第一优先级设备对应的设备清单数据,也不属于第二优先级设备对应的设备清单数据,则可以将该设备划分为第三优先级设备。此外,根据优先顺序的划分数量,可以始终将优先顺序最低的一级设置为除了优先顺序在先的设备之外的所有设备。It should be noted that the device with the lowest priority is usually all devices except the device with the highest priority. For example, in the above embodiment, a device information list corresponding to the first priority device and a device information list corresponding to the second priority device can be established in the connectable device. At this time, if the device information carried in the connection request sent by a certain device does not belong to the device list data corresponding to the first priority device or the device list data corresponding to the second priority device, the device can be classified It is the third priority device. Additionally, depending on the number of priority divisions, the lowest priority level can always be set to all but the device with the highest priority.

此外,由于优先顺序最高级别通常有数量限制,而优先顺序最低的设备,通常情况下即为除了优先顺序在先的设备之外的所有设备,因此若需要设置三级以上的优先级时,可以通过对第二优先级设备进行进一步分级的方式实现。例如,若需设置4个优先级,则优先顺序可以是第一优先级设备,第二优先级设备1组,第二优先级设备2组,第三优先级设备。在这种情况下,可以通过向不同组的第二优先级设备配置不同的验证方法实现对不同组的管理,确定可连接设备与待连接设备的连接时,仍然遵从上述优先顺序较高可以抢夺优先顺序较低设备的连接权,优先顺序相同时,后连接的设备无法抢夺先连接的设备的连接权的规则。In addition, since the highest level of priority usually has a limited number, and the device with the lowest priority is usually all devices except the device with the first priority, so if you need to set a priority of three or more levels, you can This is achieved by further grading the second priority devices. For example, if 4 priorities need to be set, the priority order can be the first priority device, 1 group of second priority devices, 2 groups of second priority devices, and the third priority device. In this case, you can manage different groups by configuring different verification methods for second-priority devices in different groups. When determining the connection between the connectable device and the device to be connected, the higher priority still follows the above order and can be snatched. The device with lower priority has the right to connect. If the priority is the same, the device connected later cannot seize the right to connect from the device connected first.

在一示例性实施例中,在确定第一设备和第二设备针对可连接设备的优先顺序之前,可以在历史上每个设备连接该可连接设备时对设备的优先顺序进行设置。In an exemplary embodiment, before determining the priority order of the first device and the second device for the connectable device, the priority order of the devices may be set when each device historically connects to the connectable device.

具体的,在第三设备与可连接设备建立连接,且第三设备通过可连接设备对应的第一优先级验证时,将第三设备对应的第三设备信息保存为可连接设备对应的第一优先级设备。其中,第一优先级验证可以包括多种密码验证,也可以包括其他验证方式,例如可以通过指示第三设备执行相应的操作进行验证,本公开对此不做特殊限定。Specifically, when the third device establishes a connection with the connectable device and the third device passes the first priority verification corresponding to the connectable device, the third device information corresponding to the third device is saved as the first priority corresponding to the connectable device. Priority device. The first priority verification may include multiple password verifications or other verification methods. For example, verification may be performed by instructing a third device to perform corresponding operations. This disclosure does not specifically limit this.

此外,确定了可连接设备对应的第一优先级设备之后,可以通过第一优先级设备发送授权数据的方式对第二优先级设备进行调整,即增加或减少第二优先级设备。其中,授权数据可以包括将要成为第二优先级设备的设备信息。具体的,在可连接设备接收到授权数据时,可以存储该设备信息至第二优先级设备对应的清单中或者在第二优先级设备对应的清单中将该设备信息删除,以实现对第二优先级设备的调整。In addition, after determining the first priority device corresponding to the connectable device, the second priority device can be adjusted by sending authorization data from the first priority device, that is, adding or subtracting the second priority device. The authorization data may include device information that will become the second priority device. Specifically, when the connectable device receives the authorization data, the device information can be stored in the list corresponding to the second priority device or the device information can be deleted in the list corresponding to the second priority device to realize the second priority. Adjustment of priority devices.

在另一示例性实施例中,在增加第二优先级设备时,还可以通过验证数据的方式实现。具体的,在用户需要将第四设备设置为第二优先级设备时,可以先使第四设备建立与第一优先级设备之间的连接,第一优先级设备可以根据该设备构建符合第四设备的验证数据发送至该设备,然后在第四设备与可连接设备建立连接后,将第四设备信息和验证数据一起发送至可连接设备,可连接设备对验证数据进行第二优先级验证,在验证通过时,可以将第四设备对应的第四设备信息保存至可连接设备的第二优先级设备对应的清单中,即第四设备成为第二优先级设备。其中,验证数据是第一优先级设备与第四设备建立连接时,授权第四设备可以作为第二优先级设备所发送的一种授权数据。In another exemplary embodiment, when adding a second priority device, it can also be implemented by verifying data. Specifically, when the user needs to set the fourth device as a second priority device, the fourth device can first establish a connection with the first priority device, and the first priority device can construct a connection according to the fourth device based on the device. The verification data of the device is sent to the device, and then after the fourth device establishes a connection with the connectable device, the fourth device information and the verification data are sent to the connectable device, and the connectable device performs a second priority verification on the verification data, When the verification is passed, the fourth device information corresponding to the fourth device can be saved into a list corresponding to the second priority device of the connectable device, that is, the fourth device becomes the second priority device. The verification data is a kind of authorization data sent by authorizing the fourth device as the second priority device when the first priority device establishes a connection with the fourth device.

在一示例性实施例中,若在第一设备发送连接请求时,可连接设备未与其他设备建立连接,此时,无论第一设备的优先顺序如何,均可以直接建立与可连接设备之间的连接。In an exemplary embodiment, if the connectable device does not establish a connection with other devices when the first device sends a connection request, at this time, regardless of the priority of the first device, the connection with the connectable device can be directly established. Connection.

以下以蓝牙耳机为可连接设备,手机为需要与蓝牙耳机建立连接的设备,对本公开实施例的技术方案进行详细阐述。The technical solutions of the embodiments of the present disclosure are described in detail below, taking a Bluetooth headset as a connectable device and a mobile phone as a device that needs to establish a connection with the Bluetooth headset.

假设一作为可连接设备的蓝牙耳机,在不同时刻可以分别连接不同的手机,但是在同一时刻只能连接一个手机。参照图4所示,蓝牙耳机可以将手机分为三个优先级,优先顺序为第一优先级设备、第二优先级设备、第三优先级设备。其中第一优先级设备只有1个,具有绝对控制权;第二优先级设备可以有多个,具有相对控制权;第三优先级设备也可以有多个,无控制权。Assume that a Bluetooth headset as a connectable device can connect to different mobile phones at different times, but can only connect to one mobile phone at the same time. Referring to Figure 4, the Bluetooth headset can divide the mobile phone into three priorities. The priority order is the first priority device, the second priority device, and the third priority device. There is only one first-priority device with absolute control rights; there can be multiple second-priority devices with relative control rights; there can also be multiple third-priority devices with no control rights.

在第一优先级设备只有1个的情况下,绝对控制权包括:无论蓝牙耳机当前是否与其他手机连接,只要第一优先级设备发送了连接请求,即可以建立连接。同时,第一优先级设备还可以授权第三优先级设备变为第二优先级设备,或者将第二优先级设备降级为第三优先级设备;此外,该设备可以与蓝牙设备进行交互连接,获取蓝牙设备的相关数据信息。When there is only one first-priority device, absolute control includes: Regardless of whether the Bluetooth headset is currently connected to other mobile phones, as long as the first-priority device sends a connection request, a connection can be established. At the same time, the first priority device can also authorize the third priority device to become a second priority device, or downgrade the second priority device to a third priority device; in addition, the device can interact with the Bluetooth device, Get relevant data information of Bluetooth devices.

第二优先级设备的相对控制权包括:该设备正常和蓝牙耳机进行连接,若蓝牙耳机已经和优先顺序低于第二优先级设备的设备连接,该设备可以通过与蓝牙耳机进行秘钥通信,来获取蓝牙耳机的控制权,从而完成与蓝牙设备的连接。The relative control rights of the second priority device include: the device is normally connected to the Bluetooth headset. If the Bluetooth headset is already connected to a device with a lower priority than the second priority device, the device can communicate with the Bluetooth headset through a secret key. to obtain control of the Bluetooth headset to complete the connection with the Bluetooth device.

第三优先级设备无控制权是指,该设备正常和蓝牙设备进行连接,若蓝牙设备已经和其他终端设备连接,该设备无法和蓝牙设备连接。The third priority device has no control rights. It means that the device is connected to the Bluetooth device normally. If the Bluetooth device is already connected to other terminal devices, the device cannot connect to the Bluetooth device.

此外,蓝牙耳机也具有和手机进行通信,同时保存各个优先级设备名单,以便于在收到连接请求时,可以根据连接请求中携带的设备信息确定该设备对应的优先级。In addition, the Bluetooth headset also communicates with the mobile phone and saves a list of each priority device so that when a connection request is received, the corresponding priority of the device can be determined based on the device information carried in the connection request.

参照图5所示,作为第一优先级设备的手机1,在确定其为第一优先级设备时的交互如下:Referring to Figure 5 , when mobile phone 1 is determined to be the first priority device, the interaction is as follows:

步骤S501,蓝牙耳机等时间对外发送广播;Step S501: The Bluetooth headset waits for time to send external broadcasts;

步骤S503,手机1收到广播后发送连接请求,以建立与蓝牙耳机之间的连接;Step S503: After receiving the broadcast, mobile phone 1 sends a connection request to establish a connection with the Bluetooth headset;

步骤S505,用户在手机1上进行第一优先级验证,并在验证通过后向蓝牙耳机发送第一优先级设备申请;Step S505, the user performs first priority verification on mobile phone 1, and after passing the verification, sends a first priority device application to the Bluetooth headset;

步骤S507,蓝牙耳机接收手机1对应的第一设备信息,并将其以JSON格式保存至第一优先级设备清单中;Step S507: The Bluetooth headset receives the first device information corresponding to the mobile phone 1 and saves it in the first priority device list in JSON format;

步骤S509,蓝牙耳机将自身信息以JSON格式发送至手机1,以使手机1进行保存。Step S509: The Bluetooth headset sends its own information to mobile phone 1 in JSON format so that mobile phone 1 can save it.

参照图6所示,作为第二优先级设备的手机2,在确定其为第二优先级设备时的交互如下:Referring to Figure 6 , when mobile phone 2 is determined to be a second priority device, the interaction is as follows:

步骤S601,手机2建立与手机1之间的通信连接;Step S601, mobile phone 2 establishes a communication connection with mobile phone 1;

步骤S603,手机1向手机2发送授权申请(手机2确认是否要成为第二优先级设备);Step S603: Mobile phone 1 sends an authorization application to mobile phone 2 (mobile phone 2 confirms whether it wants to become a second priority device);

步骤S605,手机2同意后,向手机1发送手机2的第二设备信息;Step S605: After mobile phone 2 agrees, it sends the second device information of mobile phone 2 to mobile phone 1;

步骤S607,手机1根据手机2的第二设备信息来构建相应的秘钥传送给手机2;Step S607: Mobile phone 1 constructs a corresponding secret key based on the second device information of mobile phone 2 and sends it to mobile phone 2;

步骤S609,手机2向蓝牙耳机发送连接请求,以建立与蓝牙耳机之间的连接;Step S609: Mobile phone 2 sends a connection request to the Bluetooth headset to establish a connection with the Bluetooth headset;

步骤S611,手机2向蓝牙耳机发送秘钥和第二设备信息;Step S611, mobile phone 2 sends the secret key and second device information to the Bluetooth headset;

步骤S613,蓝牙耳机收到秘钥后进行第二优先级验证,在通过验证后,将手机2的第二设备信息保存至第二优先级设备清单中。Step S613: After receiving the secret key, the Bluetooth headset performs second priority verification. After passing the verification, the second device information of mobile phone 2 is saved in the second priority device list.

其中,手机的设备信息可以包括MAC地址、IMEI、版本信息、序列号等相关硬件信息。需要说明的是,在进行上述交互之前,蓝牙耳机均处于未连接状态;第三优先级设备为本实施例中优先顺序最低的设备,即除了第一优先级设备和第二优先级设备之外的设备均为第三优先级设备。Among them, the device information of the mobile phone may include MAC address, IMEI, version information, serial number and other related hardware information. It should be noted that before the above interaction, the Bluetooth headsets are in an unconnected state; the third priority device is the device with the lowest priority in this embodiment, that is, in addition to the first priority device and the second priority device The devices are all third priority devices.

在完成上述过程后,蓝牙耳机中存储有第一优先级设备清单和第二优先级设备清单,假设手机3为第三优先级设备。After completing the above process, the first priority device list and the second priority device list are stored in the Bluetooth headset. It is assumed that mobile phone 3 is the third priority device.

参照图7所示,对于手机3,当其向蓝牙耳机发送连接请求时,若蓝牙耳机处于未连接状态,则手机3可以与蓝牙耳机正常建立连接关系;若蓝牙耳机已经和其他设备建立连接,则手机只能等待蓝牙耳机空闲。Referring to Figure 7, for mobile phone 3, when it sends a connection request to the Bluetooth headset, if the Bluetooth headset is not connected, the mobile phone 3 can normally establish a connection relationship with the Bluetooth headset; if the Bluetooth headset has established a connection with other devices, Then the phone can only wait for the Bluetooth headset to be idle.

若手机3已经和蓝牙耳机建立连接,那么当手机2需要连接时,手机2会向蓝牙耳机发送连接请求,蓝牙耳机收到连接请求后,根据连接请求中携带的第二设备信息确定手机2的优先顺序。假设手机2的第二设备信息并不在蓝牙耳机存储的清单中,则直接拒绝手机2的连接请求;若找到第二设备信息(无论是在第一优先级设备清单中还是在第二优先级设备清单中,优先级均高于手机3对应的第三优先级设备),则向手机3发送提示信息,然后断开与手机3的连接,准备建立与从终端设备的连接;这样,从终端设备就从次终端设备手中抢夺了蓝牙耳机的“控制权”。If mobile phone 3 has established a connection with the Bluetooth headset, then when mobile phone 2 needs to connect, mobile phone 2 will send a connection request to the Bluetooth headset. After receiving the connection request, the Bluetooth headset will determine the location of mobile phone 2 based on the second device information carried in the connection request. Prioritize. Assuming that the second device information of mobile phone 2 is not in the list stored in the Bluetooth headset, the connection request of mobile phone 2 is directly rejected; if the second device information is found (whether in the first priority device list or the second priority device In the list, the priority is higher than the third priority device corresponding to mobile phone 3), then send a prompt message to mobile phone 3, then disconnect from mobile phone 3, and prepare to establish a connection with the slave terminal device; in this way, the slave terminal device It snatches the "control" of the Bluetooth headset from the secondary terminal device.

需要说明的是,如果某一第二优先级设备或第三优先级设备想要升级为第一优先级设备时,可以在该设备与蓝牙耳机建立连接后,通过如图4所示的方式进行第一优先级验证,在验证通过后,蓝牙耳机可以将其中存储的第一优先级设备进行更新。It should be noted that if a second priority device or a third priority device wants to be upgraded to a first priority device, it can be done as shown in Figure 4 after the device establishes a connection with the Bluetooth headset. First priority verification, after passing the verification, the Bluetooth headset can update the first priority device stored in it.

具体的,在本示例性实施例中,由于第一优先级设备只有1个,因此需要直接删除原第一优先级设备的设备信息,然后存储当前设备的设备信息至第一优先级设备清单中。此外,如果第一优先级设备可以有多个时,第一优先级设备清单未满时,可以直接在其中增加新的设备信息,也可以基于用户的选择替换其中任意一个第一优先级设备的设备信息。Specifically, in this exemplary embodiment, since there is only one first priority device, it is necessary to directly delete the device information of the original first priority device, and then store the device information of the current device into the first priority device list. . In addition, if there can be multiple first priority devices and the first priority device list is not full, new device information can be directly added to it, or any one of the first priority devices can be replaced based on the user's selection. Device Information.

综上,本示例性实施方式中,对于单个可连接设备的连接,在多个备选设备共存的情况下,可以将用户设备配置为第一优先级设备,从而保证用户设备可以准确无误的连接到可连接设备,不会被抢占;当有其他用户也想连接该可连接设备时,可以将该用户的用户设备配置为第二优先级设备,既方便了其他用户,同时保留了用户自己对该可连接设备的绝对控制权,增强了用户对可连接设备的进行控制的灵活程度。In summary, in this exemplary embodiment, for the connection of a single connectable device, when multiple alternative devices coexist, the user device can be configured as the first priority device, thereby ensuring that the user device can be connected accurately. The connectable device will not be preempted; when other users also want to connect to the connectable device, the user's user device can be configured as the second priority device, which not only facilitates other users, but also retains the user's own rights. The absolute control over the connectable device enhances the user's flexibility in controlling the connectable device.

需要注意的是,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。It should be noted that the above-mentioned drawings are only schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal sequence of these processes. In addition, it is also easy to understand that these processes may be executed synchronously or asynchronously in multiple modules, for example.

进一步的,参考图8所示,本示例的实施方式中还提供一种设备连接装置800,包括状态读取模块810、设备读取模块820和连接控制模块830。其中:Further, referring to FIG. 8 , the embodiment of this example also provides a device connection device 800 , including a status reading module 810 , a device reading module 820 and a connection control module 830 . in:

状态读取模块810可以用于响应于接收到第一设备发送的连接请求,读取可连接设备的连接状态。The status reading module 810 may be configured to read the connection status of the connectable device in response to receiving a connection request sent by the first device.

设备读取模块820可以用于在连接状态为已连接状态时,读取当前与可连接设备连接的第二设备的第二设备信息和第一设备的第一设备信息。The device reading module 820 may be configured to read the second device information of the second device currently connected to the connectable device and the first device information of the first device when the connection state is the connected state.

连接控制模块830可以用于基于第一设备信息和第二设备信息确定第一设备和第二设备针对可连接设备的优先顺序,以确定可连接设备与待连接设备的连接。The connection control module 830 may be configured to determine the priority order of the first device and the second device with respect to the connectable devices based on the first device information and the second device information, so as to determine the connection between the connectable device and the device to be connected.

在一示例性实施例中,在第二设备为可连接设备对应的第一优先级设备,第一优先级设备的优先顺序为最优先时,连接控制模块830可以用于拒绝连接请求,并保持可连接设备与第二设备之间的连接。In an exemplary embodiment, when the second device is a first priority device corresponding to a connectable device and the priority of the first priority device is the highest priority, the connection control module 830 may be used to reject the connection request and keep A connection between a connectable device and a second device.

在一示例性实施例中,在第二设备为可连接设备对应的第二优先级设备,第二优先级设备的优先顺序低于第一优先级设备时,连接控制模块830可以用于在第一设备为第一优先级设备时,断开可连接设备与第二设备之间的连接,并建立第一设备与可连接设备之间的连接;在第一设备的优先顺序低于第二优先级设备,或者第一设备也为第二优先级设备时,拒绝连接请求并保持可连接设备与第二设备之间的连接。In an exemplary embodiment, when the second device is a second priority device corresponding to the connectable device and the priority of the second priority device is lower than that of the first priority device, the connection control module 830 may be configured to When a device is the first priority device, disconnect the connectable device from the second device, and establish the connection between the first device and the connectable device; when the priority of the first device is lower than the second priority level device, or when the first device is also a second priority device, reject the connection request and maintain the connection between the connectable device and the second device.

在一示例性实施例中,在第二设备为可连接设备对应的第三优先级设备,优先顺序为第一优先级设备、第二优先级设备、第三优先级设备时,连接控制模块830可以用于在第一设备为第一优先级设备或第二优先级设备时,断开可连接设备与第二设备之间的连接,并建立第一设备与可连接设备之间的连接;在第一设备为第三优先级设备时,拒绝连接请求并保持可连接设备与第二设备之间的连接。In an exemplary embodiment, when the second device is a third priority device corresponding to the connectable device, and the priority order is the first priority device, the second priority device, and the third priority device, the connection control module 830 It can be used to disconnect the connection between the connectable device and the second device when the first device is a first priority device or a second priority device, and establish a connection between the first device and the connectable device; in When the first device is a third priority device, the connection request is rejected and the connection between the connectable device and the second device is maintained.

在一示例性实施例中,参照图9所示,设备连接装置900,还可以包括设备调整模块910,可以用于在第三设备与可连接设备建立连接,且第三设备通过可连接设备对应的第一优先级验证时,将第三设备对应的第三设备信息保存为可连接设备对应的第一优先级设备。In an exemplary embodiment, referring to FIG. 9, the device connection device 900 may also include a device adjustment module 910, which may be used to establish a connection between a third device and a connectable device, and the third device corresponds to the connectable device through the connectable device. When the first priority is verified, the third device information corresponding to the third device is saved as the first priority device corresponding to the connectable device.

在一示例性实施例中,设备调整模块910可以用于响应于接收到第一优先级设备发送的授权数据,根据授权数据对可连接设备对应的第二优先级设备进行调整。In an exemplary embodiment, the device adjustment module 910 may be configured to adjust the second priority device corresponding to the connectable device according to the authorization data in response to receiving authorization data sent by the first priority device.

在一示例性实施例中,设备调整模块910可以用于接收第四设备发送的第四设备信息和验证数据;在验证数据通过可连接设备对应的第二优先级验证时,将第四设备对应的第四设备信息保存为可连接设备对应的第二优先级设备;验证数据为第一优先级设备向第四设备进行可连接设备授权得到的。In an exemplary embodiment, the device adjustment module 910 may be configured to receive the fourth device information and verification data sent by the fourth device; when the verification data passes the second priority verification corresponding to the connectable device, the fourth device corresponds to The fourth device information is saved as the second priority device corresponding to the connectable device; the verification data is obtained by the first priority device authorizing the connectable device to the fourth device.

在一示例性实施例中,连接控制模块830可以用于在连接状态为未连接时,建立第一设备与可连接设备之间的连接。In an exemplary embodiment, the connection control module 830 may be used to establish a connection between the first device and the connectable device when the connection status is not connected.

上述装置中各模块的具体细节在方法部分实施方式中已经详细说明,未披露的细节内容可以参见方法部分的实施方式内容,因而不再赘述。The specific details of each module in the above device have been described in detail in the implementation of the method part. For undisclosed details, please refer to the implementation of the method part, so they will not be described again.

所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art will understand that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be embodied in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as "Circuits", "modules" or "systems".

本公开的示例性实施方式还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在终端设备上运行时,程序代码用于使终端设备执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤,例如可以执行图3、图5、图6中任意一个或多个步骤。Exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the method described above in this specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to cause the terminal device to execute the above described instructions. The steps described in the "Exemplary Method" section according to various exemplary embodiments of the present disclosure may, for example, perform any one or more steps in FIG. 3, FIG. 5, and FIG. 6.

需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmed read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.

在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device . Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.

此外,可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Furthermore, program code for performing operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., as well as conventional procedural Programming language—such as "C" or a similar programming language. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on. In situations involving remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device, such as provided by an Internet service. (business comes via Internet connection).

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A device connection method applied to a connectable device, comprising:
reading the connection state of the connectable equipment in response to receiving a connection request sent by the first equipment;
when the connection state is a connected state, reading second equipment information of a second equipment currently connected with the connectable equipment and first equipment information of the first equipment;
determining a priority order of the first device and the second device for the connectable device based on the first device information and the second device information to determine connection of the connectable device and a device to be connected;
according to the number of the priority orders, setting the first stage with the lowest priority order as all the equipment except the equipment with the prior priority order, and if more than three stages of priority orders are required to be set, realizing the method by further grading the equipment with the second priority order;
Receiving fourth equipment information and verification data sent by fourth equipment; when the verification data passes the second priority verification corresponding to the connectable equipment, fourth equipment information corresponding to the fourth equipment is stored as second priority equipment corresponding to the connectable equipment; and the verification data is obtained by authorizing the connectable device to the fourth device by the first priority device.
2. The method of claim 1, wherein the second device is a first priority device corresponding to the connectable device; the priority order of the first priority equipment is the most preferable;
the determining, based on the first device information and the second device information, a priority order of the first device and the second device for the connectable device to determine connection of the connectable device with a device to be connected, includes:
rejecting the connection request and maintaining a connection between the connectable device and the second device.
3. The method of claim 1, wherein the second device is a second priority device corresponding to the connectable device; the second priority device has a lower priority than the first priority device;
The determining, based on the first device information and the second device information, a priority order of the first device and the second device for the connectable device to determine connection of the connectable device with a device to be connected, includes:
when the first device is a first priority device, disconnecting the connectable device from the second device and establishing a connection between the first device and the connectable device;
and rejecting the connection request and maintaining the connection between the connectable device and the second device when the priority order of the first device is lower than that of the second priority device or the first device is also the second priority device.
4. The method of claim 1, wherein the second device is a third priority device corresponding to the connectable device; the priority order is a first priority device, a second priority device and a third priority device;
the determining, based on the first device information and the second device information, a priority order of the first device and the second device for the connectable device to determine connection of the connectable device with a device to be connected, includes:
When the first device is a first priority device or a second priority device, disconnecting the connectable device from the second device and establishing a connection between the first device and the connectable device;
and rejecting the connection request and maintaining the connection between the connectable device and the second device when the first device is a third priority device.
5. The method according to any one of claims 2 to 4, further comprising:
and when the third equipment is connected with the connectable equipment and the third equipment passes the first priority verification corresponding to the connectable equipment, saving the third equipment information corresponding to the third equipment as the first priority equipment corresponding to the connectable equipment.
6. The method according to any one of claims 3 to 4, further comprising:
and responding to the received authorization data sent by the first priority device, and adjusting the second priority device corresponding to the connectable device according to the authorization data.
7. The method according to claim 1, wherein the method further comprises:
And when the connection state is unconnected, establishing connection between the first device and the connectable device.
8. A device connection apparatus for use with a connectable device, comprising:
the state reading module is used for responding to the received connection request sent by the first equipment and reading the connection state of the connectable equipment;
the device reading module is used for reading second device information of a second device currently connected with the connectable device and first device information of the first device when the connection state is the connected state;
a connection control module, configured to determine, based on the first device information and the second device information, a priority order of the first device and the second device for the connectable device, so as to determine connection between the connectable device and a device to be connected;
according to the number of the priority orders, setting the first stage with the lowest priority order as all the equipment except the equipment with the prior priority order, and if more than three stages of priority orders are required to be set, realizing the method by further grading the equipment with the second priority order;
receiving fourth equipment information and verification data sent by fourth equipment; when the verification data passes the second priority verification corresponding to the connectable equipment, fourth equipment information corresponding to the fourth equipment is stored as second priority equipment corresponding to the connectable equipment; and the verification data is obtained by authorizing the connectable device to the fourth device by the first priority device.
9. A computer readable medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any one of claims 1 to 7 via execution of the executable instructions.
CN202110753573.1A 2021-07-02 2021-07-02 Device connection method and apparatus, computer readable medium and electronic device Active CN113556715B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110753573.1A CN113556715B (en) 2021-07-02 2021-07-02 Device connection method and apparatus, computer readable medium and electronic device
PCT/CN2022/092781 WO2023273639A1 (en) 2021-07-02 2022-05-13 Device connection method and apparatus, and computer-readable medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110753573.1A CN113556715B (en) 2021-07-02 2021-07-02 Device connection method and apparatus, computer readable medium and electronic device

Publications (2)

Publication Number Publication Date
CN113556715A CN113556715A (en) 2021-10-26
CN113556715B true CN113556715B (en) 2023-10-03

Family

ID=78131258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110753573.1A Active CN113556715B (en) 2021-07-02 2021-07-02 Device connection method and apparatus, computer readable medium and electronic device

Country Status (2)

Country Link
CN (1) CN113556715B (en)
WO (1) WO2023273639A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556715B (en) * 2021-07-02 2023-10-03 Oppo广东移动通信有限公司 Device connection method and apparatus, computer readable medium and electronic device
CN114040465B (en) * 2021-11-30 2024-06-28 Oppo广东移动通信有限公司 Device connection switching method, device, electronic device and computer readable storage medium
CN114666779B (en) * 2022-04-08 2024-02-20 深圳市欧瑞博科技股份有限公司 Device connection method, device, computer device, and storage medium
CN115086920B (en) * 2022-06-07 2024-11-08 Oppo广东移动通信有限公司 Wireless communication connection method, device, electronic device and storage medium
US20240334542A1 (en) * 2023-03-31 2024-10-03 Lenovo (Singapore) Pte. Ltd. System and method for prioritization of device connections
WO2025053649A1 (en) * 2023-09-08 2025-03-13 삼성전자 주식회사 Capability-based connection control method and electronic device therefor

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104093216A (en) * 2014-06-16 2014-10-08 小米科技有限责任公司 Method and device for wireless data transmission
CN108650667A (en) * 2018-05-15 2018-10-12 北京字节跳动网络技术有限公司 Terminal scheduling method and apparatus
CN111866640A (en) * 2020-06-08 2020-10-30 歌尔科技有限公司 Wireless earphone connection method, wireless earphone and computer storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472771B (en) * 2014-09-12 2020-06-19 北京小米移动软件有限公司 Wireless connection method and device
CN105392213B (en) * 2015-11-27 2019-07-12 小米科技有限责任公司 Connect the method and device of controlled smart machine
CN109274563B (en) * 2018-10-10 2021-12-31 耘申信息科技(上海)有限公司 Equipment connection method and device
CN112822663B (en) * 2019-10-31 2022-06-14 华为技术有限公司 Bluetooth connection method and related device
CN113556715B (en) * 2021-07-02 2023-10-03 Oppo广东移动通信有限公司 Device connection method and apparatus, computer readable medium and electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104093216A (en) * 2014-06-16 2014-10-08 小米科技有限责任公司 Method and device for wireless data transmission
CN108650667A (en) * 2018-05-15 2018-10-12 北京字节跳动网络技术有限公司 Terminal scheduling method and apparatus
CN111866640A (en) * 2020-06-08 2020-10-30 歌尔科技有限公司 Wireless earphone connection method, wireless earphone and computer storage medium

Also Published As

Publication number Publication date
CN113556715A (en) 2021-10-26
WO2023273639A1 (en) 2023-01-05

Similar Documents

Publication Publication Date Title
CN113556715B (en) Device connection method and apparatus, computer readable medium and electronic device
US9893934B2 (en) System and method of controlling surrounding devices, based on topology
EP3101867B1 (en) Wireless audio output devices
CN111083684B (en) Method for controlling electronic equipment and electronic equipment
KR102266194B1 (en) Method and system for sharing output device between multimedia devices to send and receive data
CN111784335B (en) Simulation card management method, simulation card management device, storage medium and electronic device
CN103813472B (en) The system and method for connecting equipment by Wi-Fi network
CN105516897A (en) Method and device for one-key establishment of communication connection between Bluetooth devices
KR20160048018A (en) Apparatus and method for adaptively changing subject performing operation
CN114915953A (en) Bluetooth communication system and computer-readable storage medium
CN108347720A (en) Communication connection method, device, terminal and storage medium
CN112188461B (en) Control method and device of near field communication device, medium and electronic equipment
KR20190101831A (en) Electronic device and method for connecting local communication
TW202218449A (en) Method, mobile device and accessory for seamless handover of communications
CN104093216A (en) Method and device for wireless data transmission
KR102753033B1 (en) Apparatus and method for switching source device based on sharing of bluetooth connection information
CN113810887A (en) Bluetooth protocol connection method, device, storage medium and related equipment
CN114629932A (en) Collaboration method between electronic devices and electronic device
CN114116571A (en) Mobile device bridge platform
EP4344162A1 (en) Information processing method, device, and storage medium
US20150280933A1 (en) Electronic device and connection method thereof
KR20220052115A (en) A display apparatus, an electronic apparatus and methods thereof
US12114243B2 (en) Method and system for networking
KR20190090535A (en) Electronic apparatus paired with external electronic apparatus and control method thereof
JP6936652B2 (en) Communication device, control method of communication device, and program

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