WO2023011277A1 - 用于设备连接的方法、电子设备和系统 - Google Patents

用于设备连接的方法、电子设备和系统 Download PDF

Info

Publication number
WO2023011277A1
WO2023011277A1 PCT/CN2022/108173 CN2022108173W WO2023011277A1 WO 2023011277 A1 WO2023011277 A1 WO 2023011277A1 CN 2022108173 W CN2022108173 W CN 2022108173W WO 2023011277 A1 WO2023011277 A1 WO 2023011277A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
role
information
controller
access
Prior art date
Application number
PCT/CN2022/108173
Other languages
English (en)
French (fr)
Inventor
孙东哲
倪观军
朱旭东
连海
张景云
赵曜
李余民
金猛
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22851991.4A priority Critical patent/EP4380238A1/en
Publication of WO2023011277A1 publication Critical patent/WO2023011277A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management

Definitions

  • the present application relates to short-distance communication, and more particularly, to a method for device connection in short-distance communication.
  • Short-distance communication can realize communication between electronic devices with small distances.
  • the current mainstream access technologies in short-distance communication include Wi-Fi, Bluetooth and ZigBee.
  • Wi-Fi Wireless Fidelity
  • Bluetooth Wireless Fidelity
  • ZigBee ZigBee
  • the present application provides a device connection method, electronic device and system.
  • the electronic device is equipped with a controller and a basic service layer, and through the controller, the basic service layer and the peer device
  • the interaction between electronic devices realizes the establishment of control channels in electronic devices to realize the connection between electronic devices and provides the basis for subsequent data transmission.
  • the short-distance access technology provided by the present application can make the roles of both parties flexible and changeable based on actual scenarios because the final roles of two electronic devices can be determined based on the expected roles of both parties, and the flexibility of communication is high.
  • a method for device connection which is applied to a first electronic device, and the first electronic device supports a short-distance access technology, including a basic service layer and a controller, and the method includes:
  • the basic service layer determines first role information, where the first role information is used to indicate an expected role of the first electronic device, and the expected role of the first electronic device is a master node device or a terminal node device;
  • the basic service layer sends a broadcast event to the controller, and the broadcast event is used to indicate a broadcast policy
  • the controller sends a broadcast message according to the broadcast event, where the broadcast message includes address information of the first electronic device;
  • the controller sends a second access request to the basic service layer according to the received first access request of the second electronic device in response to the broadcast message, the first access request and the second access request
  • the access request is used to request the first electronic device to access the second electronic device, and the first access request and the second access request include a second parameter indicating a desired role of the second electronic device.
  • Two role information, the expected role of the second electronic device is a master node device or a terminal node device;
  • the controller sends a first request response according to the received second request response sent by the basic service layer in response to the second access request, and the first request response and the second request response are used to indicate agreeing that the first electronic device accesses the second electronic device, the final role of the first electronic device is different from the final role of the second electronic device, and the final role of the first electronic device is different from the final role of the first electronic device
  • the final role of the second electronic device is determined based on the expected role of the first electronic device and the expected role of the second electronic device;
  • the controller establishes a logical channel, and sends a logical channel identifier for identifying the logical channel to the basic service layer, so as to establish a control channel corresponding to the logical channel in the basic service layer.
  • the first electronic device is provided with a controller and an upper basic service layer, and the basic service layer triggers the control Channel establishment, that is, the basic service layer triggers the establishment of a control channel by determining the first role information and sending a broadcast event,
  • the basic service layer, the controller, and the peer device pass the access request (for example, the first access request and the second access request) and the access response (for example, the first request response and the second (2) exchange information such as request response) to establish a logical channel to realize the establishment of a control channel, thereby realizing the connection between the first electronic device and the peer device, and providing a basis for subsequent data transmission.
  • the short-distance access technology provided by the present application, since the final roles of the first electronic device and the peer device can be determined based on the expected roles of both parties, the roles of both parties can be flexibly changed based on actual scenarios, and the flexibility of communication is high.
  • the broadcast event includes the first role information
  • the broadcast message includes the first role information
  • the peer device by carrying the first role information in the broadcast message, the peer device (for example, the second electronic device) can determine its own role based on the first role information, and as far as possible In the initial stage of the connection process, the peer device is matched to an expected role different from that of the first electronic device, thereby improving connection efficiency.
  • the method further includes:
  • the basic service layer determines the final role of the first electronic device and the final role of the second electronic device according to the first role information and the second role information in response to the second access request ;
  • the basic service layer sends the second request response to the controller.
  • the first electronic device finally determines the final roles of the first electronic device and the second electronic device based on the expected roles of the first electronic device and the second electronic device, which can be used for both The role is the final check, so that the final roles of both parties are different so that the control channel can be successfully established to realize the connection between devices.
  • the expected role of the first electronic device is the same as the expected role of the second electronic device, and the first role information is further used to indicate that the expected role of the first electronic device is negotiable;
  • the basic service layer determines the final role of the first electronic device according to the first role information and the second role information in response to the second access request, including:
  • the basic service layer replaces the expected role of the first electronic device, so as to determine the expected role of the replaced first electronic device as the final role of the first electronic device and to determine the expected role of the second electronic device Determine the final role as the second electronic device.
  • the desired role of the first electronic device is different from the desired role of the second electronic device.
  • the basic service layer determines the final role of the first electronic device according to the first role information and the second role information in response to the second access request, including:
  • the basic service layer determines the expected role of the first electronic device as the final role of the first electronic device, and determines the expected role of the second electronic device as the final role of the second electronic device.
  • the first electronic device further includes a basic application layer; and,
  • the method further includes:
  • the basic service layer sends a third access request to the basic application layer according to the second access request, and the third access request is used to request the first electronic device to access the second electronic device. equipment;
  • the basic application layer sends a third request response to the basic service layer when at least one of the following is satisfied, and the third request response is used to indicate approval of the third access request.
  • An electronic device accesses the second electronic device, wherein the at least one item includes: the number of electronic devices that the first electronic device can currently connect to is greater than or equal to 1, or it is detected that the user is targeting the first Acknowledgment of receipt of the request displayed by the electronic device; and,
  • the basic service layer sends a second request response to the controller, including:
  • the basic service layer sends the second request response to the controller according to the third request response.
  • the basic application layer judges the capability of the first electronic device according to the third access request of the basic service layer, that is, based on the number of electronic devices that the first electronic device can currently connect to With the user's confirmation operation of the receiving request displayed by the first electronic device, it is determined from the application level whether to agree to access the second electronic device, which considers more practical application scenarios and is more conducive to improving the success rate of device connection.
  • the broadcast event further includes first device filtering information, where the first device filtering information is used to indicate devices within and outside the white list that allow the first electronic device to access the first electronic device.
  • the first electronic device has a white list
  • the first electronic device is not limited to connecting with the devices in the white list, and also wants to connect with new electronic devices that have not been connected.
  • the device establishes a connection. Therefore, by carrying the first device filtering information in the broadcast event to indicate that the first electronic device is allowed to access the first electronic device. Access requests from devices outside the white list, so as to realize the first connection between the first electronic device and the new electronic device.
  • the first access request further includes address information of the second electronic device; and, the method further includes:
  • the controller adds the address represented by the address information of the second electronic device to the white list of the first electronic device, so as to update the white list of the first electronic device.
  • the first electronic device when the first electronic device establishes a connection with a new electronic device (for example, the second electronic device), by adding the address of the new electronic device to the first electronic device
  • a new electronic device for example, the second electronic device
  • the automatic connection can be realized during the subsequent connection between the two parties, which is convenient and fast, and the user experience is high.
  • the broadcast event further includes second device filtering information, where the second device filtering information is used to indicate that only the first electronic device is allowed to access devices in the white list of the first electronic device.
  • the control The controller subsequently receives and forwards the access requests from the devices in the white list, so as to realize the automatic connection process between the first electronic device and the once connected electronic device (for example, the second electronic device).
  • the broadcast message further includes: address information of the second electronic device, where the second electronic device is a device in the white list of the first electronic device.
  • the automatic connection between the first electronic device and the specific device can be realized.
  • the method also includes:
  • the basic service layer sends information indicating that the control channel is available to the basic application layer.
  • the basic service layer can send the information indicating that the control channel is available to the basic application layer, so that the basic application layer can know that the control channel has been established successfully, and can initiate subsequent Business channel establishment and data transmission.
  • a method for device connection which is applied to a second electronic device, and the second electronic device supports a short-distance access technology, including a basic service layer and a controller, and the method includes:
  • the controller receives a broadcast message from the first electronic device, where the broadcast message includes address information of the first electronic device;
  • the basic service layer sends second role information to the controller, where the second role information is used to indicate an expected role of the second electronic device, and the expected role of the second electronic device is a master node device or terminal node device;
  • the controller sends a first access request to the first electronic device in response to the broadcast message, the first access request is used to request the first electronic device to access the second electronic device,
  • the first access request includes the second role information and address information of the first electronic device;
  • the controller receives a first request response from the first electronic device in response to the first access request, and the first request response is used to indicate that the first electronic device is allowed to access the second electronic device , the final role of the first electronic device is different from the final role of the second electronic device, and the final role of the first electronic device and the final role of the second electronic device are based on the first electronic device
  • the expected role is determined by the expected role of the second electronic device, and the expected role of the first electronic device is a master node device or a terminal node device;
  • the controller establishes a logical channel and sends a logical channel identifier for identifying the logical channel to the basic service layer, so as to establish a control channel corresponding to the logical channel in the basic service layer.
  • the second electronic device is provided with a controller and an upper basic service layer, and the second electronic device is based on the control
  • the controller scans the broadcast message of the first electronic device and the second role information issued by the basic service layer, initiates the first access request to the controller and receives the first request response, and establishes a logical channel to realize the control channel establishment, so as to realize the connection between the second electronic device and the peer device, and provide a basis for subsequent data transmission.
  • the short-distance access technology provided by the present application, since the final roles of the second electronic device and the peer device can be determined based on the expected roles of both parties, the roles of both parties can be flexibly changed based on actual scenarios, and the flexibility of communication is high. , very suitable for products with the characteristics of flexibility and miniaturization, and for services with small bandwidth, low power consumption, and low speed, and better for multi-device connections (that is, one electronic device can be connected to multiple devices at the same time And the role is not fixed), in short, the scope of application is wide.
  • the broadcast message includes first role information for indicating a desired role of the first electronic device.
  • the controller sends a first access request to the first electronic device in response to the broadcast message, including:
  • the controller After scanning the broadcast message, the controller sends the first access request to the first electronic device, where the first electronic device is a device in the white list of the second electronic device.
  • the controller scans the devices based on the white list, and scans the devices in the white list
  • the device can directly initiate an access request, which simplifies the process of reporting results to the upper layer and saves the time required for connection to achieve fast connection between devices and improve the efficiency of the connection process.
  • the basic service layer sends the second role information to the controller, including:
  • the basic service layer sends connection information to the controller, where the connection information includes the second role information, wherein the connection information further includes: an instruction for instructing the controller to enable the second electronic device Whitelist information.
  • connection information further includes: information indicating a connection mode, the connection mode is a single-device connection mode or a multi-device connection mode, and the single-device connection mode indicates that the second electronic device The device can only be connected to one electronic device, and the multi-connection mode means that the second electronic device can be connected to multiple electronic devices within the same period of time.
  • connection mode of the second electronic device is a multi-device connection mode; and, the method further includes:
  • the controller stops scanning; or, when the preset condition is not met, the controller continues scanning; the preset condition includes any of the following:
  • the first electronic device is the Nth device scanned by the controller; or,
  • the first electronic device is the Nth device scanned by the controller and the second electronic device completes the establishment of the control channel; or,
  • the first electronic device is the Nth device scanned by the controller.
  • the first electronic device is the Nth device scanned by the controller and the second electronic device completes the establishment of the control channel;
  • the N devices including the first electronic device scanned by the controller are devices in the white list of the second electronic device, and N is the maximum number of devices that the second electronic device can connect to. Quantity, N is an integer greater than 1.
  • the controller of the second electronic device when the second electronic device supports multi-device connection mode, the controller of the second electronic device will stop scanning to stop the entire connection process when the preset condition is met. Otherwise, when the preset conditions are not met, the scan will continue to achieve multi-device connection, so that the controller does not need to interact with the upper layer (for example, the basic service layer) every time a device is connected (for example, the upper layer sends connection information , scanning parameters, etc.) to initiate an access request, that is, the second electronic device does not need to restart the connection process every time it connects to a device, which not only effectively reduces signaling overhead, but also reduces the time spent in the multi-device connection process. To achieve fast connection of multiple devices.
  • the upper layer for example, the basic service layer
  • the broadcast message further includes address information of the second electronic device.
  • the second electronic device further includes a basic application layer; and, the method further includes:
  • the controller sends a scan result determined based on the broadcast message to the basic application layer through the basic service layer, where the scan result includes address information of the first electronic device;
  • the basic application layer sends second information to the basic service layer, the second information including address information of the first electronic device; and,
  • the basic service layer sends the second role information to the controller, including:
  • the basic service layer sends access information to the controller according to the second information, where the access information includes the second role information and address information of the first electronic device; and,
  • the controller sends a first access request to the first electronic device in response to the broadcast message, including:
  • the controller sends the first access request according to the access information in response to the broadcast message.
  • the broadcast message, the scan result, and the second information all include first role information indicating an expected role of the first electronic device; and,
  • the basic service layer sends access information to the controller according to the second information, including:
  • the basic service layer determines the expected role of the second electronic device according to the expected role of the first electronic device, and the expected role of the second electronic device is different from the expected role of the first electronic device;
  • the basic service layer sends the access information to the controller.
  • the second electronic device receiving the broadcast message can finally obtain the first role information and based on the first
  • the role information determines its own role, and as far as possible in the initial stage of the connection process, the peer device can be matched with an expected role different from the expected role of the first electronic device, so as to improve connection efficiency.
  • the access information further includes: information for instructing the second electronic device to ignore the white list of the second electronic device.
  • the second electronic device if the second electronic device has a white list, the second electronic device is not limited to connecting with the devices in the white list, and also wants to connect with new devices that have not been connected.
  • the electronic device establishes a connection. Therefore, the first connection between the devices can be realized by carrying information in the access information for indicating to ignore the white list of the second electronic device.
  • the second electronic device has enabled the white list before, when it is connected to the first electronic device for the first time, if the white list of the second electronic device is not ignored, the devices located around the second electronic device that have been connected to the second electronic device Other electronic devices may automatically connect with the second electronic device.
  • the second electronic device Since the devices that the second electronic device can connect to are limited, it will affect the connection between the first electronic device and the second electronic device. Therefore, by indicating the second electronic device The second electronic device ignores the white list information of the second electronic device so that the second electronic device does not perform device connection based on the white list, which can further ensure the success of the first connection between the first electronic device and the second electronic device.
  • the second information further includes information indicating the first short-distance access technology.
  • the first access request further includes address information of the second electronic device.
  • the method also includes:
  • the basic service layer sends information indicating that the control channel is available to the basic application layer.
  • a method for device connection which is applied to a second electronic device, the second electronic device supports short-distance access technology, and the connection mode of the second electronic device is a multi-device connection mode , the method includes:
  • the second electronic device sends a first access request after scanning the broadcast message of the first electronic device, and the first access request is used to request the first electronic device to access the second electronic device , the first electronic device is a device in the white list of the second electronic device;
  • the second electronic device receives a first request response from the first electronic device in response to the first access request, and the first request response is used to indicate that the first electronic device is allowed to access the second Electronic equipment;
  • the second electronic device establishes a logical channel to establish a control channel corresponding to the logical channel
  • the second electronic device stops scanning; or, if the preset condition is not met, the second electronic device continues to scan; wherein the preset condition includes any of the following item:
  • the first electronic device is the Nth device scanned by the second electronic device; or,
  • the first electronic device is the Nth device scanned by the second electronic device and the second electronic device completes the establishment of the control channel; or,
  • the first electronic device is the Nth device scanned by the controller.
  • the first electronic device is the Nth device scanned by the second electronic device and the second electronic device completes the establishment of the control channel;
  • the N devices including the first electronic device scanned by the second electronic device are devices in the white list of the second electronic device, and N is a device that the second electronic device can connect to
  • the maximum number of , N is an integer greater than 1.
  • the second electronic device if the second electronic device supports the multi-device connection mode, the second electronic device will stop scanning to stop the entire connection process when the preset condition is met; When the preset conditions are not met, the scan will continue to realize multi-device connection, so that the second electronic device does not need to restart the connection process every time it connects to the device (for example, the upper layer sends connection information, scanning parameters, etc.), not only The signaling overhead is effectively reduced, and the time delay of the multi-device connection process is reduced so as to realize the fast connection of multiple devices.
  • an electronic device for device connection is provided, and the electronic device is configured to execute the method provided in any one of the first aspect, the second aspect, or the third aspect.
  • the electronic device may include a module for implementing any possible implementation manner of any one of the first aspect, the second aspect, or the third aspect.
  • an electronic device for device connection including a processor.
  • the processor is coupled with the memory, and can be used to execute instructions in the memory, so as to implement the method in any possible implementation manner of any one of the above-mentioned first aspect, second aspect, or third aspect.
  • the electronic device further includes a memory.
  • the device further includes a communication interface, and the processor is coupled to the communication interface.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a device, the device realizes any one of the above-mentioned first aspect, second aspect, or third aspect A method in any of the possible implementations.
  • a computer program product containing instructions, and when the instructions are executed by a computer, the device implements the method in any one of the possible implementation modes of any one of the first aspect, the second aspect, or the third aspect above .
  • a chip including: an input interface, an output interface, a processor, and a memory, the input interface, the output interface, the processor, and the memory are connected through an internal connection path, and the processor uses When executing the code in the memory, when the code is executed, the processor is configured to execute the method in any possible implementation manner of any one of the above-mentioned first aspect, second aspect, or third aspect.
  • Fig. 1 is a schematic diagram of a communication system provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device 200 provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a protocol architecture of a short-distance access technology provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method 400 for device connection provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method 500 for device connection provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method 600 of the device provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a method 700 for device connection provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a method 800 for disconnecting a control channel provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a method 900 for device connection provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of a method 1000 for device connection provided by an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of a method 1100 for device connection provided by an embodiment of the present application.
  • FIG. 12 is a schematic block diagram of an electronic device 1200 provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an electronic device 1300 provided by an embodiment of the present application.
  • the embodiments of the present application can be applied to various short-distance access technologies between electronic devices, and the short-distance access technologies include but are not limited to: sparklink basic (SLB) access technology and sparklink low power consumption ( sparklink low energy, SLE) access technology.
  • SLB sparklink basic
  • SLE sparklink low power consumption
  • SLB can support the transmission of large-bandwidth services such as screen projection, virtual reality (VR), and vehicle communication.
  • VR virtual reality
  • the transmission of consumption business Unless otherwise specified below, the access technologies described in the text all represent short-distance access technologies, and the SLB access technology is referred to as SLB for short, and the SLE access technology is referred to as SLE for short.
  • Fig. 1 is a schematic diagram of a communication system provided by an embodiment of the present application.
  • the communication system includes at least one first electronic device (for example, first electronic devices 21, 22 and 23) and a second electronic device 11, and the second electronic device 11 and each first electronic device can Connections are established via short-range access technologies for communication.
  • first electronic device for example, first electronic devices 21, 22 and 23
  • second electronic device 11 and each first electronic device can Connections are established via short-range access technologies for communication.
  • the communication system shown in FIG. 1 is only for schematic illustration, and the communication system may further include other devices, for example, the communication system may further include devices such as routers or base stations.
  • the embodiment of the present application does not impose any limitation on the quantity of the first electronic device and the number of the second electronic device included in the communication system.
  • the first electronic device in the embodiment of the present application may be, for example, a keyboard, a mouse, an e-book, a headset, a screen, a camera, VR glasses, a vehicle center console, and a smart home device.
  • the smart home device may be a smart air purification device. appliances, smart air conditioners, smart cameras, smart alarm clocks, sweeping robots, or smart speakers.
  • the first electronic device may also be, for example, a mobile phone, a tablet computer, a wearable electronic device (such as a smart watch) with a wireless communication function, and the like.
  • the second electronic device in the embodiment of the present application may be, for example, a mobile phone, a tablet computer, a wearable electronic device with a wireless communication function (such as a smart watch), and the like.
  • the second electronic device may include but not limited to Portable electronic devices with Windows, Linux or other operating systems.
  • the second electronic device may also be other electronic devices, such as a laptop computer (Laptop), a car speaker, a camera, a rearview mirror, and the like.
  • the first electronic device and the second electronic device may support at least one short-range access technology.
  • the first electronic device and the second electronic device may support at least one of SLE and SLB.
  • devices such as mobile phones, tablets, and wearable devices can support both SLE and SLB.
  • VR glasses, vehicle center consoles, and cameras can support SLB.
  • devices such as headsets, mice, keyboards, and e-books can support SLE.
  • FIG. 2 is a schematic structural diagram of an electronic device 200 provided by an embodiment of the present application.
  • the electronic device 200 may be the above-mentioned first electronic device or the second electronic device.
  • the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (universal serial bus, USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, and an antenna 2 , wireless communication module 250, sensor module 260, etc.
  • a processor 210 an external memory interface 220, an internal memory 221, a universal serial bus (universal serial bus, USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, and an antenna 2 , wireless communication module 250, sensor module 260, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • 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 processing unit (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. Wherein, different processing units may be independent components, or may be integrated in one or more processors.
  • the electronic device 200 may also include one or more processors 210 . Wherein, the controller can generate an operation control signal according to the instruction operation code and the timing signal, and complete the control of fetching and executing the instruction.
  • processor 210 may include one or more interfaces.
  • the interface may include inter-integrated circuit (I2C) interface, inter-integrated circuit sound (I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input/output (general-purpose input/output, GPIO) interface, SIM card interface, and/or USB interface, etc.
  • the USB interface 230 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 230 can be used to connect a charger to charge the electronic device 200, and can also be used to transmit data between the electronic device 200 and peripheral devices.
  • the interface connection relationship among the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 .
  • the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 240 is configured to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 240 can receive the charging input of the wired charger through the USB interface 230 .
  • the charging management module 240 may receive wireless charging input through a wireless charging coil of the electronic device 200 . While the charging management module 240 is charging the battery 242 , it can also supply power to the smart device through the power management module 241 .
  • the power management module 241 is used for connecting the battery 242 , the charging management module 240 and the processor 210 .
  • the power management module 241 receives the input of the battery 242 and/or the charging management module 240 to provide power for the processor 210 , the internal memory 221 , the external memory 220 and the wireless communication module 250 .
  • the power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 241 can also be set in the processor 210 .
  • the power management module 241 and the charging management module 240 may also be set in the same device.
  • the wireless communication function of the electronic device 200 can be realized by the antenna 1 , the antenna 2 and the wireless communication module 250 .
  • the wireless communication module 250 can provide wireless communication solutions including Wi-Fi, Bluetooth (bluetooth, BT), SLE, SLB, and wireless data transmission modules (eg, 433MHz, 868MHz, 915MHz) applied to the electronic device 200 .
  • the wireless communication module 250 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 250 receives electromagnetic waves via the antenna 1 or the antenna 2 , filters and frequency-modulates the electromagnetic wave signal, and sends the processed signal to the processor 210 .
  • the wireless communication module 250 can also receive the signal to be transmitted from the processor 210 , frequency-modulate it, amplify it, convert it into electromagnetic wave and radiate it through the antenna 1 or antenna 2 .
  • the electronic device 200 is the first electronic device of the broadcaster, and the electronic device 200 can send a broadcast message through the wireless communication module, so that the surrounding second electronic devices scan to the electronic device 200 to initiate the first broadcast.
  • the access request for example, the broadcast message may include role information of the electronic device 200, which is used to indicate that the expected role of the electronic device 200 is a G-node device or a T-node device (described in detail below), so that the second electronic device The device determines its own role, and the first access request may include role information of the second electronic device.
  • the electronic device 200 Based on the received first access request, the electronic device 200 sends to the second electronic device a first access response in response to the first access request, to indicate whether to allow the electronic device 200 to access the second electronic device.
  • the electronic device 200 When the device 200 is connected to the second electronic device, the electronic device 200 establishes a logical channel with the second electronic device to realize the connection of the control channel, thereby realizing the connection between the electronic device 200 and the second electronic device.
  • the electronic device 200 is used as the second electronic device receiving the broadcast message, the electronic device 200 is configured in the automatic connection scanning mode and the multi-device connection mode, and the electronic device 200 scans to the first electronic device After the broadcast message is sent, after scanning the first electronic device in the white list of the electronic device 200, the first access request can be directly initiated, and, in the multi-device connection mode, if the preset condition is met, the scanning is stopped, If the preset condition is not met, continue scanning.
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • Internal memory 221 may be used to store one or more computer programs including instructions.
  • the processor 210 can execute the above-mentioned instructions stored in the internal memory 221, so that the smart device 101 executes the methods for discovering and configuring networks provided in some embodiments of the present application, as well as various applications and data processing.
  • the internal memory 221 may include a code storage area and a data storage area. Wherein, the code storage area can store the operating system.
  • the data storage area can store data and the like created during the use of the electronic device 200 .
  • the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 210 may execute the instructions stored in the internal memory 221 and/or the instructions stored in the memory provided in the processor 210, so that the electronic device 200 executes the instructions provided in the embodiments of the present application. Methods for discovery and distribution, and other applications and data processing.
  • FIG. 3 is a schematic diagram of a protocol architecture of a short-distance access technology provided by an embodiment of the present application.
  • This protocol structure is applicable to any electronic device that can realize short-distance communication, for example, it can be applied to the first electronic device and the second electronic device above.
  • the protocol architecture includes but is not limited to a host (host) and a controller (controller).
  • the host is an upper-layer protocol of the controller, and the host includes a basic application layer and a basic service layer.
  • the controller, the basic service layer and the basic application layer are described in detail.
  • the controller defines the underlying hardware part, also known as the access layer, which is the lowest layer of the protocol architecture, including the physical layer and the data link layer.
  • the physical layer uses the transmission medium to provide a physical connection for the data link layer to realize the transparent transmission of the bit stream.
  • the data link layer implements functions such as resource management, access control, data segmentation, cascading, and working modes to ensure reliable data transmission.
  • the data link layer includes a media access layer and a link control layer, the media access layer is used for wireless resource allocation, and provides data transmission services for the link control layer, and the link control layer is used for The link established between electronic devices, and the link control protocol is exchanged on the control link to manage the physical/logical link and control the behavior of the device.
  • a logical channel is established in the controller, and the logical channel is the basis for establishing the transmission channel in the upper basic service layer. After the logical channel is successfully established, the transmission channel in the basic service layer is available.
  • the logical channel in the embodiment of the present application is the basic logical channel in the controller, and there is also a basic logical channel in the controller for some specific service (for example, high-definition call) scenarios.
  • the dedicated link established on the logical channel is also a logical channel, but it needs to be established on the basis of the basic logical channel.
  • a logical channel identifier (logic channel identifier, LCID) is defined.
  • the controller can support different short-distance access technologies. Exemplarily, the controller can support at least one of SLE and SLB. In implementation, the controller may exist in the form of software or hardware. The controller can be integrated in the chip. If the controller can support SLE and SLB at the same time, the controller can be integrated on one chip, which realizes SLE and SLB. The controller can also be integrated on two chips respectively. Each chip implements SLE and SLB respectively.
  • the basic service layer is a protocol layer located between the controller and the basic application layer. It includes multiple functional units, unbound from the business, and realizes a common functional process. At the same time, a transmission channel is established for the business, and the data of the transmission channel is processed. and sent to the controller.
  • the basic service layer includes but not limited to the following functional modules: device discovery module, service management module, channel management module, quality of service (Qos) management module, security management module, multi-domain negotiation module, measurement module and 5G fusion module .
  • the device discovery module is used to broadcast the capabilities of its own devices and scan for peer devices that meet business requirements. In addition, it also supports mutual discovery of SLB or SLE.
  • the service management module is used to define a data structure and provide a data module for sending control instructions and small data for the business function set of the basic application layer.
  • the channel management module is used in the basic application layer to apply for a transmission channel according to the business type (business identifier, BID) and the QoS capability of the business to transmit the data flow, to manage the establishment and release of the transmission channel for the business, and to establish and release the transmission channel and the logical link. Mapping relations.
  • the Qos management module is used to manage the Qos request static table of the service, and to negotiate Qos with the peer device.
  • the security management module is used for the secure connection of the basic service layer.
  • the multi-domain negotiation module is used to implement information exchange between domains, avoid interference between multiple domains, and load balance in a scenario where there are multiple domains (subnets).
  • the measurement module is used to configure the period of the underlying measurement, measure the reporting event, and measure the value. Used for scheduling, power control, etc.
  • the 5G fusion module is used to establish a channel with cellular 5G remote management capabilities, and realize devices with cellular 5G remote control functions through authentication and authentication mechanisms.
  • the transmission channel identifier (transmission channel identifier, TCID) of the transmission channel of the basic service layer is defined.
  • the transmission channel in the basic service layer includes a control channel and a service channel.
  • the establishment of a control channel is the basis for establishing a service channel between devices.
  • the embodiment of this application involves the relevant content of the control channel. The following only describes the control channel in detail.
  • at least one control channel may be designed in the basic service layer, and the at least one control channel corresponds to one logical channel.
  • the basic service layer of the electronic device supporting SLE is designed with a control channel, for example, the TCID of the SLE control channel is 0x0008.
  • the basic service layer of the electronic device supporting SLB is designed with a control channel, for example, the TCID of the SLB is 0x0009.
  • control channel is a channel that has been designed in the basic service layer, but the control channel corresponding to the logical channel can be used only after the logical channel in the controller is established. Therefore, in the embodiment of the present application, the process of establishing a logic channel and a control channel that can be used is referred to as a process of establishing a control channel.
  • the basic application layer is used to undertake different business requirements of the upper application (APP), and decompose the data to the lower basic service layer.
  • the basic application layer is used to classify services, including multiple service function sets: general perception framework, general device management framework, general audio and video framework, general data framework, etc.
  • Each business function set includes business classification data processing modules, for example, the general audio and video framework includes codec modules, and the general data framework includes data encryption and compression modules, etc.
  • the host including the basic service layer and the basic application layer is adapted to multiple short-distance access technologies (for example, SLE and SLB), or in other words, the host is compatible with multiple access technologies, or in other words, multiple One access technology can use a unified host, that is, no matter what access technology the controller supports, the upper layer can use a unified host.
  • SLE and SLB short-distance access technologies
  • the embodiment of the present application relates to the control channel of the host in the electronic device.
  • the main purpose is to realize the establishment of the control channel in the host to realize the connection of the electronic device. Channel establishment is crucial.
  • the embodiment of the present application also relates to the release of the control channel, so as to reduce unnecessary waste of resources.
  • any electronic device can be used as a G-node device, and the other electronic device can be used as a T-node device.
  • the role of the electronic device is a G-node device or a T-node device.
  • the role of electronic equipment can be fixed.
  • the role of the electronic equipment has been fixed when it leaves the factory, and it is uniquely used as a G-node device or a T-node device.
  • the vehicle-mounted center console may be fixed as a G-node device, and devices such as cameras, rearview mirrors, and vehicle-mounted speakers in the vehicle may be fixedly used as T-node devices.
  • the product has the characteristics of flexibility and miniaturization. Even when the same device is connected to multiple devices, it can be either a G-node device or a T-node device. . Therefore, in SLE, the role of the electronic device is changeable, which is convenient for the host to maintain the role relationship, especially for the scene where the role changes during the multi-device connection process.
  • the G node device sends a C frame.
  • the C frame is a control frame that carries the control information of the T device and is used to realize timing synchronization and resource allocation of the T node device.
  • T node equipment receives C frame, and sends T frame to G node equipment based on C frame
  • T frame is a data frame, which can realize the functions of short timing synchronization, control signaling and data transmission. Therefore, in SLE, determining the role of the electronic device also facilitates the controller to correctly transmit content such as C frames and T frames based on the determined G node device and T node device.
  • the electronic device when an electronic device is connected to another electronic device for the first time, the electronic device may serve as a G-node device, and the other electronic device acts as a T-node device, and during the reconnection process between the electronic device and the other electronic device, The electronic device may serve as a T-node device, and the other electronic device may serve as a G-node device, and specific conditions may be flexibly determined based on actual conditions.
  • the embodiment of the present application mainly involves two scenarios.
  • the first scenario is the first connection between electronic devices
  • the second scenario is that the electronic devices have been successfully connected and can be automatically connected later. Scenes.
  • the basic service layer in the first electronic device and the second electronic device involves a device discovery module, a channel management module and a security management module.
  • FIG. 4 is a schematic flowchart of a method 400 for device connection provided by an embodiment of the present application.
  • the method 400 describes a process in which the first electronic device and the second electronic device establish a control channel based on SLE to realize the first connection.
  • the first electronic device may be an earphone
  • the second electronic device may be a mobile phone.
  • the process of the method 400 is mainly as follows: Process 1.
  • the first electronic device sends a broadcast message, and the surrounding second electronic devices perform related operations based on the broadcast message.
  • the first electronic device and the second electronic device establish a control channel.
  • the first electronic device and the second electronic device may also perform authentication and encryption on the control channel to protect user privacy.
  • the first electronic device sends a broadcast message, and the second electronic device performs related operations based on the broadcast message.
  • the basic application layer of the first electronic device sends a notification event to the device discovery module of the basic service layer, where the notification event is used to determine role information of the first electronic device.
  • the role information of the first electronic device is used to indicate that the expected role of the first electronic device is a G-node device or a T-node device, and the expected role of the second electronic device and the final roles of the first electronic device and the second electronic device can be subsequently determined Provide some reference.
  • the role information of the first electronic device is also used to indicate whether the expected role of the first electronic device can be negotiated, so that when the expected roles of the first electronic device and the second electronic device are the same, the expected role can be replaced through negotiation. Determine the final role of the two electronic devices.
  • the expected role of the first electronic device indicates the expected role of the first electronic device
  • the final role of the first electronic device indicates the actual role of the first electronic device.
  • the two may be the same or different.
  • the following describes the role of the second electronic device The explanation of the expected role and the final role of is the same as here, so I won't repeat them here.
  • the role information of the first electronic device When the role information of the first electronic device is used to indicate the expected role of the first electronic device and whether the expected role is negotiable, for example, the role information of the first electronic device may be represented by 2 bits, one bit ( Denoted as the first bit) is used to indicate the desired role of the first electronic device, and another bit (denoted as the second bit) is used to indicate whether the role is negotiable.
  • the first bit is the lower bit of the 2 bits
  • the second bit is the upper bit of the 2 bits
  • the first bit is the upper bit of the 2 bits
  • the second bit is the lower bit of the 2 bits
  • a first bit of "0" indicates a T-node device
  • a first bit of "1" indicates a G-node device
  • a first bit of "1" indicates a T-node device
  • a first bit of "0" indicates a G-node device
  • the second bit is "0" indicating that the role is negotiable, and the second bit is "1" indicating that the role is not negotiable.
  • a second bit of "1" indicates that the role is negotiable, and a second bit of "0" indicates that the role is not negotiable.
  • the first bit is the low-order bit
  • the second bit is the high-order bit
  • the first bit is "0” to indicate a T-node device
  • the first bit is "1” to indicate a G-node device
  • the second bit is "0" to indicate that the role can be negotiated
  • the second bit is "1" to indicate that the role can be negotiated
  • the second bit is "1" indicates that the role is not negotiable.
  • Table 1 shows various possible situations of the role information of the first electronic device. As shown in Table 1, four situations of role information are shown, and one row represents one situation of role information, and each situation is composed of whether a role is negotiable and a desired role. "Y” indicates that the role is negotiable, "N” indicates that the role is not negotiable, "T” indicates a T-node device, and "G” indicates a G-node device.
  • the notification event includes information about a user's operation on the first electronic device.
  • the first electronic device is a headset, for example, the user's operation on the first electronic device can be a long key; if the first electronic device is a mobile phone, for example, the user's operation on the first electronic device It may be to turn on a switch related to SLE in the settings; if the first electronic device is a keyboard, for example, the user's operation on the first electronic device may be to press a physical switch for connection.
  • the basic application layer obtains the user's operation on the first electronic device, and sends the operation to the device discovery module of the basic service layer, so that the device discovery module can determine that the first electronic device communicates with other electronic devices using
  • the access technology is SLE, and role information of the first electronic device is determined.
  • the notification event includes information indicating that the access technology is SLE.
  • the basic application layer obtains the user's operation on the first electronic device, and based on the operation, determines that the access technology used by the first electronic device to communicate with other electronic devices is SLE, so that the device discovery module can determine the first Role information of electronic devices.
  • the notification event includes role information of the first electronic device.
  • the basic application layer obtains the user's operation on the first electronic device, determines based on the operation that the access technology used by the first electronic device to communicate with other electronic devices is SLE, and determines the role information of the first electronic device .
  • the role information of the first electronic device may be determined according to the business type and the historical role of the first electronic device.
  • the first electronic device is a headset
  • the service type is an audio service
  • the desired role may be a T-node device.
  • the historical role of the first electronic device is a T-node device
  • the expected role determined here is a T-node device.
  • the device discovery module of the first electronic device configures and sends a broadcast event to the controller, where the broadcast event is used to indicate a broadcast policy, including parameters used for broadcast.
  • Parameters for broadcasting include but are not limited to: adv mode, discovery level, broadcast interval, broadcast duration, and adv flag.
  • the broadcast mode requires other devices to establish a connection with the first electronic device.
  • the discovery level is, for example, any of non-discoverable, general discovery, and priority discovery.
  • the broadcast interval indicates the period for sending broadcast messages, and the broadcast duration indicates the duration of each broadcast.
  • the broadcast flag indicates a public (public) or private broadcast address.
  • the broadcast event further includes role information of the first electronic device.
  • the broadcast event further includes device filtering information used to indicate the device requesting access to the first electronic device.
  • the device filtering information is used to indicate that the first electronic device is allowed to access the first electronic device. Devices inside and outside the list, that is, allowing the first electronic device to access all devices that request access to the first electronic device, wherein the devices in the white list of the first electronic device have been connected to the first electronic device equipment.
  • the initial connection process between the first electronic device and the new electronic device (for example, the second electronic device) can be realized. This is because, although a white list is stored in the first electronic device, the first electronic device is not limited to connecting with devices in the white list, but also wants to establish a connection with a new electronic device that has not been connected.
  • the filtering information indicates that the first electronic device is allowed to access devices inside and outside the white list of the first electronic device to realize the first connection between the first electronic device and the new electronic device.
  • the white list includes a media access control (media access control, MAC) address of at least one electronic device, and the MAC address of each electronic device is used to uniquely identify each electronic device.
  • the device discovery module of the first electronic device sends the first information to the channel management module according to the notification event.
  • the device discovery module determines the access technology used by the first electronic device to communicate with other electronic devices according to the notification event, thereby determining and sending the first information to the channel management module.
  • the first information includes role information of the first electronic device, so as to determine the final roles of the first electronic device and the second electronic device subsequently.
  • the first information may also include broadcast state information for indicating the broadcast state of the first electronic device, where the broadcast state information is used to indicate that the first electronic device is in the broadcast state, so that after the connection of the control channel is completed, Stop broadcasting in time to save power consumption.
  • the controller of the first electronic device sends a broadcast message according to the broadcast event.
  • the controller determines and sends a broadcast message based on the broadcast event received in S412, the broadcast message includes but not limited to: address information of the first electronic device, broadcast mode (adv mode), and broadcast flag (adv flag).
  • the broadcast message further includes role information of the first electronic device.
  • SLE corresponds to one broadcast message format
  • SLB corresponds to another broadcast message format.
  • the formats of the two broadcast messages are different.
  • the format of the broadcast message corresponding to different access technologies may be predefined by the protocol. Only when the sender and the receiver of the broadcast message support the same access technology, the receiver can successfully parse the broadcast message; otherwise, the parsing of the broadcast message fails.
  • sequence numbers of the steps in the embodiments of the present application do not mean the order of execution, and the execution order of the steps should be determined by their functions and internal logic, and should not constitute a component of the implementation process of the embodiments of the present application. Any restrictions.
  • S412 may be performed before or after S413 or may be performed simultaneously with S413.
  • S414 may be performed before or after S413 or may be performed simultaneously with S413.
  • the basic application layer of the second electronic device sends scanning mode information to the device discovery module, where the scanning mode information is used to indicate that the scanning mode of the second electronic device is a default scanning mode.
  • the default scan mode means that the second electronic device can scan any device that can be scanned, and there is no need to selectively scan surrounding devices or filter out some devices, which is suitable for the first connection between two electronic devices.
  • Another scanning mode is the automatic connection scanning mode.
  • This scanning mode needs to scan the surrounding devices or filter out some devices under certain restrictions. It is suitable for the scene of automatic connection between two electronic devices.
  • the method 600 is described in detail below.
  • the device discovery module of the second electronic device configures and sends scanning parameters to the controller based on the default scanning mode.
  • the scanning parameters include but are not limited to at least one of the following parameters: scanning duration, scanning interval, and the like.
  • S415 and S416 and S411-S414 is not fixed and can be changed arbitrarily as long as S415 and S416 are executed before S417.
  • S415 and S416 may be performed before or after S411-S414 or simultaneously.
  • S415 and S416 may be performed before or after any one of steps S411-S414 or may be performed simultaneously.
  • the controller of the second electronic device scans the surrounding devices according to the scan parameters, scans the broadcast message of the first electronic device, obtains the scan result based on the broadcast message, and sends the scan result to the basic application layer through the device discovery module, That is, the controller sends the scan result to the device discovery module, and the device discovery module sends the scan result to the basic application layer.
  • the scan result includes the address information of the first electronic device obtained from the broadcast message.
  • the scan result also includes the role information of the first electronic device.
  • the broadcast message of the first electronic device is in a format corresponding to SLE, only when the second electronic device supports SLE, can the second electronic device successfully parse the broadcast message sent by the first electronic device and successfully Execute S417.
  • the basic application layer of the second electronic device sends the second information to the channel management module according to the scanning result.
  • the second information may be the scanning result in S418.
  • the second information may further include: the access technology used by the second electronic device to communicate with the first electronic device is SLE.
  • the basic application layer may send the second information to the channel management module according to the user operation and the scanning result obtained in S417.
  • the basic application layer reports the scan results to the APP, and the APP displays a list of discovered devices, and the user clicks on the first electronic device in the list of discovered devices, and the basic application layer sends information to the channel based on the user's operation on the first electronic device.
  • the management module sends the second information. For example, taking a mobile phone as an example, the APP can be "settings".
  • Process 2 The first electronic device and the second electronic device establish a control channel.
  • the channel management module of the second electronic device sends the access information to the controller according to the second information.
  • the channel management module determines access information according to the second information, and sends the access information to the controller.
  • the access information includes but not limited to the following: role information of the second electronic device, and address information of the first electronic device.
  • the address information of the first electronic device is obtained from the second information.
  • the role information of the second electronic device is used to indicate that the expected role of the second electronic device is a G-node device or a T-node device.
  • the role information of the second electronic device is also used to indicate whether the role of the second electronic device can be negotiated, so as to determine the final role of the second electronic device.
  • the expression form of the role information of the second electronic device reference may be made to the specific description above about the expression form of the role information of the first electronic device, and details are not repeated here.
  • the channel management module of the second electronic device may determine the role information of the second electronic device according to the service type and the historical role of the second electronic device.
  • the second electronic device is a mobile phone
  • the service type is an audio service
  • the desired role may be a G node device.
  • the historical role of the second electronic device is a G-node device
  • the expected role determined here is a G-node device.
  • the channel management module of the second electronic device may determine (or matching) the role information of the second electronic device, so that the obtained expected role of the second electronic device is different from the expected role of the first electronic device.
  • the expected role of the first electronic device is a T-node device
  • the expected role of the second electronic device determined by the channel management module of the second electronic device may be a G-node device .
  • the expected role of the first electronic device is a G-node device
  • the expected role of the second electronic device determined by the channel management module of the second electronic device may be a T-node equipment.
  • the expected role of the second electronic device may be determined according to the expected role of the first electronic device, so that the expected roles of the two electronic devices are different.
  • both electronic devices expect to be G-node devices or T-node devices, resulting in the same expected roles on both sides.
  • the expected roles and whether the roles can be negotiated can be indicated through the role information of both parties.
  • Negotiate so that the final roles of the parties differ.
  • role negotiation may be performed by the first electronic device, and if the negotiation is possible, the role of the first electronic device may be changed. For a specific description, refer to the specific description of S422 below.
  • the access information further includes address information of the second electronic device.
  • the address information of the second electronic device can finally be sent to the first electronic device, so that after the two electronic devices are successfully connected, the first electronic device can update the white list (refer to S434), and, between the two electronic devices After the authentication encryption is completed, the first electronic device saves the address of the second electronic device so as to regard the second electronic device as a trusted device (refer to S436).
  • the access information may further include: information for instructing the second electronic device to ignore the white list of the second electronic device.
  • the devices in the white list of the second electronic device are devices that have been connected to the second electronic device, and instructing the second electronic device to ignore the white list of the second electronic device means that the second electronic device can be connected to devices outside the white list.
  • the second electronic device In the case that the second electronic device has a white list, the second electronic device is not limited to connecting with the devices in the white list, but also wants to establish a connection with a new electronic device that has not been connected before. Therefore, the access information can carry Information for indicating to ignore the white list of the second electronic device. If the white list is enabled before the second electronic device, when connecting to the first electronic device for the first time, if the white list of the second electronic device is not ignored, other devices located around the second electronic device that have been connected to the second electronic device The electronic device may realize automatic connection with the second electronic device, and since the devices that the second electronic device can connect to are limited, it will affect the connection between the first electronic device and the second electronic device. Therefore, the information used to instruct the second electronic device to ignore the white list of the second electronic device makes the second electronic device not perform device connection based on the white list, which can further ensure the success of the first connection between the first electronic device and the second electronic device .
  • the access information may also include information indicating a sending period (interval) and information indicating a response time length (timeout). These parameters can be used for subsequent data transfers.
  • the sending cycle and response time are the parameters used in the process of transmitting data after the control channel is successfully established.
  • the sending period means the interval time for sending data
  • the response time means the effective time for sending the content for the data after receiving the data.
  • the controller of the second electronic device sends a first access request to the first electronic device according to the access information, where the first access request is used to request the first electronic device to access the second electronic device.
  • the controller of the first electronic device receives the first access request.
  • the controller sends a first access request based on the access information, where the first access request includes but not limited to: role information of the second electronic device and address information of the first electronic device.
  • the first access request further includes address information of the second electronic device, so that the first electronic device updates the whitelist after the first electronic device and the second electronic device are successfully connected (refer to S434), and, in After the authentication encryption is completed between the two electronic devices, the first electronic device saves the address of the second electronic device so as to regard the second electronic device as a trusted device (refer to S436).
  • the address information of the second electronic device may be obtained from the access information in S419.
  • the first access request may further include at least one of the following: information used to indicate a sending period (interval), and information used to indicate a response duration (timeout).
  • information used to indicate a sending period (interval)
  • information used to indicate a response duration timeout.
  • the above at least one item can be obtained from the access information in S419.
  • the first electronic device After receiving the first access request, the first electronic device performs related operations based on the first access request (S421-S428), to determine whether to agree to access the second electronic device to establish a connection with the second electronic device and In the case of agreeing to access the second electronic device, the establishment of the control channel is realized.
  • the controller of the first electronic device sends a second access request to the channel management module according to the first access request, to request the first electronic device to access the second electronic device, wherein the second access request includes the first 2. Role information of the electronic device.
  • the second access request further includes the address information of the second electronic device, which can enable the first electronic device and the second electronic device to save the address represented by the address information locally to save the address information of the second electronic device after completing the authentication and encryption process.
  • the second electronic device as a trusted device, refer to S436.
  • the address information of the second electronic device may be obtained from the first access request in S420.
  • the channel management module of the first electronic device determines final roles of the first electronic device and the second electronic device.
  • the channel management module determines the first electronic device and the second electronic device according to the role information of the first electronic device obtained from the first information in S413 and the role information of the second electronic device obtained from the second access request in S421. final role. It should be understood that the final role determined here may be the same as or different from the expected role of the electronic device. Below, in combination with Table 2, the process is described in two cases.
  • Table 2 takes the role information shown in Table 1 as an example, and shows the final roles of the two electronic devices determined based on various possible situations of the role information of the two electronic devices.
  • NA in the table indicates a non-existent case.
  • the second electronic device can determine a matching role according to the role information of the first electronic device, and will obtain a different expectation from the first electronic device.
  • Role in another case, the second electronic device itself wants to be the same desired role as the first electronic device, so the desired role of the second electronic device in this case is the same as the desired role of the first electronic device and non-negotiable. Therefore, there is no situation where the expected role of the first electronic device is not negotiable, but the expected role of the second electronic device is the same as that of the first electronic device and can be negotiated.
  • the channel management module determines the desired role of the first electronic device as the final role, and determines the desired role of the second electronic device as the final role.
  • the role information of the first electronic device is “00 (negotiable, T)" and the role information of the second electronic device is “01 (negotiable, G)” or “11 (non-negotiable, G) "
  • the role information of the first electronic device is "01 (negotiable, G)” and the role information of the second electronic device is “00 (negotiable, T)” or “10 (non-negotiable, T)”
  • the first The role information of the electronic device is “10 (non-negotiable, T)” and the role information of the second electronic device is "01 (negotiable, G)” or “11 (non-negotiable, G)”
  • the role information of the first electronic device is “11 (Non-negotiable, G)” and the role information of the second electronic device is "00 (Negotiable, T)” or “10 (Non-negotiable, T)"
  • Case 2 The expected role of the first electronic device is the same as the expected role of the second electronic device
  • the channel management module performs role negotiation to redefine the roles of the first electronic device and the second electronic device, so as to determine the final roles of both parties.
  • the final role may be determined according to whether the first electronic device and the second electronic device negotiate to replace the expected role of the first electronic device. In the following, three cases will be described in detail.
  • Case 2-1 The desired role of the first electronic device is negotiable, and the desired role of the second electronic device is negotiable
  • the expected role of the first electronic device is replaced, and the expected role of the second electronic device remains unchanged.
  • the final role of the first electronic device is the expected role after replacement, and the final role of the second electronic device is the expected role .
  • the role information of the first electronic device is "00 (negotiable, T)" and the role information of the second electronic device is "00 (negotiable, T)", and the role information of the first electronic device From “T" to "G”, the role of the second electronic device remains unchanged; for another example, the role information of the first electronic device is "01 (negotiable, G)" and the role information of the second electronic device is "01 (Negotiable, G)", the role of the first electronic device changes from “G” to "T”, and the role of the second electronic device remains unchanged.
  • Case 2-2 The expected role of the first electronic device is negotiable, but the expected role of the second electronic device is not negotiable
  • the expected role of the first electronic device is replaced, and the expected role of the second electronic device remains unchanged.
  • the final role of the first electronic device is the expected role after replacement, and the final role of the second electronic device is the expected role .
  • Table 2 for example, if the role information of the first electronic device is "00 (negotiable, T)" and the role information of the second electronic device is "10 (non-negotiable, T)", the first electronic device The role of the second electronic device changes from “T” to "G", and the role of the second electronic device remains "T”; for another example, if the role information of the first electronic device is "01 (negotiable, G)" and The role information of the second electronic device is "11 (non-negotiable, G)", then the role of the first electronic device changes from “G” to "T", and the role of the second electronic device remains "G”.
  • S426 and S427 may be directly executed to send the first request response to the second electronic device to indicate the access failure.
  • the role information of the first electronic device is "10 (non-negotiable, T)" and the role information of the second electronic device is "10 (non-negotiable, T)";
  • the role information of the electronic device is "11 (non-negotiable, G)" and the role information of the second electronic device is "11 (non-negotiable, G)".
  • the channel management module of the first electronic device sends a third access request to the basic application layer, so as to request the first electronic device to access the second electronic device.
  • the third access request includes information indicating the final role of the first electronic device and the final role of the second electronic device.
  • the basic application layer of the first electronic device performs capability judgment according to the third access request, so as to determine whether to allow the first electronic device to access the second electronic device.
  • whether to allow the first electronic device to access the second electronic device may be determined according to the number of electronic devices that the first electronic device can currently connect to. It should be understood that "current" here means the time when the second electronic device requests the first electronic device to access the second electronic device.
  • the number of electronic devices that the first electronic device can currently connect to is greater than or equal to 1, it means that the first electronic device has the ability to access the second electronic device, and the first electronic device can be allowed to access the second electronic device; if the first electronic device If the number of electronic devices that the device can currently connect to is 0, it means that the first electronic device is unable to connect to the second electronic device, and the first electronic device is not allowed to connect to the second electronic device.
  • the number of electronic devices that can be connected to the first electronic device itself is M, and M is an integer greater than or equal to 1.
  • M is an integer greater than or equal to 1.
  • the second electronic device requests the second electronic device to access the first electronic device, if the first electronic device The device is maintaining connection with M electronic devices, which means that the number of electronic devices that the first electronic device can currently connect to is 0, and it is temporarily unable to connect to the second electronic device to establish a connection.
  • the first electronic device does not agree to access the second electronic device. equipment; if the first electronic device is maintaining connection with less than M electronic devices, it means that the number of electronic devices that the first electronic device can currently connect to is greater than or equal to 1, and it has the ability to access the second electronic device, agreeing to the first The electronic device is connected to the second electronic device.
  • the third access request is reported to the APP (for example, setting), and the APP displays the information for requesting the first electronic device to access the second electronic device.
  • request if the user rejects the request, it means that the first electronic device is incapable of accessing the second electronic device, and if the user accepts the request, it means that the first electronic device has the ability to access the second electronic device. access the second electronic device, and agree that the first electronic device accesses the second electronic device.
  • the basic application layer of the first electronic device sends a third request response in response to the third access request to the channel management module, where the third request response is used to indicate that the first electronic device is allowed to access the second electronic device. equipment.
  • the third request response indicates that the first electronic device is allowed to access the second electronic device.
  • the third request response indicates that the first electronic device is not allowed to access the second electronic device.
  • the third request response can also be used to indicate the reason why the first electronic device is not allowed to access the second electronic device, and the reason can be determined based on the capability conditions are shown. For example, if in S424 the capability judgment is based on the number of electronic devices that the first electronic device can currently connect to, the reason may be that the resources of the first electronic device are limited; if in S424 the capability judgment is based on user operations , the reason can be user rejection.
  • the channel management module of the first electronic device sends a second request response to the controller, where the second request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the channel management module may finally determine whether the first electronic device is allowed to access the second electronic device based on the third request response sent in S425 and the process of determining the final roles of both parties in S423-S425, and report to the control
  • the controller sends a second request response for indicating whether to allow the first electronic device to access the second electronic device.
  • the third request response indicates that the first electronic device agrees to access the second electronic device and the channel management module successfully determines the final roles of both parties, which means that the first electronic device can access the second electronic device, so the second The request response is used to indicate that the first electronic device is allowed to access the second electronic device.
  • the third request response indicates that the first electronic device is not allowed to access the second electronic device and the channel management module successfully determines the final roles of both parties, which means that the first electronic device cannot access the second electronic device. Therefore, The second request response is used to indicate that the first electronic device is not allowed to access the second electronic device.
  • the second request response may also be used to indicate a reason for not agreeing to access the second electronic device.
  • the reason may be determined based on actual conditions. Exemplarily, the reason may be either resource limitation of the first electronic device or rejection by the user.
  • the channel management module fails to determine the final roles of both parties in S422, the first electronic device may directly execute S426 and S427, and the process ends without executing S423 and S424.
  • the channel management module may only determine whether to allow the first electronic device to access the second electronic device based on the final roles of both parties determined in S422. If the channel management module successfully determines the final roles of both parties, the second request response is used to indicate that the first electronic device is allowed to access the second electronic device; if the channel management module fails to determine the final roles of both parties, the second request response is used to Indicating that the first electronic device is not allowed to access the second electronic device.
  • the controller of the first electronic device sends a first request response in response to the first access request to the second electronic device, where the first request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the controller determines and sends the first request response based on the second request response. It should be understood that the first request-response has at least the same function as the second request-response, but because the sender and receiver of the two request-responses are different, the formats of the two request-responses may be different.
  • the process termination If the first request response indicates that the first electronic device is allowed to access the second electronic device, continue to execute S428 and S429, and if the first request response indicates that the first electronic device is not allowed to access the second electronic device, the process termination.
  • the controller of the first electronic device sends the logical channel identification (LCID) to the channel management module
  • the controller of the second electronic device sends the logical channel identification (LCID) to the channel management module according to the received first request response information ).
  • the controller of the first electronic device establishes a logical channel, and sends the LCID of the established logical channel to the channel management module after the logical channel is established.
  • the controller of the second electronic device establishes a logical channel after receiving the first request response, and sends the LCID of the established logical channel to the channel management module after the logical channel is established.
  • the desired G node device calculates the LCID, and sends the LCID to the peer device (for example, the second electronic device), so that the two ends LCIDs agree.
  • the controller of the first electronic device receives the second request response or the controller sends the first request response
  • the controller of the first electronic device establishes a logical channel identified by the LCID, and sends the LCID to the channel management module.
  • the controller of the second electronic device establishes a logical channel identified by the LCID, and sends the LCID to the channel management module.
  • the control channel is a channel designed in the basic service layer. After the logical channel is established, the corresponding control channel can be used. In this way, when the logical channel of the first electronic device is established, the channel management module can determine the control channel corresponding to the LCID based on the LCID to use the corresponding control channel; similarly, when the logical channel of the second electronic device is established, The channel management module can determine the corresponding control channel based on the LCID, so as to use the corresponding control channel, thereby realizing the establishment of the control channel between electronic devices.
  • the channel management module of the first electronic device sends information for instructing to stop broadcasting to the device discovery module.
  • the device discovery module can stop sending broadcast events, so that the first electronic device stops broadcasting current events, which saves power consumption.
  • the channel management module can clearly know that the first electronic device is in the broadcast state, therefore, after the control channel is established, notify the device discovery module to stop broadcasting, Save power consumption. Therefore, the information for instructing to stop broadcasting may be understood as information responding to the broadcast state information carried in the first information.
  • S431 the first electronic device and the second electronic device perform authentication and encryption of the control channel.
  • This step can be understood as a security process, the purpose of which is to ensure the secure transmission of data and protect user privacy.
  • the channel management module of the first electronic device sends a security request to the security management module, and the security request includes the address of the second electronic device, and the security management module conducts a process based on the security request and the second electronic device.
  • the second electronic device and the first electronic device perform authentication and encryption on the control channel, and finally generate a key for subsequent encryption of data
  • the security management modules of the first electronic device and the second electronic device send to their respective channel management modules Information used to indicate the completion of authentication and encryption.
  • the first electronic device and the second electronic device may regard the peer as their trusted device, and their respective notification management modules save the address of the peer, as shown in S436 and S437.
  • the channel management module of the first electronic device sends information indicating that the control channel is available to the basic application layer
  • the channel management module of the second electronic device sends information indicating that the control channel is available to the basic application. information.
  • the basic application layer can be sure that the control channel has been established successfully, and can initiate subsequent service channel establishment and data transmission.
  • S432 may be performed after S428 or S430, and S433 may be performed after S429.
  • the first electronic device updates the whitelist, that is, saves the address of the second electronic device in the whitelist, so as to realize automatic connection when it needs to connect with the second electronic device again later.
  • the channel management module of the first electronic device may send update information to the controller indicating to update the white list, and the controller saves the address of the second electronic device to the white list based on the update information. list. In this way, the white list is updated after the authentication and encryption is completed, ensuring security.
  • step of updating the whitelist by the first electronic device may also be performed in any step after S419.
  • the controller updates the white list after the establishment of the control channel of the first electronic device is completed.
  • the controller of the first electronic device obtains the address of the second electronic device from the first access request, and stores it in the whitelist to update the whitelist.
  • the second electronic device updates the white list, that is, saves the address of the first electronic device in the white list, so as to realize automatic connection when it needs to connect with the first electronic device again later.
  • the channel management module of the second electronic device may send update information to the controller indicating to update the white list, and the controller saves the address of the first electronic device to the white list based on the update information. list. In this way, the white list is updated after the authentication and encryption is completed, ensuring security.
  • step of updating the whitelist by the second electronic device may also be performed in any step after S418.
  • the controller updates the white list after the establishment of the control channel of the second electronic device is completed.
  • the controller of the second electronic device obtains the address of the first electronic device from the access information, and stores it in the white list to update the white list.
  • the first electronic device saves attribute information related to the control channel, and the attribute information includes but not limited to: key, address of the second electronic device, state of the control channel, and role of the first electronic device.
  • the key is the key obtained by performing the authentication and encryption process in S431.
  • the address of the second electronic device may be obtained from the second access request in S421. If the control channel is not established successfully, the state of the control channel is connected; if the control channel is established successfully, the state of the control channel is connected; if the control channel is being established, the state of the control channel is connected.
  • the role of the first electronic device indicates the final role of the first electronic device.
  • the second electronic device saves attribute information related to the control channel, the attribute information includes but not limited to: key, address of the first electronic device, state of the control channel, role of the second electronic device .
  • the key is the key obtained by performing the authentication and encryption process in S431.
  • the address of the first electronic device can be obtained from the second information in S418. If the control channel is not successfully established, the state of the control channel is connected. If the control channel is established, the state of the control channel is connected. If the control channel is being established, the state of the control channel is connected. The role of the second electronic device indicates the final role of the second electronic device.
  • FIG. 5 is a schematic flowchart of a method 500 for device connection provided by an embodiment of the present application.
  • the method 500 describes a process in which the first electronic device and the second electronic device establish a control channel based on the SLB to realize the first connection.
  • the vehicle center console is a G-node device, and devices such as mobile phones, cameras, car speakers, or rearview mirrors in the car can be T-node devices.
  • the first electronic device may be a vehicle center console
  • the second electronic device may be a device in the vehicle such as a mobile phone, a camera, a vehicle sound box, or a rearview mirror.
  • the process of method 500 is similar to that of method 400, and also includes the above-mentioned process 1 and process 2, and there are some differences in the specific steps of each process.
  • the first electronic device sends a broadcast message, and the second electronic device performs related operations based on the broadcast message.
  • the basic application layer of the first electronic device sends a notification event to the device discovery module of the basic service layer, and the notification event is used to determine that the access technology used by the first electronic device to communicate with other electronic devices is SLB.
  • the notification event includes information indicating a user's operation on the first electronic device.
  • the user's operation on the first electronic device may be that the user turns on the vehicle center console so that the vehicle center console is powered on.
  • the basic application layer obtains the user's operation on the first electronic operation, and sends the operation to the device discovery module of the basic service layer, so that the device discovery module can determine that the first electronic device communicates with other electronic devices using access technology.
  • the notification event includes information indicating that the access technology is SLB.
  • the basic application layer acquires the user's operation on the first electronic device, and based on the operation, determines that the access technology used by the first electronic device to communicate with other electronic devices is SLB.
  • the device discovery module of the first electronic device configures and sends a broadcast event to the controller, where the broadcast event includes broadcast parameters.
  • the broadcast event further includes device filtering information used to indicate the device requesting access to the first electronic device.
  • the device filtering information is used to indicate that the first electronic device is allowed to access the first electronic device. Devices inside and outside the list, that is, allowing the first electronic device to access all devices that request access to the first electronic device, wherein the devices in the white list of the first electronic device have been connected to the first electronic device equipment.
  • the device discovery module of the first electronic device sends broadcast status information indicating the broadcast status of the first electronic device to the channel management module according to the notification event.
  • broadcast state information For a specific description of the broadcast state information, refer to the relevant description in S413 above, and details are not repeated here.
  • the controller of the first electronic device sends a broadcast message according to the broadcast event.
  • the controller determines a broadcast message based on the broadcast event received in S512 and sends the broadcast message, where the broadcast message includes but not limited to: system message and address information of the first electronic device.
  • the system message is used to allocate resources to the peer device (for example, the second electronic device), including but not limited to: the sending period of the system message (domainSysInforPeriod), the number of consecutive superframes in a sending period of the system message (domainSysInforOnDuartion), Non-contention access resource, contention access resource, type of device allowed to access (for example, vehicle-mounted device)
  • the format of the broadcast message in S514 is the format of the broadcast message corresponding to the SLB.
  • S512 may be performed before or after S513 or may be performed simultaneously with S513, and S514 may be performed before or after S513 or may be performed simultaneously with S513.
  • the basic application layer of the second electronic device sends scanning mode information to the device discovery module, where the scanning mode information is used to indicate that the scanning mode of the second electronic device is a default scanning mode.
  • the device discovery module of the second electronic device configures and sends scanning parameters to the controller based on the default scanning mode.
  • the controller of the second electronic device scans the surrounding devices based on the scan parameters, scans the broadcast message of the first electronic device, obtains the scan result based on the broadcast message, and sends the scan result to the basic application layer through the device discovery module , that is, the controller sends the scan result to the device discovery module, and the device discovery module sends the scan result to the basic application layer.
  • the scan result includes obtaining the address information of the first electronic device from the broadcast message.
  • the broadcast message of the first electronic device is in a format corresponding to SLB, only when the second electronic device supports SLB can the second electronic device successfully parse the broadcast message sent by the first electronic device, and can successfully Execute S517.
  • the basic application layer of the second electronic device sends the second information to the channel management module according to the scanning result.
  • the second information may be the scanning result in S517, that is, the second information includes address information of the first electronic device.
  • the second information may further include: the access technology used by the second electronic device to communicate with the first electronic device is SLB.
  • the basic application layer may send the second information to the channel management module according to the user operation and the scanning result obtained in S517.
  • the channel management module may send the second information to the channel management module according to the user operation and the scanning result obtained in S517.
  • Process 2 The first electronic device and the second electronic device establish a control channel.
  • the channel management module of the second electronic device sends the access information to the controller according to the second information.
  • the channel management module determines access information according to the second information, and sends the access information to the controller.
  • the access information includes address information of the first electronic device, and the address information of the first electronic device is obtained from the second information.
  • the access information further includes address information of the second electronic device.
  • the address information of the second electronic device can finally be sent to the first electronic device, so that after the two electronic devices are successfully connected, the first electronic device can update the white list (refer to S533), and, between the two electronic devices After the authentication encryption is completed, the first electronic device saves the address of the second electronic device so as to regard the second electronic device as a trusted device (refer to S535).
  • the access information may further include: information for instructing the second electronic device to ignore the whitelist of the second electronic device.
  • information for instructing the second electronic device to ignore the whitelist of the second electronic device For a specific description of this information, reference may be made to related descriptions of S419 , and details are not repeated here.
  • the controller of the second electronic device sends a first access request to the first electronic device according to the access information, where the first access request is used to request the first electronic device to access the second electronic device.
  • the controller of the first electronic device receives the first access request. And, the controller sends a first access request based on the access information, where the first access request includes address information of the first electronic device.
  • the first access request further includes address information of the second electronic device, so that the first electronic device updates the whitelist after the first electronic device and the second electronic device are successfully connected (refer to S533), and, in After the authentication encryption is completed between the two electronic devices, the first electronic device saves the address of the second electronic device so as to regard the second electronic device as a trusted device (refer to S535).
  • the address information of the second electronic device may be obtained from the access information in S519.
  • the first electronic device After receiving the first access request, the first electronic device performs related operations based on the first access request (S521-S527), to determine whether to agree to access the second electronic device to establish a connection with the second electronic device and In the case of agreeing to access the second electronic device, the establishment of the control channel is realized.
  • the controller of the first electronic device sends a second access request to the channel management module, for requesting the first electronic device to access the second electronic device.
  • the second access request includes the address information of the second electronic device, which can make the channel management module save the address indicated by the address information locally after completing the authentication and encryption process so as to use the second electronic device as a trusted For equipment, refer to S535.
  • the address information of the second electronic device may be obtained from the first access request in S520.
  • the channel management module of the first electronic device sends a third access request to the basic application layer.
  • the basic application layer of the first electronic device performs capability judgment according to the third access request, so as to determine whether to allow the first electronic device to access the second electronic device. For specific descriptions, reference may be made to related descriptions of S424, and details are not repeated here.
  • the basic application layer of the first electronic device sends a third request response to the channel management module, where the third request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the third request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the channel management module of the first electronic device sends a second request response to the controller, where the second request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the second request response indicates that the first electronic device is allowed to access the second electronic device; if the third request response indicates that the first electronic device is not allowed to access For the second electronic device, the second request response indicates that the first electronic device is not allowed to access the second electronic device.
  • the second request-response has at least the same function as the first request-response, but because the sender and receiver of the two request-responses are different, the formats of the two request-responses may be different.
  • the second request response may also be used to indicate a reason for not agreeing to access the second electronic device.
  • the reason may be determined based on the actual situation. Exemplarily, the reason may be resource limitation of the first electronic device or rejection by the user.
  • the controller of the first electronic device sends a first request response in response to the first access request to the second electronic device, where the first request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the controller determines and sends the first request response based on the second request response. It should be understood that the first request-response has at least the same function as the second request-response, but because the sender and receiver of the two request-responses are different, the formats of the two request-responses may be different.
  • the process termination If the first request response indicates that the first electronic device is allowed to access the second electronic device, continue to execute S527 and S528, and if the first request response indicates that the first electronic device is not allowed to access the second electronic device, the process termination.
  • the controller of the first electronic device sends the LCID to the channel management module
  • the controller of the second electronic device sends the LCID to the channel management module.
  • the channel management module of the first electronic device sends information for instructing to stop broadcasting to the device discovery module.
  • the channel management module of the first electronic device sends information for instructing to stop broadcasting to the device discovery module.
  • the first electronic device and the second electronic device perform authentication and encryption of the control channel.
  • the first electronic device and the second electronic device perform authentication and encryption of the control channel.
  • the channel management module of the first electronic device sends information indicating that the control channel is available to the basic application layer
  • the channel management module of the second electronic device sends information indicating that the control channel is available to the basic application. information.
  • the channel management module of the second electronic device sends information indicating that the control channel is available to the basic application. information.
  • the first electronic device updates the whitelist.
  • the second electronic device updates the whitelist.
  • the first electronic device saves attribute information related to the control channel, where the attribute information includes but not limited to: a key, an address of the second electronic device, and a state of the control channel.
  • attribute information includes but not limited to: a key, an address of the second electronic device, and a state of the control channel.
  • the second electronic device saves attribute information related to the control channel, where the attribute information includes but not limited to: a key, an address of the first electronic device, and a state of the control channel.
  • attribute information includes but not limited to: a key, an address of the first electronic device, and a state of the control channel.
  • This scenario describes the automatic connection between electronic devices, mainly connecting devices saved in the whitelist. Take the headset and mobile phone as an example. The headset and the mobile phone have been connected once, and the subsequent headset can be automatically connected to the mobile phone when the box is opened.
  • the main difference between the embodiment of this scenario and the first connection in Scenario 1 is that the second electronic device is configured in the automatic connection scanning mode, and the controller of the second electronic device does not need to report the scan to the upper layer after scanning the device on the white list. As a result, an access request can be directly initiated, and the second electronic device can be configured with a single-device connection mode and a multi-device connection mode.
  • FIG. 6 is a schematic flowchart of a method 600 of the device provided by the embodiment of the present application.
  • the method 600 describes a process in which the first electronic device and the second electronic device establish a control channel based on the SLE.
  • the first electronic device may be an earphone
  • the second electronic device may be a mobile phone.
  • method 600 is similar to that of method 400, including the above-mentioned process 1 and process 2 of method 400, and there are some differences in the specific steps of each process.
  • the first electronic device sends a broadcast message, and the second electronic device performs related operations based on the broadcast message.
  • the basic application layer of the first electronic device sends a notification event to the device discovery module of the basic service layer, where the notification event is used to determine role information of the first electronic device.
  • the notification event includes information for instructing a user's operation on the first electronic device.
  • the first electronic device is a headset, for example, the user’s operation on the first electronic device may be to open the earphone box or press a long button; if the first electronic device is a mobile phone, for example, the user’s operation on the second An operation of an electronic device may be to turn on a switch related to SLE in settings; if the first electronic device is a keyboard, for example, the user's operation on the first electronic device may be to press a physical switch for connection.
  • the basic application layer obtains the user's operation on the first electronic operation, and sends the operation to the device discovery module of the basic service layer, so that the device discovery module can determine that the first electronic device communicates with other electronic devices using
  • the access technology is SLE, and role information of the first electronic device is determined.
  • the notification event includes information indicating that the access technology is SLE.
  • the basic application layer obtains the user's operation on the first electronic device, and based on the operation, determines that the access technology used by the first electronic device to communicate with other electronic devices is SLE, so that the device discovery module can determine the first Role information of electronic devices.
  • the notification event includes role information of the first electronic device.
  • the basic application layer obtains the user's operation on the first electronic device, determines based on the operation that the access technology used by the first electronic device to communicate with other electronic devices is SLE, and determines the role information of the first electronic device .
  • the device discovery module of the first electronic device configures and sends a broadcast event to the controller, where the broadcast event is used to indicate a broadcast policy, including other parameters used for broadcast. .
  • the broadcast event is used to indicate a broadcast policy, including other parameters used for broadcast.
  • the broadcast event further includes role information of the first electronic device.
  • the broadcast event further includes device filtering information used to indicate the device requesting access to the first electronic device, and for automatic connection, the device filtering information is used to indicate that only the first electronic device is allowed to access the first electronic device Devices in the white list, so as to realize the automatic connection process between the first electronic device and the once connected electronic device (for example, the second electronic device).
  • the device discovery module of the first electronic device sends the first information to the channel management module according to the notification event.
  • the device discovery module of the first electronic device sends the first information to the channel management module according to the notification event.
  • the controller of the first electronic device sends a broadcast message according to the broadcast event.
  • the broadcast message includes but not limited to the following: address information of the first electronic device, role information of the first electronic device, broadcast mode (adv mode), and broadcast flag (adv flag).
  • address information of the first electronic device includes but not limited to the following: address information of the first electronic device, role information of the first electronic device, broadcast mode (adv mode), and broadcast flag (adv flag).
  • broadcast mode adv mode
  • broadcast flag adv flag
  • the broadcast message may further include: address information of the second electronic device, so that the first electronic device can automatically connect with the second electronic device. In this way, automatic connection between the first electronic device and the specific device can be realized.
  • the address information of the second electronic device can be obtained from the white list of the first electronic device.
  • S612 may be performed before or after S613 or may be performed simultaneously with S613
  • S614 may be performed before or after S613 or may be performed simultaneously with S613.
  • the basic application layer of the second electronic device sends scanning mode information to the device discovery module, where the scanning mode information is used to indicate that the scanning mode of the second electronic device is an automatic connection scanning mode.
  • the automatic connection scanning mode needs to scan the surrounding devices under certain restrictions or filter out some devices.
  • the basic application layer can set the first electronic device to the automatic connection scanning mode based on the following various trigger conditions: after the first electronic device and the second electronic device are disconnected due to distance, etc. Switch to automatic scanning within a preset time period; or, periodically switch between the automatic connection scanning mode and the default scanning mode; or, the user manually clicks on the connected device on the application interface of the second electronic device to make the basic application
  • the layer triggers an automatic connection scan.
  • the device discovery module of the second electronic device configures and sends scanning parameters and connection parameters to the controller based on the automatic connection scanning mode.
  • connection parameters include but not limited to the following: role information of the second electronic device, connection mode, and enabled whitelist.
  • the role information of the second electronic device may be determined by the expected role of the second electronic device itself, which is used to indicate that the expected role of the second electronic device is a G-node device or a T-node device.
  • the device information of the second electronic device It is also used to indicate whether the role of the second electronic device can be negotiated, so as to determine the final role of the second electronic device.
  • the connection mode is single-device connection mode or multi-device connection mode.
  • the single-device connection mode means that the second electronic device can only establish a connection with one device in the same time period
  • the multi-device connection mode means that the second electronic device can establish connections with multiple devices in the same time period.
  • the maximum number of devices that can be connected to the second electronic device is used to indicate a single-device connection mode or a multi-device connection mode, and if the maximum number of devices that can be connected to the second electronic device is 1, it indicates a single-device connection mode, If the maximum number of devices that can be connected to the second electronic device is greater than 1, it indicates a multi-device connection mode.
  • the connection parameters not only include the connection mode, but also indicate the maximum number of devices that the second electronic device can connect to.
  • Enabling the whitelist means enabling the controller of the second electronic device to use the whitelist. After the controller scans the devices in the white list, it does not need to report the scanning results to the upper layer, and can directly initiate an access request.
  • connection mode may not be included in the connection parameters, and the second electronic device will connect based on the connection mode supported by itself by default.
  • connection mode For SLE, two connection modes can be supported, and for SLB, only a single-device connection mode can be supported.
  • connection parameter may further include at least one of the following: information indicating a sending period (interval), and information indicating a response duration (timeout).
  • information indicating a sending period (interval)
  • information indicating a response duration (timeout)
  • S615 and S616 and S611-S614 is not fixed and can be changed arbitrarily as long as S615 and S616 are executed before S617.
  • S615 and S616 may be executed before or after S611-S614 or simultaneously.
  • S615 and S616 may be performed before or after any one of steps S611-S614 or may be performed simultaneously.
  • connection mode is the single-device connection mode
  • the controller of the second electronic device scans the surrounding devices according to the scanning parameters and connection parameters, and after scanning to the first electronic device in the white list of the second electronic device, directly Execute S618 (that is, send the first access request), and stop scanning.
  • connection mode is the multi-device connection mode
  • the controller of the second electronic device scans the surrounding devices according to the scanning parameters and connection parameters, and after scanning to the first electronic device in the white list of the second electronic device, execute S618, and, if the preset condition is satisfied, the scanning is stopped, and if the preset condition is not satisfied, the scanning is continued.
  • the preset condition may be: the scan timer expires.
  • the controller may determine whether to stop scanning according to the duration of the scan timer. Specifically, if the scan timer in the controller of the second electronic device expires, the scan is stopped; otherwise, if the scan timer in the controller of the second electronic device does not expire, the scan continues.
  • the preset condition may be: the first electronic device is the Nth device scanned by the controller, and the N devices including the first electronic device scanned by the controller are white and white of the second electronic device. devices in the list.
  • the controller may determine whether to stop scanning according to the maximum number N of devices belonging to the white list that the second electronic device can connect to, where N is an integer greater than 1. That is to say, if the controller scans that the number of devices in the white list reaches the maximum number N of devices that can be connected to the second electronic device, it stops scanning; otherwise, if the controller scans that the number of devices in the white list does not reach the second electronic device The device is able to connect to the maximum number of devices N, then continue scanning.
  • the controller has scanned the N devices in the whitelist, reaching the maximum number N. If other devices are not considered to be disconnected halfway, it means that the second electronic device has a high probability of maintaining connection with N devices at the same time, and the controller stops Scanning; if the first electronic device scanned by the controller is not the Nth electronic device, then the controller has not scanned the N devices in the white list, plus the device scanned by the controller before plus the first electronic device scanned now , if the maximum number N is not reached, the controller continues to scan.
  • the preset condition may be: the first electronic device is the Nth device scanned by the controller and the second electronic device has completed the establishment of the control channel, and all the devices scanned by the controller including the first electronic device The N devices are devices in the white list of the second electronic device.
  • the controller of the second electronic device completes the establishment of the logical channel and sends the LCID to the channel management module, that is, after the controller executes S627, it indicates that the second electronic device has completed the establishment of the control channel.
  • the second electronic device completes the establishment of the control channel".
  • another expression of the above preset condition may be: the first electronic device is the Nth device scanned by the controller and the controller of the second electronic device has sent the LCID to the channel management module (or basic service layer).
  • the controller determines whether to stop scanning according to the maximum number N of devices belonging to the white list that the second electronic device can connect to and whether the second electronic device completes the establishment of the control channel. That is to say, if the controller scans that the number of devices in the white list reaches the maximum number N of devices that the second electronic device can connect to and the second electronic device completes the establishment of the control channel, it stops scanning; otherwise, if the controller scans the white list The number of devices in the list reaches the maximum number N of devices that can be connected to the second electronic device, but the second electronic device has not completed the establishment of the control channel, then continue to scan, or, if the controller scans the number of devices in the white list does not reach The maximum number N of devices that the second electronic device can connect to, then continue to scan.
  • the controller has scanned N devices in the whitelist, reaching the maximum number N, and the second electronic device The device has completed the establishment of the control channel, which means that the second electronic device is successfully connected to the first electronic device, and it is further guaranteed that the second electronic device will maintain a high probability of keeping up with N devices at the same time, regardless of the disconnection of other devices.
  • the controller stops scanning; if the first electronic device scanned by the controller is the Nth electronic device scanned by the controller, it means that the controller has scanned N devices in the white list, reaching the maximum number N, but , the second electronic device has not completed the establishment of the control channel, that is, the failure to establish the control channel means that the second electronic device has not successfully connected with the first electronic device.
  • the actual connected devices are still N-1, if the maximum number N is not reached, the controller will continue to scan; if the first electronic device scanned by the controller is not the Nth electronic device, the controller will continue to scan.
  • the preset condition may be: when the scan timer of the controller has not expired, the first electronic device is the Nth device scanned by the controller, and the device scanned by the controller includes the first electronic device
  • the N devices included are devices in the white list of the second electronic device.
  • the controller may determine whether to stop scanning according to the maximum number N of devices belonging to the white list that the second electronic device can connect to if the scan timer does not expire. That is to say, if the scan timer in the controller does not expire and the number of devices in the whitelist scanned by the controller reaches the maximum number N of devices that can be connected to the second electronic device, the controller stops scanning; otherwise, if the controller The scan timer in the white list has not expired, but the controller scans and finds that the number of devices in the white list does not reach the maximum number N of devices that can be connected to the second electronic device, then the controller continues to scan. Of course, if the scan timer times out, the controller also stops scanning.
  • the controller has scanned N devices in the whitelist, When the maximum number N is reached, regardless of other devices being disconnected halfway, it means that the second electronic device has a high probability of maintaining connection with N devices at the same time, and the controller stops scanning; if the scan timer of the controller does not expire and The first scanned electronic device is not the Nth electronic device, then the controller does not scan N devices in the white list, and the maximum number N is not reached, the controller continues to scan; if the scan timer times out, the control to stop scanning.
  • the preset condition may be: when the scan timer of the controller has not expired, the first electronic device is the Nth device scanned by the controller and the second electronic device completes the establishment of the control channel ( Execute S627).
  • the controller can determine whether to stop the operation according to the maximum number N of devices belonging to the white list that the second electronic device can connect to and whether the second electronic device has completed the establishment of the control channel. scanning.
  • the controller has scanned N devices in the whitelist, The maximum number N is reached, and the second electronic device has completed the establishment of the control channel, which means that the second electronic device is successfully connected to the first electronic device, and further ensures that the second electronic device is disconnected without considering other devices.
  • the device will maintain connection with N devices at the same time with a high probability, and the controller stops scanning; if the scan timer of the controller does not expire, the first electronic device scanned by the controller is the Nth electronic device scanned by the controller, then , the controller has scanned N devices in the white list, reaching the maximum number N, but the second electronic device has not completed the establishment of the control channel, which means that the second electronic device has not successfully connected with the first electronic device, regardless of other When the device is disconnected halfway, the second electronic device is actually connected to N-1 devices, and the maximum number N is not reached, the controller continues to scan; if the scan timer of the controller does not expire, and the first electronic device scanned If the device is not the Nth electronic device, then the controller does not scan N devices in the white list, and the maximum number N is not reached, the controller continues to scan; if the scan timer times out, the controller stops scanning.
  • the broadcast message includes the address information of the second electronic device
  • the first electronic device wants to connect with the second electronic device, so whether in single-device connection mode or multi-device connection mode, the second electronic device
  • the electronic device executes S618 when receiving the address information of the second electronic device.
  • the address information of the second electronic device is obtained from the white list of the first electronic device, indicating that the first electronic device and the second electronic device have been connected before, so the first electronic device is also a white list of the second electronic device. devices in the list.
  • the second electronic device cannot be automatically connected even if it can be automatically connected.
  • the user of the second electronic device used someone else's device before, so the user sets the other person's device not to automatically connect.
  • the basic application layer of the second electronic device sends device information to the channel management module according to user settings, where the device information is used to indicate a device not to be automatically connected.
  • the user may set devices not to be automatically connected on the interface of the application.
  • the channel management module of the second electronic device sends a deletion request to the controller, the deletion request includes device information indicating the device not to be automatically connected, and the controller deletes the device information in the whitelist based on the device information in the deletion request device indicated. In this way, if the device indicated in the device information subsequently needs to be connected to the second electronic device, the embodiment of the method 400 is executed.
  • Process 2 The first electronic device and the second electronic device establish a control channel.
  • the controller of the second electronic device sends a first access request to the first electronic device, where the first access request is used to request the first electronic device to access the second electronic device.
  • the controller of the first electronic device sends a second access request to the channel management module according to the first access request, so as to request the first electronic device to access the second electronic device, wherein the second access request includes the first 2. Role information of the electronic device.
  • the channel management module of the first electronic device determines final roles of the first electronic device and the second electronic device.
  • the channel management module of the first electronic device sends a third access request to the basic application layer, so as to request the first electronic device to access the second electronic device.
  • the third access request includes information indicating the final role of the first electronic device and the final role of the second electronic device.
  • the basic application layer of the first electronic device performs capability judgment according to the third access request to determine whether to allow the first electronic device to access the second electronic device.
  • the basic application layer of the first electronic device sends a third request response in response to the third access request to the channel management module, where the third request response is used to indicate that the first electronic device is allowed to access the second electronic device. equipment.
  • the channel management module of the first electronic device sends a second request response to the controller, where the second request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the controller of the first electronic device sends a first request response in response to the first access request to the second electronic device, where the first request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the controller of the first electronic device sends the logical channel identifier (LCID) to the channel management module
  • the controller of the second electronic device sends the logical channel identifier (LCID) to the channel management module.
  • the channel management module of the first electronic device sends information for instructing to stop broadcasting to the device discovery module.
  • the channel management module of the first electronic device sends information indicating that the control channel is available to the basic application layer
  • the channel management module of the second electronic device sends information indicating that the control channel is available to the basic application. information.
  • FIG. 7 is a schematic flowchart of a method 700 for device connection provided by an embodiment of the present application.
  • the method 700 describes a process in which the first electronic device and the second electronic device establish a control channel based on the SLB to realize automatic connection.
  • the process of method 700 is similar to that of method 400, and also includes the above-mentioned process 1 and process 2, and there are some differences in the specific steps of each process.
  • the first electronic device sends a broadcast message, and the second electronic device performs related operations based on the broadcast message.
  • the basic application layer of the first electronic device sends a notification event to the device discovery module of the basic service layer, where the notification event is used to determine the access technology used by the first electronic device to communicate with other electronic devices.
  • the notification event is used to determine the access technology used by the first electronic device to communicate with other electronic devices.
  • the device discovery module of the first electronic device configures and sends a broadcast event to the controller, where the broadcast event includes parameters for broadcast.
  • the broadcast event further includes device filtering information used to indicate the device requesting access to the first electronic device, and for automatic connection, the device filtering information is used to indicate that only the first electronic device is allowed to access the first electronic device Devices included in the whitelist.
  • the device discovery module of the first electronic device sends broadcast status information for indicating the broadcast status of the first electronic device to the channel management module according to the notification event.
  • broadcast state information For a specific description of the broadcast state information, refer to the relevant description in S513 above, and details are not repeated here.
  • the controller of the first electronic device sends a broadcast message according to the broadcast event.
  • the broadcast message includes a system message, and the system message includes but not limited to: address information and resource allocation information of the first electronic device.
  • the broadcast message may further include: address information of the second electronic device, so that the first electronic device can automatically connect with the second electronic device. In this way, automatic connection between the first electronic device and the specific device can be realized.
  • the address information of the second electronic device can be obtained from the white list of the first electronic device.
  • S712 can be executed before or after S713 or can be executed simultaneously with S713
  • S714 can be executed before or after S713 or can be executed simultaneously with S713.
  • the basic application layer of the second electronic device sends scanning mode information to the device discovery module, where the scanning mode information is used to indicate that the scanning mode of the second electronic device is an automatic connection scanning mode.
  • the scanning mode information is used to indicate that the scanning mode of the second electronic device is an automatic connection scanning mode.
  • the device discovery module of the second electronic device configures and sends scanning parameters and connection parameters to the controller based on the automatic connection scanning mode.
  • connection parameters include: enable whitelist.
  • enable whitelist For a specific description of enabling the whitelist, refer to the relevant description of S616, and details are not repeated here.
  • connection parameters further include: a connection mode, which is a single-device connection mode.
  • connection parameters may not include the connection mode, and the second electronic device will connect based on the single-device connection mode supported by itself by default.
  • S715 and S716 and S711-S714 is not fixed and can be changed arbitrarily as long as S715 and S716 are executed before S717.
  • S715 and S716 may be executed before or after S711-S714 or simultaneously.
  • S715 and S716 may be performed before or after any one of steps S711-S714 or may be performed simultaneously.
  • the controller of the second electronic device scans the surrounding devices according to the scanning parameters and connection parameters, and after scanning to the first electronic device in the white list of the second electronic device, directly execute S718 (ie, send the first access request), stop scanning.
  • the second electronic device cannot be automatically connected even if it can be automatically connected.
  • the user of the second electronic device used someone else's device before, so the user sets the other person's device not to automatically connect.
  • the basic application layer of the second electronic device sends device information to the channel management module according to user settings, where the device information is used to indicate a device not to be automatically connected.
  • the channel management module of the second electronic device sends a deletion request to the controller, the deletion request includes device information indicating the device not to be automatically connected, and the controller deletes the device information in the whitelist based on the device information in the deletion request device indicated. In this way, if the device indicated in the device information subsequently needs to be connected to the second electronic device, the embodiment of the method 400 is executed.
  • Process 2 The first electronic device and the second electronic device establish a control channel.
  • the controller of the second electronic device sends a first access request to the first electronic device according to the access information, where the first access request is used to request the first electronic device to access the second electronic device.
  • the controller of the first electronic device sends a second access request to the channel management module, for requesting the first electronic device to access the second electronic device.
  • the channel management module of the first electronic device sends a third access request to the basic application layer.
  • the basic application layer of the first electronic device performs capability judgment according to the third access request, so as to determine whether to allow the first electronic device to access the second electronic device.
  • the basic application layer of the first electronic device sends a third request response to the channel management module, where the third request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the channel management module of the first electronic device sends a second request response to the controller, where the second request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the controller of the first electronic device sends a first request response in response to the first access request to the second electronic device, where the first request response is used to indicate whether to allow the first electronic device to access the second electronic device.
  • the controller of the first electronic device sends the LCID to the channel management module
  • the controller of the second electronic device sends the LCID to the channel management module
  • the channel management module of the first electronic device sends information for instructing to stop broadcasting to the device discovery module.
  • the first electronic device and the second electronic device perform authentication and encryption of the control channel.
  • the channel management module of the first electronic device sends information indicating that the control channel is available to the basic application layer
  • the channel management module of the second electronic device sends information indicating that the control channel is available to the basic application. information.
  • the embodiment of the present application also provides a method for releasing the control channel from the control channel, and the control channel is released by disconnecting the logic channel so that the control channel cannot be used.
  • the channel management module actively initiates a disconnection command for disconnecting the control channel based on a user operation. For two electronic devices that use SLE to communicate, both the G-node device and the T-node device can actively initiate a disconnection command, and for two electronic devices that use SLB to communicate, the G-node device initiates a disconnection command.
  • FIG. 8 is a schematic flowchart of a method 800 for disconnecting a control channel provided by an embodiment of the present application.
  • the basic application layer of the G node device sends a user operation instruction to the channel management module.
  • the user operation may be an operation in which the user clicks on the user interface to disconnect.
  • the channel management module of the G-node device sends a disconnect (disconnect) instruction to the controller according to the instruction operated by the user.
  • the controller disconnects the established logic channel to release the control channel. If there is a dedicated link, you need to disconnect the dedicated link first, and then disconnect the logical channel.
  • Dedicated links refer to links that need to be established by the controller on the basis of logical channels in certain business scenarios (for example, high-definition call scenarios).
  • dedicated links are synchronous one-to-one bidirectional links (isochronous connection- oriented one to one bidirectional link (IOB), for SLB, the dedicated link is a dedicated logical channel (logic channel, LC). Therefore, when disconnecting the logical channel, it is necessary to disconnect the link established on the basis of the logical channel first, and then disconnect the logical channel. In this way, the logic channel in the controller is disconnected, and the control channel cannot be used, thereby disconnecting the control channel.
  • the controller of the G-node device sends a command status (command status) to the channel management module to indicate that the controller has received the disconnection instruction.
  • the controller of the G-node device sends a disconnection request to the T-node device according to the disconnection instruction.
  • the controller of the T-node device disconnects the established logical channel to release the control channel.
  • the controller of the T-node device disconnects the established logical channel to release the control channel.
  • the controller of the T-node device sends response information to the G-node device to indicate that the controller of the T-node device has completed the disconnection of the logical channel.
  • the controller of the G-node device sends an instruction for indicating disconnection completion to the basic application layer through the channel management module, so as to notify the user of the disconnection state of the device through the basic application layer.
  • the basic application layer may send the instruction to the application to display the disconnected state of the device on the user interface.
  • the basic application layer may send the instruction to the playback device, so as to prompt the disconnection status through the playback device, for example, the playback device emits a prompt sound of "beep" or "disconnected”.
  • the controller of the T-node device sends an instruction for indicating disconnection completion to the basic application layer through the channel management module, so as to notify the user of the disconnection state of the device through the basic application layer.
  • two electronic devices send a request response to the other during the process of establishing a connection (for example, the first electronic device sends the first request response to the second electronic device in S427 above) After that, the connection between the two parties is in an unstable state. If the G node device fails to receive the T frame sent by the T node device after a preset period of time (for example, after N superframe periods), it is considered that the connection between the two parties has failed/disconnected , the G-node device no longer sends C frames to the T-node device. If there is an access requirement, the electronic device needs to restart the access process, and execute method 400 or method 600 .
  • the electronic device needs to restart the access process, and execute method 500 or method 700
  • FIG. 9 is a schematic flowchart of a method 900 for device connection provided by an embodiment of the present application.
  • the method 900 is executed by the first electronic device, the first electronic device supports the short-distance access technology, and the connection between the first electronic device and the second electronic device is realized by establishing a control channel, wherein the first electronic device includes a basic application layer and The controller, the basic service layer includes a device discovery module and a channel management module, optionally, also includes a basic application layer (not shown in the figure).
  • the basic service layer determines first role information, where the first role information is used to indicate the expected role of the first electronic device, and the expected role of the first electronic device is a master node device or a terminal node device .
  • the device discovery module in the basic service layer determines the first role information.
  • the first role information is the above role information of the first electronic device, and for a specific description of the first role information, reference may be made to relevant descriptions of S411.
  • the device discovery module receives a notification event from the basic application layer, and the notification event is used to determine the first role information, and the device discovery module determines the first role information according to the notification event.
  • the notification event includes information about a user's operation on the first electronic device.
  • the notification event includes information indicating that the access technology is SLE.
  • the notification event includes role information of the first electronic device.
  • the device discovery module sends the determined first role information to the channel management module, so that the access management module determines the first role information, so that the channel management module can establish a subsequent control channel.
  • the device discovery module sends first information to the channel management module, where the first information includes the first role information.
  • the basic service layer sends a broadcast event to the controller, where the broadcast event is used to indicate a broadcast policy.
  • the controller receives the broadcast event.
  • the device discovery module of the basic service layer sends broadcast events to the controller.
  • the broadcast event includes broadcast parameters, including but not limited to: broadcast mode (adv mode), discovery level, broadcast interval, broadcast duration, and broadcast flag (adv flag).
  • broadcast mode adv mode
  • discovery level adv level
  • broadcast interval a broadcast interval
  • broadcast duration a broadcast duration
  • broadcast flag adv flag
  • the controller sends a broadcast message according to the broadcast event, where the broadcast message includes address information of the first electronic device.
  • the second electronic device receives the broadcast message.
  • the broadcast message may further include information such as broadcast mode (adv mode), broadcast flag (adv flag), and the like.
  • broadcast mode adv mode
  • broadcast flag adv flag
  • the broadcast message may further include information such as broadcast mode (adv mode), broadcast flag (adv flag), and the like.
  • the controller sends a second access request to the basic service layer according to the received first access request of the second electronic device in response to the broadcast message, the first access request and the first access request Two access requests are used to request the first electronic device to access the second electronic device, and the first access request and the second access request include instructions for indicating the desired role of the second electronic device
  • the second role information of the second electronic device, the expected role of the second electronic device is a master node device or a terminal node device.
  • the second role information here is the above role information of the second electronic device.
  • the second electronic device sends a first access request to the first electronic device in response to the broadcast message, and correspondingly, the controller of the second electronic device receives the first access request, and in S915, The controller of the first electronic device sends a second access request to the channel management module of the basic service layer according to the first access request.
  • the controller of the first electronic device sends a second access request to the channel management module of the basic service layer according to the first access request.
  • the controller sends a first request response according to the received second request response sent by the basic service layer in response to the second access request, and the first request response and the second request response are used After indicating that the first electronic device is allowed to access the second electronic device, the final role of the first electronic device is different from the final role of the second electronic device, and the final role of the first electronic device is different from the final role of the second electronic device.
  • the final role of the second electronic device is determined based on the expected role of the first electronic device and the expected role of the second electronic device.
  • the channel management module of the basic service layer sends a second request response to the controller in response to the second access request, and in S917, the controller sends a first request response according to the second request response.
  • the controller sends a first request response according to the second request response.
  • the controller establishes a logical channel and sends a logical channel identifier for identifying the logical channel to the basic service layer, so as to establish a control channel corresponding to the logical channel in the basic service layer.
  • the controller when the first request response and the second request response are used to indicate that the first electronic device is allowed to access the second electronic device, the controller establishes a basic logical channel and sends the logical channel to the channel management module of the basic service layer identification (LCID), thereby establishing a control channel.
  • LCID basic service layer identification
  • control channel is a channel designed in the basic service layer. After the logical channel is established, the corresponding control channel can be used. In this way, after the establishment of the logical channel of the first electronic device is completed, the channel management module can determine the control channel corresponding to the LCID based on the LCID, so as to use the corresponding control channel, thereby completing the establishment of the control channel.
  • the first electronic device is provided with a controller and an upper basic service layer, and the basic service layer triggers the control
  • the establishment of the channel that is, the basic service layer determines the first role information and sends a broadcast event to trigger the establishment of the control channel
  • the controller and the peer device for example, the second electronic device
  • pass an access request for example, , the first access request and the second access request
  • the access response for example, the first request response and the second request response
  • other information interaction establish a logical channel to realize the establishment of the control channel, so as to realize the first
  • the connection between the electronic device and the peer device provides the basis for subsequent data transmission.
  • the short-distance access technology provided by the present application, since the final roles of the first electronic device and the peer device can be determined based on the expected roles of both parties, the roles of both parties can be flexibly changed based on actual scenarios, and the flexibility of communication is high. , very suitable for products with the characteristics of flexibility and miniaturization, and for services with small bandwidth, low power consumption, and low speed, and better for multi-device connections (that is, one electronic device can be connected to multiple devices at the same time And the role is not fixed), in short, the scope of application is wide.
  • the broadcast event includes the first role information
  • the broadcast message includes the first role information
  • the peer device by carrying the first role information in the broadcast message, the peer device (for example, the second electronic device) can determine its own role based on the first role information, and as far as possible In the initial stage of the connection process, the peer device is matched to an expected role different from that of the first electronic device, thereby improving connection efficiency.
  • the method further includes:
  • the basic service layer determines the final role of the first electronic device and the final role of the second electronic device according to the first role information and the second role information in response to the second access request ;
  • the basic service layer sends the second request response to the controller.
  • the channel management module of the basic service layer determines the final role of the first electronic device and the final role of the second electronic device according to the first role information and the second role information in response to the second access request, and the channel management module The module sends a second request response to the controller.
  • the first electronic device finally determines the final roles of the first electronic device and the second electronic device based on the expected roles of the first electronic device and the second electronic device, which can be used for both The role is the final check, so that the final roles of both parties are different so that the control channel can be successfully established to realize the connection between devices.
  • the embodiment of the present application provides the following embodiment of determining the final roles of both parties.
  • the expected role of the first electronic device is the same as the expected role of the second electronic device, and the first role information is further used to indicate that the expected role of the first electronic device is negotiable; and ,
  • the basic service layer determines the final role of the first electronic device according to the first role information and the second role information in response to the second access request, including:
  • the basic service layer replaces the expected role of the first electronic device, so as to determine the changed expected role of the first electronic device as the final role of the first electronic device and determine the expected role of the second electronic device is the final role of the second electronic device.
  • the channel management module of the basic service layer replaces the expected role of the first electronic device, so that the final roles of both parties are different. It should be understood that in this embodiment, it doesn't matter whether the expected role of the second electronic device is negotiable or not, as long as the expected role of the first electronic device is negotiable.
  • This process may correspond to the cases 2-1 and 2-2 of S422, and the specific description may refer to the above description, and details are not repeated here.
  • the desired role of the first electronic device is different from the desired role of the second electronic device.
  • the basic service layer determines the final role of the first electronic device according to the first role information and the second role information in response to the second access request, including:
  • the basic service layer determines the expected role of the first electronic device as the final role of the first electronic device, and determines the expected role of the second electronic device as the final role of the second electronic device.
  • the channel management module of the basic service layer determines the expected roles of the two parties as the final roles of the two parties.
  • This process may correspond to the case 1 of S422, and the specific description may refer to the above description, and details are not repeated here.
  • the first electronic device further includes a basic application layer; and,
  • the method further includes:
  • the basic service layer sends a third access request to the basic application layer according to the second access request, and the third access request is used to request the first electronic device to access the second electronic device. equipment;
  • the basic application layer sends a third request response to the basic service layer when at least one of the following is satisfied, and the third request response is used to indicate approval of the third access request.
  • An electronic device accesses the second electronic device, wherein the at least one item includes: the number of electronic devices that the first electronic device can currently connect to is greater than or equal to 1, or it is detected that the user is targeting the first Acknowledgment of receipt of the request displayed by the electronic device; and,
  • the basic service layer sends a second request response to the controller, including:
  • the basic service layer sends the second request response to the controller according to the third request response.
  • This process can be performed by the basic application layer and the basic service layer.
  • the channel management module of the basic service layer sends a third access request to the basic application layer according to the second access request, and the basic application layer responds to the third access request by satisfying at least one of the following conditions
  • send a third request response to the channel management module of the basic service layer and the channel management module sends the second request response to the controller according to the third request response.
  • the basic application layer judges the capability of the first electronic device according to the third access request of the basic service layer, that is, based on the number of electronic devices that the first electronic device can currently connect to With the user's confirmation operation of the receiving request displayed by the first electronic device, it is determined from the application level whether to agree to access the second electronic device, which considers more practical application scenarios and is more conducive to improving the success rate of device connection.
  • the broadcast event further includes first device filtering information, where the first device filtering information is used to indicate devices within and outside the white list that allow the first electronic device to access the first electronic device.
  • the devices in the white list of the first electronic device are devices that have ever been connected to the first electronic device.
  • the first filtering information allows the first electronic device to access all devices requesting access to the first electronic device, not only the devices in the white list. In this way, the initial connection process between the first electronic device and the new electronic device (for example, the second electronic device) can be realized.
  • the first filtering information here may correspond to the device filtering information carried in the broadcast event in S412.
  • the first electronic device has a white list
  • the first electronic device is not limited to connecting with the devices in the white list, and also wants to connect with new electronic devices that have not been connected.
  • the device establishes a connection. Therefore, by carrying the first device filtering information in the broadcast event to indicate that the first electronic device is allowed to access the first electronic device. Access requests from devices outside the white list, so as to realize the first connection between the first electronic device and the new electronic device.
  • the first access request further includes address information of the second electronic device; and, the method further includes:
  • the controller adds the address represented by the address information of the second electronic device to the white list of the first electronic device, so as to update the white list of the first electronic device.
  • the first electronic device when the first electronic device establishes a connection with a new electronic device (for example, the second electronic device), by adding the address of the new electronic device to the first electronic device
  • a new electronic device for example, the second electronic device
  • the automatic connection can be realized during the subsequent connection between the two parties, which is convenient and fast, and the user experience is high.
  • the broadcast event further includes second device filtering information, where the second device filtering information is used to indicate that only the first electronic device is allowed to access devices in the white list of the first electronic device.
  • the second device filtering information here may correspond to the device filtering information in the broadcast event in S612.
  • the control The controller subsequently receives and forwards the access requests from the devices in the white list, so as to realize the automatic connection process between the first electronic device and the once connected electronic device (for example, the second electronic device).
  • the broadcast message further includes: address information of the second electronic device, where the second electronic device is a device in the white list of the first electronic device.
  • the automatic connection between the first electronic device and the specific device can be realized.
  • the method further includes: the basic service layer sending information indicating that the control channel is available to the basic application layer.
  • the channel management module of the basic service layer sends information indicating that the control channel is available to the basic application layer.
  • the basic service layer can send the information indicating that the control channel is available to the basic application layer, so that the basic application layer can know that the control channel has been established successfully, and can initiate subsequent Business channel establishment and data transmission.
  • FIG. 10 is a schematic flowchart of a method 1000 for device connection provided by an embodiment of the present application.
  • the method 1000 is executed by the second electronic device, the second electronic device supports the short-distance access technology, and the connection between the first electronic device and the second electronic device is realized by establishing a control channel, wherein the second electronic device includes a basic application layer and The controller, the basic service layer includes a device discovery module and a channel management module, optionally, also includes a basic application layer (not shown in the figure).
  • the controller receives a broadcast message from the first electronic device, where the broadcast message includes address information of the first electronic device.
  • the basic service layer sends second role information to the controller, the second role information is used to indicate the expected role of the second electronic device, and the expected role of the second electronic device is a master control node device or end node device.
  • the channel management module or the device discovery module of the basic service layer sends the second role information to the controller.
  • the second role information may be carried in the connection information sent by the device discovery module as one of the connection parameters.
  • the connection information sent by the device discovery module may be carried in the connection information sent by the device discovery module as one of the connection parameters.
  • S616 For specific description, please refer to the description of S616.
  • the second role information may be carried in the access information that the channel management module triggers the controller to send the first access request.
  • the access information that the channel management module triggers the controller to send the first access request.
  • the controller sends a first access request to the first electronic device in response to the broadcast message, and the first access request is used to request the first electronic device to access the second electronic device.
  • the first access request includes the second role information and address information of the first electronic device.
  • the controller receives a first request response from the first electronic device in response to the first access request, and the first request response is used to indicate that the first electronic device is allowed to access the second An electronic device, the final role of the first electronic device is different from the final role of the second electronic device, and the final role of the first electronic device and the final role of the second electronic device are based on the first electronic device
  • the expected role of the device is determined by the expected role of the second electronic device, and the expected role of the first electronic device is a master node device or a terminal node device.
  • the controller establishes a logical channel and sends a logical channel identifier for identifying the logical channel to the basic service layer, so as to establish a control channel corresponding to the logical channel in the basic service layer.
  • the controller when the first request response indicates that the first electronic device is allowed to access the second electronic device, the controller establishes a basic logical channel, and sends a logical channel identifier (LCID) to the channel management module of the basic service layer, thereby, Establish a control channel.
  • LCID logical channel identifier
  • control channel is a channel designed in the basic service layer. After the logical channel is established, the corresponding control channel can be used. In this way, when the logical channel of the second electronic device is established, the channel management module can determine the control channel corresponding to the LCID based on the LCID to use the corresponding control channel, thereby completing the establishment of the control channel of the second electronic device.
  • the second electronic device is provided with a controller and an upper basic service layer, and the second electronic device is based on the control
  • the controller scans the broadcast message of the first electronic device and the second role information issued by the basic service layer, initiates the first access request to the controller and receives the first request response, and establishes a logical channel to realize the control channel establishment, so as to realize the connection between the second electronic device and the peer device, and provide a basis for subsequent data transmission.
  • the short-distance access technology provided by the present application, since the final roles of the second electronic device and the peer device can be determined based on the expected roles of both parties, the roles of both parties can be flexibly changed based on actual scenarios, and the flexibility of communication is high. , very suitable for products with the characteristics of flexibility and miniaturization, and for services with small bandwidth, low power consumption, and low speed, and better for multi-device connections (that is, one electronic device can be connected to multiple devices at the same time And the role is not fixed), in short, the scope of application is wide.
  • the broadcast message includes first role information for indicating a desired role of the first electronic device.
  • two scenarios of automatic connection and initial connection are provided, and the process of triggering the first access request by the second electronic device is different in different scenarios.
  • the controller sends a first access request to the first electronic device in response to the broadcast message, including:
  • the controller After scanning the broadcast message, the controller sends the first access request to the first electronic device, where the first electronic device is a device in the white list of the second electronic device.
  • the controller scans the devices in the white list, it does not need to report the scanning result to the upper layer, and can directly initiate the first access request.
  • the controller scans the devices based on the white list, and scans the devices in the white list
  • the device can directly initiate an access request, which simplifies the process of reporting results to the upper layer and saves the time required for connection to achieve fast connection between devices and improve the efficiency of the connection process.
  • the basic service layer sends the second role information to the controller, including:
  • the basic service layer sends connection information to the controller, where the connection information includes the second role information.
  • the device discovery module of the basic service layer sends connection information to the controller, the connection information includes connection parameters, and the second role information is used as an item of the connection parameters.
  • connection information further includes: information for instructing the controller to enable the whitelist of the second electronic device.
  • connection information further includes: information indicating a connection mode, the connection mode is a single-device connection mode or a multi-device connection mode, and the single-device connection mode indicates that the second electronic device The device can only be connected to one electronic device, and the multi-connection mode means that the second electronic device can be connected to multiple electronic devices within the same period of time.
  • connection parameters in S616 are the connection parameters in the connection information.
  • the connection parameters in S616 are the connection parameters in the connection information.
  • connection mode of the second electronic device is a multi-device connection mode; and, the method further includes: when a preset condition is met, the controller stops scanning; Or, if the preset condition is not met, the controller continues to scan; the preset condition includes any of the following:
  • the first electronic device is the Nth device scanned by the controller; or,
  • the first electronic device is the Nth device scanned by the controller and the second electronic device completes the establishment of the control channel; or,
  • the first electronic device is the Nth device scanned by the controller.
  • the first electronic device is the Nth device scanned by the controller and the second electronic device completes the establishment of the control channel;
  • the N devices including the first electronic device scanned by the controller are devices in the white list of the second electronic device, and N is the maximum number of devices that the second electronic device can connect to. Quantity, N is an integer greater than 1.
  • the controller of the second electronic device when the second electronic device supports multi-device connection mode, the controller of the second electronic device will stop scanning to stop the entire connection process when the preset condition is met. Otherwise, when the preset conditions are not met, the scan will continue to achieve multi-device connection, so that the controller does not need to interact with the upper layer (for example, the basic service layer) every time a device is connected (for example, the upper layer sends connection information , scanning parameters, etc.) to initiate an access request, that is, the second electronic device does not need to restart the connection process every time it connects to a device, which not only effectively reduces signaling overhead, but also reduces the time spent in the multi-device connection process. To achieve fast connection of multiple devices.
  • the upper layer for example, the basic service layer
  • the broadcast message further includes address information of the second electronic device.
  • the second electronic device further includes a basic application layer; and, the method further includes:
  • the controller sends a scan result determined based on the broadcast message to the basic application layer through the basic service layer, where the scan result includes address information of the first electronic device;
  • the basic application layer sends second information to the basic service layer, the second information including address information of the first electronic device; and,
  • the basic service layer sends the second role information to the controller, including:
  • the basic service layer sends access information to the controller according to the second information, where the access information includes the second role information and address information of the first electronic device; and,
  • the controller sends a first access request to the first electronic device in response to the broadcast message, including:
  • the controller sends the first access request according to the access information in response to the broadcast message.
  • the controller determines the scanning result according to the broadcast message and sends the scanning result to the basic application layer through the device discovery module of the basic service layer (refer to S417), and the basic application layer sends the second information to the channel management module of the basic service layer (refer to S418 ), the channel management module sends access information to the controller according to the second information (refer to S419), and the controller sends the first access request according to the access information in response to the broadcast message (refer to S420).
  • the second role information is carried in the access information sent by the channel management module.
  • the broadcast message, the scan result, and the second information all include first role information indicating an expected role of the first electronic device; and,
  • the method further includes:
  • the basic service layer determines the expected role of the second electronic device according to the expected role of the first electronic device, and the expected role of the second electronic device is different from the expected role of the first electronic device.
  • the channel management module of the basic service layer obtains the first role information from the second information delivered by the basic application layer, determines its desired role according to the first role information, and sends it to the controller through the access information.
  • the second electronic device receiving the broadcast message can finally obtain the first role information and based on the first
  • the role information determines its own role, and as far as possible in the initial stage of the connection process, the peer device can be matched with an expected role different from the expected role of the first electronic device, so as to improve connection efficiency.
  • the access information further includes: information for instructing the second electronic device to ignore the white list of the second electronic device.
  • the devices in the white list of the second electronic device are devices that have ever been connected to the second electronic device, indicating that the second electronic device ignores the white list of the second electronic device means that the second electronic device can be connected to devices outside the white list .
  • the second electronic device if the second electronic device has a white list, the second electronic device is not limited to connecting with the devices in the white list, and also wants to connect with new devices that have not been connected.
  • the electronic device establishes a connection. Therefore, the first connection between the devices can be realized by carrying information in the access information for indicating to ignore the white list of the second electronic device.
  • the second electronic device has enabled the white list before, when it is connected to the first electronic device for the first time, if the white list of the second electronic device is not ignored, the devices located around the second electronic device that have been connected to the second electronic device Other electronic devices may automatically connect with the second electronic device.
  • the second electronic device Since the devices that the second electronic device can connect to are limited, it will affect the connection between the first electronic device and the second electronic device. Therefore, by indicating the second electronic device The second electronic device ignores the white list information of the second electronic device so that the second electronic device does not perform device connection based on the white list, which can further ensure the success of the first connection between the first electronic device and the second electronic device.
  • the second information further includes information indicating the first short-distance access technology.
  • the first access request further includes address information of the second electronic device.
  • the method for device connection provided by the embodiment of the present application, by carrying the address information of the second electronic device in the first access request, facilitates the first electronic device to update the white list of the first electronic device, which can be well adapted to The first connection scene.
  • the basic service layer sends information indicating that the control channel is available to the basic application layer.
  • the channel management module of the basic service layer sends information indicating that the control channel is available to the basic application layer.
  • FIG. 11 is a schematic flowchart of a method 1100 for device connection provided by an embodiment of the present application.
  • the method 1100 is executed by the second electronic device, and the second electronic device supports short-distance access technology and multi-device connection. It should be understood that the method 1100 can be applied to any short-distance access technology, including but not limited to: Wi-Fi, Bluetooth, ZigBee, and SLE and SLB of the present application.
  • the first electronic device sends a broadcast message.
  • the first electronic device sends a broadcast message.
  • the second electronic device After scanning the broadcast message of the first electronic device, the second electronic device sends a first access request, the first access request is used to request the first electronic device to access the second An electronic device, the first electronic device is a device in the white list of the second electronic device.
  • the first electronic device is a device in the white list of the second electronic device.
  • the second electronic device receives a first request response from the first electronic device in response to the first access request, and the first request response is used to indicate that the first electronic device is allowed to access the second electronic device.
  • the first request response is used to indicate that the first electronic device is allowed to access the second electronic device.
  • the second electronic device establishes a logical channel, so as to establish a control channel corresponding to the logical channel.
  • a control channel corresponding to the logical channel For specific description, refer to S627.
  • the second electronic device stops scanning; or, if the preset condition is not met, the second electronic device continues to scan; wherein the preset condition includes any of the following item:
  • the first electronic device is the Nth device scanned by the second electronic device; or,
  • the first electronic device is the Nth device scanned by the second electronic device and the second electronic device completes the establishment of the control channel; or,
  • the first electronic device is the Nth device scanned by the controller.
  • the first electronic device is the Nth device scanned by the second electronic device and the second electronic device completes the establishment of the control channel;
  • the N devices including the first electronic device scanned by the second electronic device are devices in the white list of the second electronic device, and N is a device that the second electronic device can connect to
  • the maximum number of , N is an integer greater than 1. For details, refer to S6172.
  • the second electronic device if the second electronic device supports the multi-device connection mode, the second electronic device will stop scanning to stop the entire connection process when the preset condition is met; When the preset conditions are not met, the scan will continue to realize multi-device connection, so that the second electronic device does not need to restart the connection process every time it connects to the device (for example, the upper layer sends connection information, scanning parameters, etc.), not only The signaling overhead is effectively reduced, and the time delay of the multi-device connection process is reduced so as to realize the fast connection of multiple devices.
  • Figure 12 shows an electronic device 1200 provided by the embodiment of the present application.
  • the electronic device 1200 can be the first electronic device or the second electronic device mentioned above, or it can be a chip in the first electronic device or the second electronic device.
  • the device 1200 supports short-distance access technology, and includes a basic service layer 1210 and a controller 1220 , and the basic service layer 1210 includes a device discovery module 1211 and a channel management module 1212 .
  • the electronic device 1200 is the above-mentioned first electronic device, and is configured to execute various processes and steps corresponding to the first electronic device in the foregoing method 400 or 600 .
  • the basic service layer 1210 is configured to determine first role information, where the first role information is used to indicate an expected role of the electronic device, and the expected role of the electronic device is a master node device or a terminal node device;
  • the basic service layer 1210 is further configured to send a broadcast event to the controller 1220, where the broadcast event is used to indicate a broadcast policy;
  • the controller 1220 is configured to send a broadcast message according to the broadcast event, where the broadcast message includes address information of the electronic device;
  • the controller 1220 is further configured to send a second access request to the basic service layer 1210 according to the received first access request of the second electronic device in response to the broadcast message, the first access request and the second access request are used to request the electronic device to access the second electronic device, and the first access request and the second access request include instructions for indicating the second electronic device Second role information of the expected role, where the expected role of the second electronic device is a master node device or a terminal node device;
  • the controller 1220 is further configured to send a first request response according to the received second request response sent by the basic service layer 1210 in response to the second access request, the first request response and the second access request
  • the second request response is used to indicate that the electronic device is allowed to access the second electronic device, the final role of the electronic device is different from the final role of the second electronic device, and the final role of the electronic device is different from that of the second electronic device.
  • the final role of the second electronic device is determined based on the expected role of the electronic device and the expected role of the second electronic device;
  • the controller 1220 is further configured to establish a logical channel, and send a logical channel identifier for identifying the logical channel to the basic service layer 1210, so as to establish a logical channel corresponding to the logical channel in the basic service layer 1210 control channel.
  • the device discovery module 1211 in the basic service layer 1210 is used to determine the first role information, and is also used to send the first role information to the channel management module 1212, so that the channel management module 1212 can establish a subsequent control channel;
  • the device discovery module 1211 is used to send a broadcast event to the controller 1220;
  • the controller 1220 is used to receive the first access request, send the second access request, receive the second request response, send the first request response, establish a logical channel and send Logical channel ID.
  • the broadcast event includes the first role information
  • the broadcast message includes the first role information
  • the basic service layer 1210 is further configured to, in response to the second access request, determine the final role of the electronic device and the The ultimate role of the second electronic device;
  • the basic service layer 1210 is further configured to send the second request response to the controller 1220 .
  • the channel management module 1212 in the basic service layer 1210 is used to determine the final roles of the two electronic devices and send the second request response.
  • the expected role of the electronic device is the same as the expected role of the second electronic device, and the first role information is further used to indicate that the expected role of the electronic device is negotiable;
  • the basic service layer 1210 is specifically used to replace the expected role of the electronic device, so as to determine the expected role of the replaced electronic device as the final role of the electronic device and determine the expected role of the second electronic device is the final role of the second electronic device.
  • the desired role of the electronic device is different from the desired role of the second electronic device.
  • the basic service layer 1210 is specifically configured to determine the expected role of the electronic device as the final role of the electronic device, and determine the expected role of the second electronic device as the final role of the second electronic device.
  • the electronic device further includes a basic application layer; and,
  • the basic service layer 1210 is further configured to, according to the second access request, send a third access request to the basic application layer, where the third access request is used to request the electronic device to access the the second electronic device;
  • the basic application layer is further configured to, in response to the third access request, send a third request response to the basic service layer 1210 when at least one of the following is satisfied, the third request response is used for Indicating that the electronic device is allowed to access the second electronic device, wherein the at least one item includes: the number of electronic devices that the electronic device can currently connect to is greater than or equal to 1, or detecting that the user is targeting the electronic device A confirmation action displayed by the device to receive the request; and,
  • the basic service layer 1210 is specifically configured to send the second request response to the controller 1220 according to the third request response.
  • the channel management module 1212 in the basic service layer 1210 is configured to send the third access request to the basic application layer according to the second access request, and send the second request according to the received third request response of the basic application layer response.
  • the broadcast event further includes first device filtering information, where the first device filtering information is used to indicate devices that are allowed to access the electronic device within and outside the white list of the electronic device.
  • the first access request further includes address information of the second electronic device.
  • the controller 1220 is further configured to add the address represented by the address information of the second electronic device to the white list of the electronic device, so as to update the white list of the electronic device.
  • the broadcast event further includes second device filtering information, where the second device filtering information is used to indicate that the electronic device is only allowed to access devices in the white list of the electronic device.
  • the broadcast message further includes: address information of the second electronic device, where the second electronic device is a device in the white list of the electronic device.
  • the basic service layer 1210 is further configured to send information indicating that the control channel is available to the basic application layer.
  • the channel management module 1212 in the basic service layer 1210 is used to send the information.
  • the electronic device 1200 is the above-mentioned second electronic device, configured to execute various processes and steps corresponding to the second electronic device in the foregoing method 400 or 600 .
  • the controller 1220 is configured to receive a broadcast message from the first electronic device, where the broadcast message includes address information of the first electronic device;
  • the basic service layer 1210 is configured to send second role information to the controller 1220, the second role information is used to indicate an expected role of the electronic device, and the expected role of the electronic device is a control node device or end node device;
  • the controller 1220 is further configured to, in response to the broadcast message, send a first access request to the first electronic device, where the first access request is used to request the first electronic device to access the For an electronic device, the first access request includes the second role information and address information of the first electronic device;
  • the controller 1220 is further configured to receive a first request response from the first electronic device in response to the first access request, where the first request response is used to indicate that the first electronic device is allowed to access the first access request.
  • the electronic device, the final role of the first electronic device is different from the final role of the electronic device, and the final role of the first electronic device and the final role of the electronic device are based on the expectations of the first electronic device
  • the role is determined by the expected role of the electronic device, and the expected role of the first electronic device is a master node device or a terminal node device;
  • the controller 1220 is further configured to establish a logical channel and send a logical channel identifier for identifying the logical channel to the basic service layer 1210, so as to establish a control channel corresponding to the logical channel in the basic service layer 1210 aisle.
  • the broadcast message includes first role information for indicating a desired role of the first electronic device.
  • the controller 1220 is specifically configured to, after scanning the broadcast message, send the first access request to the first electronic device, where the first electronic device is the first access request of the electronic device. Devices in the whitelist.
  • the basic service layer 1210 is specifically configured to send connection information to the controller 1220, where the connection information includes the second role information, where the connection information further includes: indicating the The controller 1220 enables information of the whitelist of the electronic device.
  • the device discovery module 1211 in the basic service layer 1210 is used to send connection information.
  • connection information further includes: information indicating a connection mode, the connection mode is a single-device connection mode or a multi-device connection mode, and the single-device connection mode indicates that the electronic device only Can be connected to one electronic device, the multi-connection mode means that the electronic device can be connected to multiple electronic devices within the same period of time.
  • connection mode of the electronic device is a multi-device connection mode; and, the controller 1220 is further configured to, if the preset condition is met, stop scanning; or, if the preset condition is not met Next, continue scanning; the preset conditions include any of the following:
  • the scan timer of the controller 1220 expires; or,
  • the first electronic device is the Nth device scanned by the controller 1220; or,
  • the first electronic device is the Nth device scanned by the controller 1220 and the electronic device completes the establishment of the control channel; or,
  • the first electronic device is the Nth device scanned by the controller 1220; or,
  • the first electronic device is the Nth device scanned by the controller 1220 and the electronic device completes the establishment of the control channel;
  • the N devices including the first electronic device scanned by the controller 1220 are devices in the white list of the electronic device, N is the maximum number of devices that the electronic device can connect to, and N is an integer greater than 1.
  • the broadcast message further includes address information of the electronic device.
  • the electronic device further includes a basic application layer; and,
  • the controller 1220 is further configured to send a scan result determined based on the broadcast message to the basic application layer through the basic service layer 1210, where the scan result includes address information of the first electronic device;
  • the basic application layer is further configured to send second information to the basic service layer 1210, where the second information includes address information of the first electronic device; and,
  • the basic service layer 1210 is specifically configured to send access information to the controller 1220 according to the second information, where the access information includes the second role information and address information of the first electronic device; as well as,
  • the controller 1220 is specifically configured to, in response to the broadcast message, send the first access request according to the access information.
  • the controller 1220 is also used to send the scan result
  • the basic application layer is used to send the second information to the device discovery module 1211 according to the scan result
  • the channel management module 1212 is used to send the second information to the controller 1220 according to the second information. access information.
  • the broadcast message, the scan result, and the second information all include first role information indicating an expected role of the first electronic device; and,
  • the basic service layer 1210 is specifically configured to determine the expected role of the electronic device according to the expected role of the first electronic device, and the expected role of the electronic device is different from the expected role of the first electronic device;
  • the basic service layer 1210 sends the access information to the controller 1220 .
  • the channel management module 1212 in the basic service layer 1210 is configured to determine the expected role of the first electronic device, and send access information.
  • the access information further includes: information for instructing the electronic device to ignore the white list of the electronic device.
  • the second information further includes information indicating the first short-distance access technology.
  • the first access request further includes address information of the electronic device.
  • the basic service layer 1210 is further configured to send information indicating that the control channel is available to the basic application layer.
  • the electronic device 1200 is the above-mentioned second electronic device, supports a multi-device connection mode, and is used to execute various processes and steps corresponding to the second electronic device in the above-mentioned method 1100 .
  • the controller 1220 is configured to, after scanning the broadcast message of the first electronic device, send a first access request, where the first access request is used to request the first electronic device to access the electronic device, so The first electronic device is a device in the white list of the electronic device;
  • the controller 1220 is configured to receive a first request response from the first electronic device in response to the first access request, where the first request response is used to indicate that the first electronic device is allowed to access the electronic device ;
  • the controller 1220 is configured to establish a logical channel, so as to establish a control channel corresponding to the logical channel;
  • the controller 1220 When the preset condition is met, the controller 1220 is used to stop scanning; or, when the preset condition is not met, the controller 1220 is used to continue scanning; wherein the preset condition includes any of the following:
  • the first electronic device is the Nth device scanned by the electronic device; or,
  • the first electronic device is the Nth device scanned by the electronic device and the electronic device completes the establishment of the control channel; or,
  • the first electronic device is the Nth device scanned by the controller 1220; or,
  • the first electronic device is the Nth device scanned by the electronic device and the electronic device completes the establishment of the control channel;
  • the N devices including the first electronic device scanned by the electronic device are devices in the white list of the electronic device, N is the maximum number of devices that the electronic device can connect to, and N is An integer greater than 1.
  • FIG. 13 shows an electronic device 1300 provided by an embodiment of the present application. It should be understood that the electronic device 1300 may specifically be the first electronic device or the second electronic device in the foregoing embodiments, and may be used to perform various steps corresponding to the first electronic device or the second electronic device in the foregoing method embodiments and/or or process.
  • the electronic device 1300 includes a processor 1310 , a transceiver 1320 and a memory 1330 .
  • the processor 1310, the transceiver 1320 and the memory 1330 communicate with each other through an internal connection path
  • the processor 1310 can realize the functions of the basic service layer and the controller in various possible implementation modes of the electronic device 1200
  • the transceiver 1320 can realize the electronic Functions of the basic service layer and the controller in various possible implementation manners in the device 1200
  • the memory 1330 is used to store instructions
  • the processor 1310 is used to execute the instructions stored in the memory 1330.
  • the processor 1310 can call these stored instructions to realize the functions of the basic service layer and controller in the electronic device 1200, so as to control the transceiver 1320 to send signal and/or receive a signal.
  • the memory 1330 may include read-only memory and random-access memory, and provides instructions and data to the processor.
  • a portion of the memory may also include non-volatile random access memory.
  • the memory may also store device type information.
  • the processor 1310 may be used to execute the instructions stored in the memory, and when the processor 1310 executes the instructions stored in the memory, the processor 1310 is used to execute the above method embodiments corresponding to the access network device or the core network device individual steps and/or processes.
  • protocol may refer to a standard protocol in the communication field.
  • pre-defined can be realized by pre-saving corresponding codes, tables or other methods that can be used to indicate related information in devices (for example, including stations and access points), This application does not limit its specific implementation.
  • pre-defined may refer to defined in the protocol.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features.
  • Features defined as “first” and “second” may explicitly or implicitly include one or more of these features.
  • At least one means one or more, and “multiple” means two or more.
  • At least part of an element means part or all of the element.
  • And/or describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an "or" relationship.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Landscapes

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

Abstract

本申请提供一种用于设备连接的方法、电子设备和系统。对于新一代的短距离接入技术,电子设备内配置有控制器和基础服务层,通过控制器、基础服务层以及对端设备的交互,实现电子设备内控制通道的建立以实现电子设备之间的连接,为后续的数据传输提供基础。此外,本申请提供的短距离接入技术,由于两个电子设备的最终角色可以基于双方的期望角色确定,可以使得双方的角色基于实际场景灵活可变,通信的灵活性较高。

Description

用于设备连接的方法、电子设备和系统
本申请要求于2021年08月02日提交中国专利局、申请号为202110878581.9、申请名称为“用于设备连接的方法、电子设备和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及短距离通信,更具体地,涉及短距离通信中用于设备连接的方法。
背景技术
短距离通信可实现距离相距小的电子设备间的通信,目前的短距离通信中主流的接入技术包括有Wi-Fi,蓝牙和ZigBee等。随着物联网的发展,出现了智能汽车、智能家居、智能终端和智能制造等新应用场景,新一代短距离接入技术(例如,星闪联盟(sparklink))应运而生。但是,如何实现设备间的连接,新一代短距离接入技术并未做具体规定。
发明内容
本申请提供一种用于设备连接的方法、电子设备和系统,对于新一代的短距离接入技术,电子设备内配置有控制器和基础服务层,通过控制器、基础服务层以及对端设备的交互,实现电子设备内控制通道的建立以实现电子设备之间的连接,为后续的数据传输提供基础。此外,本申请提供的短距离接入技术,由于两个电子设备的最终角色可以基于双方的期望角色确定,可以使得双方的角色基于实际场景灵活可变,通信的灵活性较高。
第一方面,提供了一种用于设备连接的方法,应用于第一电子设备中,所述第一电子设备支持短距离接入技术,包括基础服务层和控制器,所述方法包括:
所述基础服务层确定第一角色信息,所述第一角色信息用于指示所述第一电子设备的期望角色,所述第一电子设备的期望角色为主控节点设备或终端节点设备;
所述基础服务层向所述控制器发送广播事件,所述广播事件用于指示广播策略;
所述控制器根据所述广播事件发送广播消息,所述广播消息包括所述第一电子设备的地址信息;
所述控制器根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层发送第二接入请求,所述第一接入请求和所述第二接入请求用于请求所述第一电子设备接入所述第二电子设备,所述第一接入请求和所述第二接入请求包括用于指示所述第二电子设备的期望角色的第二角色信息,所述第二电子设备的期望角色为主控节点设备或终端节点设备;
所述控制器根据接收到的所述基础服务层响应于所述第二接入请求发送的第二请求响应发送第一请求响应,所述第一请求响应和所述第二请求响应用于指示同意所述第一电子设备接入所述第二电子设备,所述第一电子设备的最终角色与所述第二电子设备的最终角色不同,所述第一电子设备的最终角色与所述第二电子设备的最终角色是基于所述第一 电子设备的期望角色与所述第二电子设备的期望角色确定的;
所述控制器建立逻辑通道,且向所述基础服务层发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层中对应于所述逻辑通道的控制通道。
本申请实施例提供的用于设备连接的方法,对于新一代的短距离接入技术(例如,SLE),第一电子设备内设置有控制器和上层的基础服务层,由基础服务层触发控制通道的建立,即,基础服务层通过确定第一角色信息和发送广播事件以触发控制通道的建立,
基础服务层、控制器和对端设备(例如,第二电子设备)通过接入请求(例如,第一接入请求和第二接入请求)和接入响应(例如,第一请求响应和第二请求响应)等信息的交互,建立逻辑通道,以实现控制通道的建立,从而实现第一电子设备和对端设备间的连接,为后续的数据传输提供基础。并且,本申请提供的短距离接入技术,由于第一电子设备和对端设备的最终角色可以基于双方的期望角色确定,可以使得双方的角色基于实际场景灵活可变,通信的灵活性较高,非常适用于具有灵活和小型化特点的产品以及适用于小带宽、低功耗、低速率的业务,更能较好地适用于多设备连接(即,一个电子设备可同时和多个设备连接且角色不固定)的场景,总之,适用范围广。
可选地,所述广播事件包括所述第一角色信息,所述广播消息包括所述第一角色信息。
本申请实施例提供的用于设备连接的方法,通过在广播消息中携带第一角色信息,可以使得对端设备(例如,第二电子设备)基于第一角色信息确定自己的角色,尽可能在连接过程的初始阶段使得对端设备匹配到与第一电子设备的期望角色不同的期望角色,提高连接效率。
可选地,在所述控制器根据接收到的所述基础服务层响应于所述第二接入请求发送的第二请求响应发送第一请求响应之前,所述方法还包括:
所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色和所述第二电子设备的最终角色;
所述基础服务层向所述控制器发送所述第二请求响应。
本申请实施例提供的用于设备连接的方法,由第一电子设备基于第一电子设备和第二电子设备的期望角色最终确定第一电子设备和第二电子设备的最终角色,可以对双方的角色做最后的把关,使得双方的最终角色都不同以能成功建立控制通道,从而实现设备间的连接。
可选地,所述第一电子设备的期望角色与所述第二电子设备的期望角色相同,所述第一角色信息还用于指示所述第一电子设备的期望角色可协商;以及,
所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色,包括:
所述基础服务层更换所述第一电子设备的期望角色,以将更换后的所述第一电子设备的期望角色确定为所述第一电子设备的最终角色且将第二电子设备的期望角色确定为所述第二电子设备的最终角色。
可选地,所述第一电子设备的期望角色与所述第二电子设备的期望角色不同;以及,
所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色,包括:
所述基础服务层将所述第一电子设备的期望角色确定为所述第一电子设备的最终角色,将所述第二电子设备的期望角色确定为所述第二电子设备的最终角色。
可选地,所述第一电子设备还包括基础应用层;以及,
在所述控制器根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层发送第二接入请求之后,所述方法还包括:
所述基础服务层根据所述第二接入请求,向所述基础应用层发送第三接入请求,所述第三接入请求用于请求所述第一电子设备接入所述第二电子设备;
所述基础应用层响应于所述第三接入请求,在满足以下至少一项的情况下,向所述基础服务层发送第三请求响应,所述第三请求响应用于指示同意所述第一电子设备接入所述第二电子设备,其中,所述至少一项包括:所述第一电子设备当前能够连接的电子设备的数量大于或等于1,或,检测到用户针对所述第一电子设备显示的接收请求的确认操作;以及,
所述基础服务层向所述控制器发送第二请求响应,包括:
所述基础服务层根据所述第三请求响应,向所述控制器发送所述第二请求响应。
本申请实施例提供的用于设备连接的方法,基础应用层根据基础服务层的第三接入请求对第一电子设备进行能力判断,即,基于第一电子设备当前能够连接的电子设备的数量和用户针对所述第一电子设备显示的接收请求的确认操作,从应用层面确定是否同意接入第二电子设备,考虑了更多实际应用场景,更有利于提高设备连接的成功率。
可选地,所述广播事件还包括第一设备过滤信息,所述第一设备过滤信息用于指示允许所述第一电子设备接入所述第一电子设备的白名单以内和以外的设备。
本申请实施例提供的用于设备连接的方法,虽然第一电子设备内保存有白名单,但第一电子设备并不限于与白名单中的设备连接,也想和未连接过的新的电子设备建立连接,因此,通过在广播事件中携带用于指示允许第一电子设备接入第一电子设备的白名单以内和以外的设备的第一设备过滤信息,可以使得控制器后续接收以及转发来自白名单以外的设备的接入请求,以实现第一电子设备与新的电子设备的首次连接。
可选地,所述第一接入请求还包括所述第二电子设备的地址信息;以及,所述方法还包括:
所述控制器将所述第二电子设备的地址信息所表示的地址添加至所述第一电子设备的白名单中,以更新所述第一电子设备的白名单。
本申请实施例提供的用于设备连接的方法,第一电子设备在和新的电子设备(例如,第二电子设备)建立连接过程中,通过将新的电子设备的地址添加至第一电子设备的白名单中以更新白名单,可以后续双方再次连接过程中实现自动连接,方便快捷,用户体验高。
可选地,所述广播事件还包括第二设备过滤信息,所述第二设备过滤信息用于指示仅允许所述第一电子设备接入所述第一电子设备的白名单以内的设备。
本申请实施例提供的用于设备连接的方法,通过在广播事件中携带用于指示仅允许第一电子设备接入第一电子设备的白名单以内的设备的第二设备过滤信息,可以使得控制器后续接收以及转发来自白名单以内的设备的接入请求,以实现第一电子设备与曾经连接过的电子设备(例如,第二电子设备)的自动连接过程。
可选地,所述广播消息还包括:所述第二电子设备的地址信息,所述第二电子设备是所述第一电子设备的白名单内的设备。
本申请实施例提供的用于设备连接的方法,通过在广播消息中携带白名单内的设备(例如,第二电子设备)的地址信息,可以实现第一电子设备与特定设备的自动连接。
可选地,所述方法还包括:
所述基础服务层向所述基础应用层发送用于指示所述控制通道可用的信息。
本申请实施例提供的用于设备连接的方法,基础服务层通过向基础应用层发送用于指示所述控制通道可用的信息,可以使得基础应用层确知控制通道已经建立成功,可发起后续的业务通道的建立以及数据传输。
第二方面,提供了一种用于设备连接的方法,应用于第二电子设备中,所述第二电子设备支持短距离接入技术,包括基础服务层和控制器,所述方法包括:
所述控制器接收来自第一电子设备的广播消息,所述广播消息包括所述第一电子设备的地址信息;
所述基础服务层向所述控制器发送第二角色信息,所述第二角色信息用于指示所述第二电子设备的期望角色,所述第二电子设备的期望角色为主控节点设备或终端节点设备;
所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述第二电子设备,所述第一接入请求包括所述第二角色信息和所述第一电子设备的地址信息;
所述控制器接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述第二电子设备,所述第一电子设备的最终角色与所述第二电子设备的最终角色不同,所述第一电子设备的最终角色与所述第二电子设备的最终角色是基于所述第一电子设备的期望角色与所述第二电子设备的期望角色确定的,所述第一电子设备的期望角色为主控节点设备或终端节点设备;
所述控制器建立逻辑通道且向所述基础服务层发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层中对应于所述逻辑通道的控制通道。
本申请实施例提供的用于设备连接的方法,对于新一代的短距离接入技术(例如,SLE),第二电子设备内设置有控制器和上层的基础服务层,第二电子设备基于控制器扫描到的第一电子设备的广播消息和由基础服务层下发的第二角色信息,向控制器发起第一接入请求以及接收到第一请求响应后,建立逻辑通道,以实现控制通道的建立,从而实现第二电子设备和对端设备间的连接,为后续的数据传输提供基础。并且,本申请提供的短距离接入技术,由于第二电子设备和对端设备的最终角色可以基于双方的期望角色确定,可以使得双方的角色基于实际场景灵活可变,通信的灵活性较高,非常适用于具有灵活和小型化特点的产品以及适用于小带宽、低功耗、低速率的业务,更能较好地适用于多设备连接(即,一个电子设备可同时和多个设备连接且角色不固定)的场景,总之,适用范围广。
可选地,所述广播消息包括用于指示所述第一电子设备的期望角色的第一角色信息。
可选地,所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,包括:
所述控制器在扫描到所述广播消息后,向所述第一电子设备发送所述第一接入请求,所述第一电子设备是所述第二电子设备的白名单内的设备。
本申请实施例提供的用于设备连接的方法,由于白名单内的设备都是之前和第二电子设备连接过的设备,所以,控制器通过基于白名单扫描设备,在扫描到白名单内的设备后可直接发起接入请求,简化了向上层上报结果的流程的同时,节省了连接所需的时间以实现设备间快速连接,提高连接过程的效率。
可选地,所述基础服务层向所述控制器发送第二角色信息,包括:
所述基础服务层向所述控制器发送连接信息,所述连接信息包括所述第二角色信息,其中,所述连接信息还包括:用于指示所述控制器使能所述第二电子设备的白名单的信息。
可选地,所述连接信息还包括:用于指示连接模式的信息,所述连接模式为单设备连接模式或多设备连接模式,所述单设备连接模式表示在同一时段内所述第二电子设备仅能够和一个电子设备连接,所述多连接模式表示在同一时段内所述第二电子设备能够和多个电子设备连接。
可选地,所述第二电子设备的连接模式为多设备连接模式;以及,所述方法还包括:
在满足预设条件的情况下,所述控制器停止扫描;或,在不满足预设条件的情况下,所述控制器继续扫描;所述预设条件包括以下任一项:
所述控制器的扫描定时器超时;或,
所述第一电子设备为所述控制器扫描到的第N个设备;或,
所述第一电子设备为所述控制器扫描到的第N个设备且所述第二电子设备完成所述控制通道的建立;或,
在所述控制器的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备;或,
在所述控制器的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备且所述第二电子设备完成控制通道的建立;
其中,所述控制器扫描到的包括所述第一电子设备在内的N个设备是所述第二电子设备的白名单内的设备,N是所述第二电子设备能够连接的设备的最大数量,N为大于1的整数。
本申请实施例提供的用于设备连接的方法,在第二电子设备支持多设备连接模式的情况下,第二电子设备的控制器在满足预设条件时才会停止扫描以停止整个连接过程,否则,在不满足预设条件时会继续扫描以实现多设备连接,这样,控制器不需要每次连接设备时都和上层(例如,基础服务层)进行交互(例如,由上层下发连接信息、扫描参数等)以发起接入请求,即,第二电子设备不需要每次连接设备时都重新开始连接的流程,不仅有效地减少了信令开销,而且,减少了多设备连接过程的时延从而实现多个设备的快速连接。
可选地,所述广播消息还包括所述第二电子设备的地址信息。
可选地,所述第二电子设备还包括基础应用层;以及,所述方法还包括:
所述控制器通过所述基础服务层向所述基础应用层发送基于所述广播消息确定的扫描结果,所述扫描结果包括所述第一电子设备的地址信息;
所述基础应用层向所述基础服务层发送第二信息,所述第二信息包括所述第一电子设备的地址信息;以及,
所述基础服务层向所述控制器发送第二角色信息,包括:
所述基础服务层根据所述第二信息向所述控制器发送接入信息,所述接入信息包括所述第二角色信息和所述第一电子设备的地址信息;以及,
所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,包括:
所述控制器响应于所述广播消息,根据所述接入信息发送所述第一接入请求。
可选地,所述广播消息、所述扫描结果和所述第二信息都包括用于指示所述第一电子设备的期望角色的第一角色信息;以及,
所述基础服务层根据所述第二信息向所述控制器发送接入信息,包括:
所述基础服务层根据所述第一电子设备的期望角色,确定所述第二电子设备的期望角色,所述第二电子设备的期望角色与所述第一电子设备的期望角色不同;
所述基础服务层向所述控制器发送所述接入信息。
本申请实施例提供的用于设备连接的方法,通过在第一电子设备的广播消息中携带第一角色信息,可以使得接收该广播消息的第二电子设备最终得到第一角色信息且基于第一角色信息确定自己的角色,尽可能在连接过程的初始阶段使得对端设备匹配到与第一电子设备的期望角色不同的期望角色,提高连接效率。
可选地,所述接入信息还包括:用于指示所述第二电子设备忽略所述第二电子设备的白名单的信息。
本申请实施例提供的用于设备连接的方法,在第二电子设备保存有白名单的情况下,第二电子设备并不限于与白名单中的设备连接,也想和未连接过的新的电子设备建立连接,因此,接入信息中携带用于指示忽略第二电子设备的白名单的信息可实现设备间的首次连接。此外,若第二电子设备之前使能了白名单,在与第一电子设备的首次连接时,若未忽略第二电子设备的白名单,位于第二电子设备周围的曾经与第二电子设备连接的其他电子设备可能会与第二电子设备实现自动连接,由于第二电子设备能够连接的设备是有限的,因此会影响第一电子设备与第二电子设备的连接,所以,通过用于指示第二电子设备忽略第二电子设备的白名单的信息使得第二电子设备不基于白名单进行设备连接,可以进一步保证第一电子设备与第二电子设备首次连接的成功性。
可选地,所述第二信息还包括用于指示所述第一短距离接入技术。
可选地,所述第一接入请求还包括所述第二电子设备的地址信息。
可选地,所述方法还包括:
所述基础服务层向所述基础应用层发送用于指示所述控制通道可用的信息。
第三方面,提供了一种用于设备连接的方法,应用于第二电子设备中,所述第二电子设备支持短距离接入技术,所述第二电子设备的连接模式为多设备连接模式,所述方法包括:
所述第二电子设备在扫描到第一电子设备的广播消息后,发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述的第二电子设备,所述第一电子设备是所述第二电子设备的白名单内的设备;
所述第二电子设备接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述第二电子设备;
所述第二电子设备建立逻辑通道,以建立对应于所述逻辑通道的控制通道;
在满足预设条件的情况下,所述第二电子设备停止扫描;或,在不满足预设条件的情况下,所述第二电子设备继续扫描;其中,所述预设条件包括以下任一项:
所述第二电子设备的扫描定时器超时;或,
所述第一电子设备为所述第二电子设备扫描到的第N个设备;或,
所述第一电子设备为所述第二电子设备扫描到的第N个设备且所述第二电子设备完成所述控制通道的建立;或,
在所述第二电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备;或,
在所述第二电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述第二电 子设备扫描到的第N个设备且所述第二电子设备完成控制通道的建立;
其中,所述第二电子设备扫描到的包括所述第一电子设备在内的N个设备是所述第二电子设备的白名单内的设备,N是所述第二电子设备能够连接的设备的最大数量,N为大于1的整数。
本申请实施例提供的用于设备连接的方法,在第二电子设备支持多设备连接模式的情况下,第二电子设备在满足预设条件时才会停止扫描以停止整个连接过程,否则,在不满足预设条件时会继续扫描以实现多设备连接,这样,第二电子设备不需要每次连接设备时都重新开始连接的流程(例如,由上层下发连接信息、扫描参数等),不仅有效地减少了信令开销,而且,减少了多设备连接过程的时延从而实现多个设备的快速连接。
第四方面,提供一种用于设备连接的电子设备,所述电子设备用于执行上述第一方面或第二方面或第三方面中任一方面提供的方法。具体地,所述电子设备可以包括用于执行上述第一方面或第二方面或第三方面中任一方面中任一种可能实现方式的模块。
第五方面,提供一种用于设备连接的电子设备,包括处理器。该处理器与存储器耦合,可用于执行存储器中的指令,以实现上述第一方面或第二方面或第三方面中任一方面中任一种可能实现方式中的方法。可选地,该电子设备还包括存储器。可选地,该装置还包括通信接口,处理器与通信接口耦合。
第六方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被装置执行时,使得所述装置实现上述第一方面或第二方面或第三方面中任一方面中任一种可能实现方式中的方法。
第七方面,提供一种包含指令的计算机程序产品,所述指令被计算机执行时使得装置实现上述第一方面或第二方面或第三方面中任一方面中任一种可能实现方式中的方法。
第八方面,提供一种芯片,包括:输入接口、输出接口、处理器和存储器,所述输入接口、输出接口、所述处理器以及所述存储器之间通过内部连接通路相连,所述处理器用于执行所述存储器中的代码,当所述代码被执行时,所述处理器用于执行上述第一方面或第二方面或第三方面中任一方面中任一种可能实现方式中的方法。
附图说明
图1是本申请实施例提供的一种通信系统的示意图。
图2是本申请实施例提供的电子设备200的示意性结构图。
图3是本申请实施例提供的短距离接入技术的协议架构的示意图。
图4是本申请实施例提供的用于设备连接的方法400示意性流程图。
图5是本申请实施例提供的用于设备连接的方法500的示意性流程图。
图6是本申请实施例提供的设备的方法600示意性流程图。
图7是本申请实施例提供的用于设备连接的方法700的示意性流程图。
图8是本申请实施例提供的断开控制通道的方法800的示意性流程图。
图9是本申请实施例提供的用于设备连接的方法900的示意性流程图。
图10是本申请实施例提供的用于设备连接的方法1000的示意性流程图。
图11是本申请实施例提供的用于设备连接的方法1100的示意性流程图。
图12示是本申请实施例提供的电子设备1200的示意性框图。
图13示是本申请实施例提供的电子设备1300的示意性结构图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请实施例可以应用于电子设备之间的各种短距离接入技术,该短距离接入技术包括但不限于:星闪基础(sparklink basic,SLB)接入技术和星闪低功耗(sparklink low energy,SLE)接入技术。其中,SLB可支持例如投屏、虚拟现实(virtual reality,VR)、车载通信等大带宽业务的传输,SLE可支持例如播放音视频、键盘、鼠标、电子笔等小带宽、低速率、低功耗业务的传输。下文若无特殊说明,文中描述的接入技术表示的都是短距离接入技术,以及,将SLB接入技术简称为SLB,将SLE接入技术简称为SLE。
图1是本申请实施例提供的一种通信系统的示意图。如图1所示,该通信系统中包括至少一个第一电子设备(例如,第一电子设备21、22和23)和第二电子设备11,第二电子设备11和每个第一电子设备可通过短距离接入技术建立连接以进行通信。应理解,图1所示的通信系统仅为示意性说明,该通信系统中还可以包括其他设备,例如,该通信系统中还可以包括路由器或基站等设备。需要说明的是,本申请实施例对通信系统中包括的第一电子设备和第二电子设备的数量不做任何限定。
本申请实施例的第一电子设备可以是例如键盘、鼠标、电子书、耳机、屏幕、摄像头、VR眼镜、车载中控台以及智能家居设备等,示例性地,智能家居设备可以是智能空气净化器、智能空调、智能摄像头、智能闹钟、扫地机器人、或智能音箱等设备。在一些实施例中,第一电子设备也可以是例如手机、平板电脑、具备无线通讯功能的可穿戴电子设备(如智能手表)等。
本申请实施例的第二电子设备可以是例如手机、平板电脑、具备无线通讯功能的可穿戴电子设备(如智能手表)等。第二电子设备可以是包括但不限于搭载
Figure PCTCN2022108173-appb-000001
Figure PCTCN2022108173-appb-000002
Windows、Linux或者其它操作系统的便携式电子设备。在一些实施例中,第二电子设备也可以是其它电子设备,诸如膝上型计算机(Laptop)、车载音箱、摄像头、后视镜等设备。
第一电子设备和第二电子设备可支持至少一种短距离接入技术。在一些实施例中,第一电子设备和第二电子设备可支持SLE和SLB中的至少一种。例如,手机、平板电脑、可穿戴设备等设备可同时支持SLE和SLB。再例如,VR眼镜、车载中控台可、摄像头可支持SLB。再例如,耳机、鼠标、键盘、电子书等设备可支持SLE。
图2是本申请实施例提供的电子设备200的示意性结构图。电子设备200可以是上述第一电子设备或第二电子设备。
电子设备200可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,无线通信模块250,传感器模块260等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit, GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的部件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备200也可以包括一个或多个处理器210。其中,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路间(inter-integrated circuit,I2C)接口,集成电路间音频(integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM卡接口,和/或USB接口等。其中,USB接口230是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口230可以用于连接充电器为电子设备200充电,也可以用于电子设备200与外围设备之间传输数据。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备200的结构限定。在本申请另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块240可以通过USB接口230接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块240可以通过电子设备200的无线充电线圈接收无线充电输入。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为智能设备供电。
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器220和无线通信模块250等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。
电子设备200的无线通信功能可以通过天线1,天线2以及无线通信模块250等实现。
无线通信模块250可以提供应用在电子设备200上的包括Wi-Fi,蓝牙(bluetooth,BT),SLE、SLB、无线数传模块(例如,433MHz,868MHz,915MHz)等无线通信的解决方案。无线通信模块250可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块250经由天线1或者天线2接收电磁波,将电磁波信号滤波以及调频处理,将处理后的信号发送到处理器210。无线通信模块250还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线1或者天线2转为电磁波辐射出去。
在一些实施例中,对于SLE,电子设备200作为广播方的第一电子设备,电子设备200可以通过无线通信模块发送广播消息,以便于周围的第二电子设备扫描到电子设备200以发起第一接入请求,示例性地,该广播消息中可以包括电子设备200的角色信息,用于指示电子设备200的期望角色是G节点设备或T节点设备(下文做详细说明),以便于第二电子设备确定自己的角色,第一接入请求中可以包括第二电子设备的角色信息。电子设 备200基于接收到的第一接入请求,向第二电子设备发送响应于第一接入请求的第一接入响应,以指示是否同意电子设备200接入第二电子设备,在同意电子设备200接入第二电子设备的情况下,电子设备200与第二电子设备建立逻辑通道以实现控制通道的连接,从而实现电子设备200与第二电子设备的连接。
在另一些实施例中,对于SLE和SLB,电子设备200作为接收广播消息的第二电子设备,电子设备200被配置为自动连接扫描模式和多设备连接模式,电子设备200扫描到第一电子设备发送的广播消息后,扫描到电子设备200的白名单内的第一电子设备后,可直接发起第一接入请求,并且,在多设备连接模式下,若满足预设条件,则停止扫描,若不满足预设条件,则继续扫描。
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器221可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器210可以通过运行存储在内部存储器221的上述指令,从而使得智能设备101执行本申请一些实施例中所提供的发现及配网的方法,以及各种应用以及数据处理等。内部存储器221可以包括代码存储区和数据存储区。其中,代码存储区可存储操作系统。数据存储区可存储电子设备200使用过程中所创建的数据等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储部件,闪存部件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器210可以通过运行存储在内部存储器221的指令,和/或存储在设置于处理器210中的存储器的指令,来使得电子设备200执行本申请实施例中所提供的发现及配网的方法,以及其他应用及数据处理。
图3是本申请实施例提供的短距离接入技术的协议架构的示意图。该协议结构应用于任何可实现短距离通信的电子设备中,例如,可应用于上文的第一电子设备和第二电子设备中。如图3所示,该协议架构包括但不限于主机(host)和控制器(controller),主机是控制器的上层协议,主机包括基础应用层和基础服务层。下面,对控制器、基础服务层和基础应用层做详细说明。
控制器
控制器定义了底层硬件部分,也可称为接入层,是协议架构的最底层,包括物理层和数据链路层。物理层利用传输介质为数据链路层提供物理连接,实现比特流的透明传输。数据链路层实现资源管理、访问控制、数据分段、级联、工作模式等功能,以保障数据的可靠传递。在一些实施例中,数据链路层包括媒体接入层和链路控制层,媒体接入层用于进行无线资源分配,并为链路控制层提供数据传输服务,链路控制层用于基于电子设备间建立的链路,并在控制链路上交互链路控制协议以起到物理/逻辑链路的管理以及设备行为的控制的作用。
控制器中建立有逻辑通道,该逻辑通道是上层的基础服务层中的传输通道的建立的基础,在该逻辑通道建立成功后,基础服务层的传输通道才可用。应理解,若无特殊说明,本申请实施例的逻辑通道是控制器中的基础的逻辑通道,控制器中还存在一种为某些特定业务(例如,高清通话)场景而提供的在基础的逻辑通道上建立的专有链路,这种专有链路也是一种逻辑通道,不过,需要在基础的逻辑通道的基础上建立。
此外,为了区分逻辑通道,定义了逻辑通道标识(logic channel identifier,LCID)。
控制器可支持不同的短距离接入技术,示例性地,控制器可支持SLE和SLB中的至少一种。实现中,该控制器可以以软件或硬件的形式存在。控制器可以集成在芯片中,在控制器可同时支持SLE和SLB的情况下,控制器可以集成在一个芯片上,该芯片实现SLE和SLB,控制器也可以分别集成在两个芯片上,两个芯片分别实现SLE和SLB。
基础服务层
基础服务层是位于控制器和基础应用层之间的协议层,包含了多个功能单元,与业务解绑,实现通用的功能流程。同时,为业务建立传输通道,对传输通道的数据进行处理。并发送给控制器。基础服务层包括但不限于以下功能模块:设备发现模块、服务管理模块、通道管理模块、服务质量(quality of service,Qos)管理模块、安全管理模块、多域协商模块、测量模块以及5G融合模块。
设备发现模块用于广播自身设备的能力,扫描满足业务需求的对端设备,此外,还同时支持SLB或SLE的互发现。
服务管理模块用于定义一种数据结构,为基础应用层的业务功能集提供控制指令和小数据的发送的数据模块。
通道管理模块用于基础应用层根据业务类型(business identifier,BID)和业务的Qos能力申请传输通道以进行数据流的传输,为业务管理传输通道的建立和释放,以及传输通道与逻辑链路的映射关系。
Qos管理模块用于业务的Qos请求静态表管理,以及与对端设备协商Qos。
安全管理模块用于基础服务层的安全连接。
多域协商模块用于对于存在多个域(子网)的场景,实现域之间的信息交互,实现多域间的干扰避免,负载平衡。
测量模块用于配置底层测量的周期,测量上报事件,测量值。用于调度,功率控制等。
5G融合模块用于建立具有蜂窝5G远端管理能力的通道,通过鉴权和认证机制,实现具有蜂窝5G远端控制功能的设备。
为了与控制器中的逻辑通道区分,定义了基础服务层的传输通道的传输通道标识(transmission channel identifier,TCID)。
基础服务层中的传输通道包括控制通道和业务通道,控制通道的建立是设备间建立业务通道的基础,本申请实施例涉及控制通道的相关内容,下文仅对控制通道做详细说明。对于每种接入技术(例如,SLE、SLB),基础服务层中可设计有至少一个控制通道,该至少一个控制通道对应一个逻辑通道。在一示例中,支持SLE的电子设备的基础服务层设计有一个控制通道,例如,SLE的控制通道的TCID为0x0008。在另一示例中,支持SLB的电子设备的基础服务层设计有一个控制通道,例如,SLB的TCID为0x0009。
需要说明的是,控制通道是已经在基础服务层中设计好的通道,但只有在控制器中的逻辑通道建立完成后,对应于逻辑通道的控制通道才可以被使用。所以,本申请实施例将建立逻辑通道以及控制通道可以被使用的过程称为控制通道的建立过程。
基础应用层
基础应用层用于承接上层应用(application,APP)的不同业务需求,并且分解数据到下层的基础服务层。具体地,基础应用层用于对业务进行分类,包含多个业务功能集合: 通用感知框架、通用设备管理框架、通用音视频框架、通用数据框架等。每个业务功能集合包含对业务的分类数据处理模块,例如,通用音视频框架包含编解码模块,通用数据框架包含对数据的加密压缩模块等。
在本申请实施例中,包括基础服务层和基础应用层的主机适配多种短距离接入技术(例如,SLE和SLB),或者说,主机可兼容多种接入技术,或者说,多种接入技术可采用统一的主机,即,无论控制器支持何种接入技术,上层都可采用统一的主机。
基于此,本申请实施例涉及电子设备中主机的控制通道,主要目的是实现主机中控制通道的建立以实现电子设备的连接,控制通道的建立是电子设备建立不同业务通道的基础,因此,控制通道的建立至关重要。此外,本申请实施例还涉及控制通道的释放,以减少不必要的资源的浪费。
首先,对本申请实施例中电子设备通信过程中涉及的主控(grant,G)节点设备和终端(terminal,T)节点设备做介绍。
电子设备通信过程中,任一个电子设备可作为G节点设备,另一个电子设备则作为T节点设备。某个电子设备是作为G节点设备还是T节点设备,可以称为电子设备的角色是G节点设备还是T节点设备。
在SLB中,由于SLB针对的是大带宽的业务,电子设备的角色可以是固定不变的,出厂时该电子设备的角色已经固定,唯一地作为G节点设备或T节点设备。示例性地,在车载设备中,车载中控台可固定地作为G节点设备,车内的例如摄像头、后视镜、车载音箱等设备都可固定地作为T节点设备。
在SLE中,由于SLE支持小带宽、低功耗、低速率的业务,产品具有灵活和小型化的特点,甚至同一个设备与多个设备连接时既可以是G节点设备也可以是T节点设备。因此,在SLE中,电子设备的角色是可变的,便于主机维护角色关系,尤其针对于多设备连接过程中角色发生变化的场景。此外,在SLE中,电子设备间的控制通道建立连接后,G节点设备发送C帧,C帧是一种控制帧,携带T设备的控制信息,用于实现对T节点设备的时序同步、资源分配以及调度功能,T节点设备接收C帧,且基于C帧向G节点设备发送T帧,T帧是一个数据帧,可实现短时序同步、控制信令以及数据传输的功能。因此,在SLE中,确定好电子设备的角色,也便于控制器基于确定好的G节点设备和T节点设备正确传输C帧、T帧等内容。示例性地,在电子设备与另一个电子设备首次连接时,该电子设备可以作为G节点设备,该另一个电子设备作为T节点设备,在该电子设备与该另一个电子设备再次连接过程中,该电子设备可以作为T节点设备,该另一个电子设备作为G节点设备,具体情况可基于实际情况灵活确定。
在控制通道的建立过程中,本申请实施例主要涉及两种场景,第一种场景是电子设备之间首次连接的场景,第二种场景是电子设备之间曾经已成功连接后续可自动连接的场景。
以下,以第一电子设备和第二电子设备为例,结合图3所示的协议架构,通过第一电子设备和第二电子设备之间以及电子设备内部各个层之间的交互,对上述两种场景下电子设备之间控制通道的建立过程做说明。其中,第一电子设备和第二电子设备中的基础服务层涉及设备发现模块、通道管理模块和安全管理模块。
场景1、电子设备之间首次连接
图4是本申请实施例提供的用于设备连接的方法400示意性流程图。该方法400描述的是第一电子设备和第二电子设备基于SLE实现控制通道的建立以实现首次连接的过程。 作为示例,第一电子设备可以为耳机,第二电子设备可以为手机。
方法400的过程主要如下:过程1、第一电子设备发送广播消息,周围的第二电子设备基于该广播消息执行相关操作。过程2、第一电子设备和第二电子设备进行控制通道的建立。在一些实施例中,第一电子设备和第二电子设备还可以对控制通道进行鉴权加密,以保护用户隐私。
过程1、第一电子设备发送广播消息,第二电子设备基于该广播消息执行相关操作。
S411、第一电子设备的基础应用层向基础服务层的设备发现模块发送通知事件,该通知事件用于确定第一电子设备的角色信息。
第一电子设备的角色信息用于指示第一电子设备的期望角色为G节点设备或T节点设备,可以为后续确定第二电子设备的期望角色以及第一电子设备和第二电子设备的最终角色提供一定的参考。可选地,第一电子设备的角色信息还用于指示第一电子设备的期望角色是否可以协商,以便于在第一电子设备和第二电子设备的期望角色相同时通过协商来更换期望角色以确定两个电子设备的最终角色。
第一电子设备的期望角色表示第一电子设备期望成为的角色,第一电子设备的最终角色表示第一电子设备最终实际成为的角色,两者可能相同,也可能不同,下文对第二电子设备的期望角色和最终角色的解释同此处,不再赘述。
在第一电子设备的角色信息用于指示第一电子设备的期望角色和该期望角色是否可协商时,示例性地,第一电子设备的角色信息可以采用2比特(bit)表示,一个比特(记为第一比特)用于指示第一电子设备的期望角色,另一个比特(记为第二比特)用于指示该角色是否可协商。
在一示例中,第一比特是2个比特中的低位比特,第二比特是2个比特中的高位比特。
在另一示例中,第一比特是2个比特中的高位比特,第二比特是2个比特中的低位比特。
在一示例中,第一比特为“0”表示T节点设备,第一比特为“1”表示G节点设备。
在另一示例中,第一比特为“1”表示T节点设备,第一比特为“0”表示G节点设备.
在一示例中,第二比特为“0”表示角色可协商,第二比特为“1”表示角色不可协商。
在另一示例中,第二比特为“1”表示角色可协商,第二比特为“0”表示角色不可协商。
以第一比特是低位比特、第二比特是高位比特、第一比特为“0”表示T节点设备、第一比特为“1”表示G节点设备、第二比特为“0”表示角色可协商,第二比特为“1”表示角色不可协商为例,表1示出了第一电子设备的角色信息的各种可能的情况。如表1所示,示出了角色信息的4种情况,一行表示角色信息的一种情况,每种情况由角色是否可协商和期望角色组合而成。“Y”表示角色可协商,“N”表示角色不可协商,“T”表示T节点设备,“G”表示G节点设备。
表1
Figure PCTCN2022108173-appb-000003
Figure PCTCN2022108173-appb-000004
在一些实施例中,通知事件包括用户针对第一电子设备的操作的信息。对于SLE而言,若第一电子设备为耳机,示例性地,用户对第一电子设备的操作可以是长按键;若第一电子设备为手机,示例性地,用户对第一电子设备的操作可以是打开设置中关于SLE的开关;若第一电子设备为键盘,示例性地,用户对第一电子设备的操作可以是按压用于连接的物理开关。在该实施例中,基础应用层获取用户针对第一电子设备的操作,并将该操作发送给基础服务层的设备发现模块,以便于设备发现模块确定第一电子设备与其他电子设备进行通信使用的接入技术为SLE,且确定第一电子设备的角色信息。
在另一些实施例中,通知事件包括用于指示接入技术为SLE的信息。在该实施例中,基础应用层获取用户针对第一电子设备的操作,且基于该操作确定第一电子设备与其他电子设备进行通信使用的接入技术为SLE,以便于设备发现模块确定第一电子设备的角色信息。
在另一些实施例中,通知事件包括第一电子设备的角色信息。在该实施例中,基础应用层获取用户针对第一电子设备的操作,基于该操作确定第一电子设备与其他电子设备进行通信使用的接入技术为SLE,且确定第一电子设备的角色信息。
示例性地,可以根据业务类型以及第一电子设备的历史角色来确定第一电子设备的角色信息。例如,第一电子设备为耳机,业务类型是音频业务,期望角色可以为T节点设备。再例如,第一电子设备的历史角色为T节点设备,则这里确定的期望角色为T节点设备。
S412、第一电子设备的设备发现模块配置且向控制器发送广播事件,该广播事件用于指示广播策略,包括用于广播的参数。
用于广播的参数包括但不限于:广播模式(adv mode),发现等级、广播间隔、广播时长、广播标记(adv flag)。
广播模式为需要其他设备和第一电子设备建立连接。发现等级为例如不可发现、一般发现、优先发现中的任一个等级。广播间隔表示发送广播消息的周期,广播时长表示每次广播的时长。广播标记表示公共(public)或私有广播地址。
可选地,广播事件还包括第一电子设备的角色信息。
可选地,广播事件还包括用于指示请求接入至第一电子设备的设备的设备过滤信息,对于首次连接,该设备过滤信息用于指示允许第一电子设备接入第一电子设备的白名单以内和以外的设备,即,允许第一电子设备接入所有请求接入至第一电子设备的设备,其中,第一电子设备的白名单内的设备是曾经与第一电子设备连接过的设备。这样,可以实现第一电子设备与新的电子设备(例如,第二电子设备)的首次连接过程。这是因为,虽然第一电子设备内保存有白名单,但第一电子设备并不限于与白名单中的设备连接,也想和未连接过的新的电子设备建立连接,因此,可以通过设备过滤信息指示允许第一电子设备接入第一电子设备的白名单以内和以外的设备以实现第一电子设备与新的电子设备的首次连接。在一示例中,白名单中包括至少一个电子设备的媒体接入控制(media access control,MAC)地址,每个电子设备的MAC地址用于唯一标识每个电子设备。S413、第一电子设备的设备发现模块根据通知事件,向通道管理模块发送第一信息。
设备发现模块根据通知事件,确定第一电子设备与其他电子设备进行通信使用的接入技术,从而,确定以及向通道管理模块发送第一信息。
对于SLE,第一信息包括第一电子设备的角色信息,以便于后续确定第一电子设备和第二电子设备的最终角色。可选地,第一信息还可以包括用于指示第一电子设备的广播状态的广播状态信息,该广播状态信息用于指示该第一电子设备处于广播状态,以便于在完成控制通道的连接后及时停止广播,从而节省功耗。
S414、第一电子设备的控制器根据广播事件,发送广播消息。
控制器基于从S412中接收到的广播事件确定且发送广播消息,该广播消息包括但不限于:第一电子设备的地址信息、广播模式(adv mode),广播标记(adv flag)。
可选地,在广播事件还包括第一电子设备的角色信息的情况下,所述广播消息还包括所述第一电子设备的角色信息。
应理解,不同的接入技术对应不同的广播消息的格式,以SLE和SLB为例,SLE对应一种广播消息的格式,SLB对应另一种广播消息的格式,两种广播消息的格式不同。示例性地,不同的接入技术对应的广播消息的格式可以是协议预定义的。只有广播消息的发送方和接收方支持同一种接入技术时,接收方才能成功解析该广播消息,否则,广播消息解析失败。
需要说明的是,本申请实施例中各步骤的序号的大小并不意味着执行顺序的先后,各步骤的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
例如,S412可在S413之前或之后或可与S413同时执行。
再例如,S414可在S413之前或之后或可与S413同时执行。
S415、第二电子设备的基础应用层向设备发现模块发送扫描模式信息,该扫描模式信息用于指示第二电子设备的扫描模式为默认扫描模式。
默认扫描模式表示第二电子设备可以扫描任何能够扫描到的设备,不需要有选择性地扫描周围的设备或过滤掉一些设备,适用于两个电子设备之间首次连接的场景。
相对于默认扫描模式,另一种扫描模式是自动连接扫描模式,这种扫描模式需要在一定限制条件下扫描周围的设备或过滤掉一些设备,适用于两个电子设备之间自动连接的场景,下文方法600中做了具体说明。
S416、第二电子设备的设备发现模块基于默认扫描模式,配置且向控制器发送扫描参数。
示例性地,该扫描参数包括但不限于以下至少一个参数:扫描时长、扫描间隔等。
需要说明的是,S415和S416与S411-S414的执行顺序并无固定的先后顺序,可任意变化,只要S415和S416在S417之前执行即可。例如,S415和S416在S411-S414之前或之后或可同时执行。再例如,S415和S416可在S411-S414中任一个步骤之前或之后或可同时执行。
S417、第二电子设备的控制器根据扫描参数对周围的设备进行扫描,扫描到第一电子设备的广播消息,基于该广播消息得到扫描结果,通过设备发现模块向基础应用层发送该扫描结果,即,控制器向设备发现模块发送扫描结果,设备发现模块将该扫描结果发送给基础应用层。
其中,扫描结果包括从广播消息中得到的第一电子设备的地址信息。
可选地,在广播消息包括第一电子设备的角色信息的情况下,扫描结果也包括第一电子设备的角色信息。
应理解,由于第一电子设备的广播消息是对应于SLE的格式,所以,只有在第二电子设备支持SLE的情况下,第二电子设备才能成功解析第一电子设备发送的广播消息,才能成功执行S417。
若第二电子设备不支持SLE,则无法执行S417,两个电子设备的连接失败,整个流程结束。
S418、第二电子设备的基础应用层根据扫描结果,向通道管理模块发送第二信息。
在一些实施例中,第二信息可以是S418中的扫描结果。可选地,第二信息还可以包括:第二电子设备与第一电子设备进行通信的接入技术为SLE。
实现中,基础应用层可以根据用户操作以及从S417中得到的扫描结果,向通道管理模块发送第二信息。
在一些实施例中,基础应用层将扫描结果上报至APP,APP中显示发现设备列表,用户在发现设备列表中点击第一电子设备,基础应用层基于用户对第一电子设备的操作,向通道管理模块发送第二信息。例如,以手机为例,APP可以是“设置(setting)”。
过程2、第一电子设备和第二电子设备进行控制通道的建立。
S419、第二电子设备的通道管理模块根据第二信息,向控制器发送该接入信息。
通道管理模块根据第二信息,确定接入信息,且向控制器发送该接入信息。
对于SLE,接入信息包括但不限于以下内容:第二电子设备的角色信息、第一电子设备的地址信息。其中,第一电子设备的地址信息从第二信息中得到。
第二电子设备的角色信息用于指示第二电子设备的期望角色为G节点设备或T节点设备。可选地,第二电子设备的角色信息还用于指示第二电子设备的角色是否可以协商,以便于确定第二电子设备的最终角色。第二电子设备的角色信息的表现形式可参考上文关于第一电子设备的角色信息的表现形式的具体描述,不再赘述。
在一些实施例中,第二电子设备的通道管理模块可以根据业务类型以及第二电子设备的历史角色来确定第二电子设备的角色信息。例如,第二电子设备为手机,业务类型是音频业务,期望角色可以为G节点设备。再例如,第二电子设备的历史角色为G节点设备,则这里确定的期望角色为G节点设备。
在另一些实施例中,在第二信息中包括第一电子设备的角色信息的情况下,第二电子设备的通道管理模块可以根据第二信息中携带的第一电子设备的角色信息确定(或匹配)第二电子设备的角色信息,以使得得到的第二电子设备的期望角色与第一电子设备的期望角色不同。
在一示例中,若第一电子设备的期望角色为T节点设备,无论该T节点设备是否可协商,第二电子设备的通道管理模块确定的第二电子设备的期望角色都可以为G节点设备。
在另一示例中,若第一电子设备的期望角色为G节点设备,无论该G节点设备是否可协商,第二电子设备的通道管理模块确定的第二电子设备的期望角色都可以为T节点设备。
在上述示例中,第二电子设备的期望角色可以根据第一电子设备的期望角色确定,以使得两个电子设备的期望角色不同。但是,在一些场景中,两个电子设备都期望成为G节点设备或T节点设备,导致双方的期望角色相同,在这种情况下,可以通过双方的角色信 息指示期望角色以及是否可协商进行角色协商,以使得双方的最终角色不同。示例性地,可以由第一电子设备执行角色协商,在可以协商的情况下,更换第一电子设备的角色,具体描述参考下文S422的具体描述。
可选地,接入信息还包括该第二电子设备的地址信息。该第二电子设备的地址信息可以最终被发送至第一电子设备,以便于在两个电子设备连接成功后使得第一电子设备更新白名单(参考S434),以及,在两个电子设备之间完成鉴权加密后使得第一电子设备保存第二电子设备的地址以将第二电子设备作为可信任的设备(参考S436)。
可选地,接入信息还可以包括:用于指示第二电子设备忽略第二电子设备的白名单的信息。第二电子设备的白名单中的设备是曾经与第二电子设备连接过的设备,指示第二电子设备忽略第二电子设备的白名单表示第二电子设备可以与白名单以外的设备连接。
在第二电子设备保存有白名单的情况下,第二电子设备并不限于与白名单中的设备连接,也想和未连接过的新的电子设备建立连接,因此,接入信息中可以携带用于指示忽略第二电子设备的白名单的信息。若第二电子设备之前使能了白名单,在与第一电子设备的首次连接时,若未忽略第二电子设备的白名单,位于第二电子设备周围的曾经与第二电子设备连接的其他电子设备可能会与第二电子设备实现自动连接,由于第二电子设备能够连接的设备是有限的,因此会影响第一电子设备与第二电子设备的连接。所以,通过用于指示第二电子设备忽略第二电子设备的白名单的信息使得第二电子设备不基于白名单进行设备连接,可以进一步保证第一电子设备与第二电子设备首次连接的成功性。
可选地,接入信息还可以包括用于指示发送周期(interval)的信息、用于指示响应时长(timeout)的信息。这些参数可用于后续的数据传输。
发送周期和响应时长是在控制通道建立成功后传输数据的过程中使用的参数。发送周期表示发送数据的间隔时间,响应时长表示接收到数据后发送针对该数据的内容的有效时长。这两个参数后续被保存至第一电子设备的控制器内,以便于后续的数据传输。
S420、第二电子设备的控制器根据接入信息,向第一电子设备发送第一接入请求,该第一接入请求用于请求第一电子设备接入第二电子设备。
对应地,第一电子设备的控制器接收该第一接入请求。
控制器基于接入信息发送第一接入请求,第一接入请求包括但不限于:第二电子设备的角色信息和第一电子设备的地址信息。
可选地,第一接入请求还包括第二电子设备的地址信息,以便于在第一电子设备和第二电子设备连接成功后使得第一电子设备更新白名单(参考S434),以及,在两个电子设备之间完成鉴权加密后使得第一电子设备保存第二电子设备的地址以将第二电子设备作为可信任的设备(参考S436)。第二电子设备的地址信息可以从S419的接入信息中得到。
可选地,第一接入请求还可以包括以下至少一项:用于指示发送周期(interval)的信息、用于指示响应时长(timeout)的信息。上述至少一项可从S419的接入信息中得到。
第一电子设备接收到该第一接入请求后,基于该第一接入请求执行相关操作(S421-S428),以确定是否同意接入第二电子设备以与第二电子设备建立连接以及在同意接入第二电子设备的情况下实现控制通道的建立。
S421、第一电子设备的控制器根据第一接入请求,向通道管理模块发送第二接入请求,以请求第一电子设备接入第二电子设备,其中,该第二接入请求包括第二电子设备的角色信息。
可选地,第二接入请求还包括第二电子设备的地址信息,可以使得第一电子设备和第二电子设备在完成鉴权加密过程后将该地址信息表示的地址保存至本地以将第二电子设备作为可信任的设备,可参考S436。第二电子设备的地址信息可以从S420的第一接入请求中得到。
S422、第一电子设备的通道管理模块确定第一电子设备和第二电子设备最终的角色。
通道管理模块根据从S413的第一信息中得到的第一电子设备的角色信息和从S421的第二接入请求中得到的第二电子设备的角色信息,确定第一电子设备和第二电子设备的最终角色。应理解,这里确定的最终角色,与电子设备的期望角色可能相同,也可能不同。下面,结合表2,分两种情况对该过程进行描述。
表2以表1所示的角色信息为例,示出了基于两个电子设备的角色信息的各种可能的情况确定的两个电子设备的最终角色。
应理解,以01(可协商,G)为例,括号中的文字是对2个比特的含义的解释说明,高位的“0”表示角色可协商,低位的“1”表示期望角色是G。
还应理解,不考虑特殊情况,表中的“NA”表示不存在的情况。原因在于,当第一电子设备的角色信息是不可协商时,在一种情况中,第二电子设备可以根据第一电子设备的角色信息确定匹配的角色,会得到与第一电子设备不同的期望角色,在另一种情况中,第二电子设备自己也想成为与第一电子设备相同的期望角色,所以,这种情况中的第二电子设备的期望角色与第一电子设备的期望角色相同且不可协商。因此,并不存在第一电子设备的期望角色不可协商,第二电子设备与第一电子设备的期望角色相同且可协商的情况。
表2
Figure PCTCN2022108173-appb-000005
情况1、第一电子设备的期望角色和第二电子设备的期望角色不同
在这种情况中,通道管理模块将第一电子设备的期望角色确定为最终角色,将第二电子设备的期望角色确定为最终角色。
以表2为例,第一电子设备的角色信息是“00(可协商,T)”与第二电子设备的角色信息是“01(可协商,G)”或“11(不可协商,G)”,第一电子设备的角色信息是“01(可协商,G)”与第二电子设备的角色信息是“00(可协商,T)”或“10(不可协商,T)”,第一电子设备的角色信息是“10(不可协商,T)”与第二电子设备的角色信息是“01(可协商,G)”或“11(不可协商,G)”,第一电子设备的角色信息是“11(不可协商,G)”与第二电子设备的角色信息是“00(可协商,T)”或“10(不可协商,T)”,每种情况中表示的两个电子设备的期望角色都不同,那么,每个电子设备的角色不发生变化,将每个电子设备的期望角色确定为最终角色。
情况2、第一电子设备的期望角色和第二电子设备的期望角色相同
在这种情况中,通道管理模块进行角色协商,重新确定第一电子设备和第二电子设备的角色,以确定双方的最终角色。示例性地,可以根据第一电子设备与第二电子设备的期望角色是否协商更换第一电子设备的期望角色,以确定最终角色。下面,具体分为3种情况做说明。
情况2-1、第一电子设备的期望角色可协商、第二电子设备的期望角色可协商
在一示例中,更换第一电子设备的期望角色,第二电子设备的期望角色不变,这样,第一电子设备的最终角色是更换后的期望角色,第二电子设备的最终角色是期望角色。如表2所示,例如,第一电子设备的角色信息是“00(可协商,T)”和第二电子设备的角色信息是“00(可协商,T)”,第一电子设备的角色由“T”变为“G”,第二电子设备的角色不变;再例如,第一电子设备的角色信息是“01(可协商,G)”和第二电子设备的角色信息是“01(可协商,G)”,第一电子设备的角色由“G”变为“T”,第二电子设备的角色不变。
情况2-2、第一电子设备的期望角色可协商,第二电子设备的期望角色不可协商
在该情况中,更换第一电子设备的期望角色,第二电子设备的期望角色不变,这样,第一电子设备的最终角色是更换后的期望角色,第二电子设备的最终角色是期望角色。如表2所示,例如,若第一电子设备的角色信息是“00(可协商,T)”和第二电子设备的角色信息是“10(不可协商,T)”,则第一电子设备的角色由“T”变为“G”,第二电子设备的角色不变,继续为“T”;再例如,若第一电子设备的角色信息是“01(可协商,G)”和第二电子设备的角色信息是“11(不可协商,G)”,则第一电子设备的角色由“G”变为“T”,第二电子设备的角色不变,继续为“G”。
情况2-3、第一电子设备的期望角色和第二电子设备的期望角色都不可协商
在该情况中,由于双方的角色都不可协商,导致接入失败,可直接执行S426和S427,向第二电子设备发送第一请求响应,以表示接入失败。如表2所示,例如,若第一电子设备的角色信息是“10(不可协商,T)”和第二电子设备的角色信息是“10(不可协商,T)”;再例如,第一电子设备的角色信息是“11(不可协商,G)”和第二电子设备的角色信息是“11(不可协商,G)”。
可选地,S423、第一电子设备的通道管理模块向基础应用层发送第三接入请求,以请 求第一电子设备接入第二电子设备。
示例性地,在S411中的通知事件包括第一电子设备的角色信息的情况下,该第三接入请求包括用于指示第一电子设备的最终角色和第二电子设备的最终角色的信息,以在双方的电子设备的角色发生变化后基础应用层可以获知最终的角色,便于角色维护。
可选地,S424、第一电子设备的基础应用层根据第三接入请求,进行能力判断,以确定是否同意第一电子设备接入第二电子设备。
在一些实施例中,可以根据第一电子设备当前能够连接的电子设备的数量确定是否同意第一电子设备接入第二电子设备。应理解,这里的“当前”表示第二电子设备请求第一电子设备接入第二电子设备的时间。
若第一电子设备当前能够连接的电子设备的数量大于或等于1,则表示第一电子设备有能力接入第二电子设备,可同意第一电子设备接入第二电子设备;若第一电子设备当前能够连接的电子设备的数量为0,则表示第一电子设备无能力接入第二电子设备,不同意第一电子设备接入第二电子设备。
示例性地,第一电子设备本身可连接的电子设备的数量是M,M为大于或等于1的整数,在第二电子设备请求第二电子设备接入第一电子设备时,若第一电子设备正在和M个电子设备保持连接,意味着第一电子设备当前能够连接的电子设备的数量为0,暂时没有能力接入第二电子设备建立连接,不同意第一电子设备接入第二电子设备;若第一电子设备正在和少于M个电子设备保持连接,意味着第一电子设备当前能够连接的电子设备的数量大于或等于1,则有能力接入第二电子设备,同意第一电子设备接入第二电子设备。
在另一些实施例中,可以根据用户操作确定是否同意第一电子设备接入第二电子设备。
示例性地,在基础应用层接收到第三接入请求后,将该第三接入请求上报至APP(例如,设置),APP中显示用于请求第一电子设备接入第二电子设备的请求,若用户拒绝该请求,则表示第一电子设备无能力接入第二电子设备,不同意第一电子设备接入第二电子设备若用户接收该请求,则表示第一电子设备有能力接入第二电子设备,同意第一电子设备接入第二电子设备。
可选地,S425、第一电子设备的基础应用层向通道管理模块发送响应于第三接入请求的第三请求响应,该第三请求响应用于指示同意第一电子设备接入第二电子设备。
在一些实施例中,若S424中确定同意第一电子设备接入第二电子设备,则第三请求响应指示同意第一电子设备接入第二电子设备。
在另一些实施例中,若S424中确定不同意第一电子设备接入第二电子设备,则第三请求响应指示不同意第一电子设备接入第二电子设备。
可选地,在不同意第一电子设备接入第二电子设备的情况下,第三请求响应还可用于指示不同意第一电子设备接入第二电子设备的原因,原因可以基于能力判断的条件示出。示例性地,若在S424中是基于第一电子设备当前可连接的电子设备的数量进行能力判断,则原因可以是第一电子设备的资源受限,若在S424中是基于用户操作进行能力判断,则原因可以是用户拒绝。
S426、第一电子设备的通道管理模块向控制器发送第二请求响应,该第二请求响应用于指示是否同意第一电子设备接入第二电子设备。
在一些实施例中,通道管理模块可以基于S425发送的第三请求响应和在S423-S425中确定双方的最终角色的过程,最终确定是否同意第一电子设备接入第二电子设备,且向 控制器发送用于指示是否同意第一电子设备接入第二电子设备的第二请求响应。
在一示例中,第三请求响应指示第一电子设备同意接入第二电子设备且通道管理模块成功确定双方的最终角色,意味着第一电子设备可以接入第二电子设备,所以,第二请求响应用于指示同意第一电子设备接入第二电子设备。
在另一示例中,第三请求响应指示不同意第一电子设备接入第二电子设备且通道管理模块成功确定双方的最终角色,意味着第一电子设备不能接入第二电子设备,所以,第二请求响应用于指示不同意第一电子设备接入第二电子设备。
可选地,在第二请求响应指示不同意第一电子设备接入第二电子设备的情况下,第二请求响应还可用于指示不同意接入第二电子设备的原因。原因可基于实际情况确定,示例性地,原因可以是第一电子设备的资源受限或用户拒绝中的任一个。
需要说明的是,在S422中通道管理模块未成功确定双方的最终角色的情况下,第一电子设备可直接执行S426和S427,流程结束,不再执行S423和S424。
在另一些实施例中,通道管理模块可以仅基于在S422中确定的双方的最终角色,确定是否同意第一电子设备接入第二电子设备。若通道管理模块成功确定双方的最终角色,则第二请求响应用于指示同意第一电子设备接入第二电子设备,若通道管理模块未成功确定双方的最终角色,则第二请求响应用于指示不同意第一电子设备接入第二电子设备。
S427、第一电子设备的控制器向第二电子设备发送响应于第一接入请求的第一请求响应,该第一请求响应用于指示是否同意第一电子设备接入第二电子设备。
控制器基于第二请求响应确定且发送第一请求响应。应理解,第一请求响应至少具有与第二请求响应相同的功能,但由于两个请求响应的发送端和接收端不同,可能导致两个请求响应的格式不同。
在第一请求响应指示同意第一电子设备接入第二电子设备的情况下,继续执行S428和S429,在第一请求响应指示不同意第一电子设备接入第二电子设备的情况下,流程终止。
S428和S429、第一电子设备的控制器向通道管理模块发送逻辑通道标识(LCID),第二电子设备的控制器根据接收到的第一请求响应信息,向通道管理模块发送逻辑通道标识(LCID)。
第一电子设备的控制器建立逻辑通道,逻辑通道建立完成后向通道管理模块发送建好的逻辑通道的LCID。第二电子设备的控制器在接收到第一请求响应后,建立逻辑通道,逻辑通道建立完成后向通道管理模块发送建好的逻辑通道的LCID。
在过程2进行控制信道的连接的过程中,由期望的G节点设备(例如,第一电子设备)计算LCID,并将该LCID发送给对端设备(例如,第二电子设备),使得两端的LCID一致。在第一电子设备的控制器接收到第二请求响应或控制器发送第一请求响应后,第一电子设备的控制器建立LCID标识的逻辑通道,并将LCID发送给通道管理模块,在第二电子设备的控制器接收到第一请求响应后,第二电子设备的控制器建立LCID标识的逻辑通道,并将LCID发送给通道管理模块。
如前所述,控制通道是在基础服务层中设计好的通道,逻辑通道建立完成后,对应的控制通道才可以被使用。这样,当第一电子设备的逻辑通道建立完成后,通道管理模块可基于LCID确定该LCID对应的控制通道,以使用对应的控制通道;同理,当第二电子设备的逻辑通道建立完成后,通道管理模块可基于LCID确定对应的控制通道,以使用对应 的控制通道,从而,实现了电子设备之间控制通道的建立。
以上,通过过程1和过程2实现了第一电子设备和第二电子设备的控制通道的建立。
可选地,S430、第一电子设备的通道管理模块向设备发现模块发送用于指示停止广播的信息。这样,设备发现模块可以停止发送广播事件,使得第一电子设备停止当前事件的广播,节省了功耗。
需要说明的是,在S413的第一信息中携带广播状态信息的情况下,通道管理模块可以明确知道第一电子设备处于广播状态,因此,在控制通道建立完成后,通知设备发现模块停止广播,节省功耗。所以,用于指示停止广播的信息可以理解为响应于第一信息中携带的广播状态信息的信息。
可选地,S431、第一电子设备和第二电子设备进行控制通道的鉴权加密。
该步骤可以理解为一个安全过程,目的是为了保障数据的安全传输以保护用户隐私。
在该步骤中,示例性地,第一电子设备的通道管理模块向安全管理模块发送安全请求,该安全请求中包括第二电子设备的地址,安全管理模块基于该安全请求和第二电子设备进行交互,第二电子设备和第一电子设备对控制通道进行鉴权加密,最终生成后续用于加密数据的密钥,第一电子设备和第二电子设备的安全管理模块向各自的通道管理模块发送用于指示鉴权加密完成的信息。
可选地,执行完S431后,第一电子设备和第二电子设备可将对端作为自己的可信任设备,各自的通知管理模块保存对端的地址,可参考S436和S437所示。
可选地,S432和S433、第一电子设备的通道管理模块向基础应用层发送用于指示控制通道可用的信息,第二电子设备的通道管理模块向基础应用程发送用于指示控制通道可用的信息。这样,可以使得基础应用层确知控制通道已经建立成功,可发起后续的业务通道的建立以及数据传输。
需要说明的是,在无S431的情况下,S432可在428或S430之后执行,S433可在S429之后执行。
可选地,S434、第一电子设备更新白名单,即,将第二电子设备的地址保存至白名单中,以便于后续再次需要和第二电子连接时实现自动连接。
在一示例中,在执行完S431后,第一电子设备的通道管理模块可以向控制器发送用于指示更新白名单的更新信息,控制器基于该更新信息将第二电子设备的地址保存至白名单中。这样,在实现鉴权加密完成后更新白名单,保证了安全性。
应理解,第一电子设备更新白名单的步骤还可以在S419之后的任一个步骤执行。例如,在S428之后,第一电子设备的控制通道的建立完成后控制器更新白名单。再例如,在S420中,第一电子设备的控制器从第一接入请求中得到第二电子设备的地址,将其保存至白名单中以更新白名单。
可选地,S435、第二电子设备更新白名单,即,将第一电子设备的地址保存至白名单中,以便于后续再次需要和第一电子连接时实现自动连接。
在一示例中,在执行完S431后,第二电子设备的通道管理模块可以向控制器发送用于指示更新白名单的更新信息,控制器基于该更新信息将第一电子设备的地址保存至白名单中。这样,在实现鉴权加密完成后更新白名单,保证了安全性。
应理解,第二电子设备更新白名单的步骤还可以在S418之后的任一个步骤执行。例如,在S429之后,第二电子设备的控制通道的建立完成后控制器更新白名单。再例如, 在S419中,第二电子设备的控制器从接入信息中得到第一电子设备的地址,将其保存至白名单中以更新白名单。
可选地,S436、第一电子设备保存与控制通道有关的属性信息,该属性信息包括但不限于:密钥、第二电子设备的地址,控制通道的状态,第一电子设备的角色。
密钥是S431中执行鉴权加密过程得到的密钥。第二电子设备的地址可以从S421的第二接入请求得到。若控制通道未建立成功,则控制通道的状态是连接态,若控制通道建立成功,则控制通道的状态是连接态,若控制通道正在建立中,则控制通道的状态是连接中。第一电子设备的角色表示的是第一电子设备的最终角色。
可选地,在S437中,第二电子设备保存与控制通道有关的属性信息,该属性信息包括但不限于:密钥、第一电子设备的地址,控制通道的状态,第二电子设备的角色。
密钥是S431中执行鉴权加密过程得到的密钥。第一电子设备的地址可以从S418的第二信息中得到。若控制通道未建立成功,则控制通道的状态是连接态,若控制通道建立完成,则控制通道的状态是连接态,若控制通道正在建立中,则控制通道的状态是连接中。第二电子设备的角色表示的是第二电子设备的最终角色。
图5是本申请实施例提供的用于设备连接的方法500的示意性流程图。该方法500描述的是第一电子设备和第二电子设备基于SLB进行控制通道的建立以实现首次连接的过程。以车载设备为例,车载中控台为G节点设备,车内的例如手机、摄像头、车载音箱或后视镜等设备可以为T节点设备。示例性地,第一电子设备可以为车载中控台,第二电子设备可以为车内的例如手机、摄像头、车载音箱或后视镜等设备。
方法500的过程与方法400类似,也包括上述过程1和过程2,每个过程的具体步骤存在一些区别。
过程1、第一电子设备发送广播消息,第二电子设备基于该广播消息执行相关操作。
S511、第一电子设备的基础应用层向基础服务层的设备发现模块发送通知事件,该通知事件用于确定第一电子设备与其他电子设备进行通信使用的接入技术为SLB。
在一些实施例中,通知事件包括用于指示用户针对所述第一电子设备的操作的信息。对于SLB而言,以第一电子设备为车载中控台为例,用户对第一电子设备的操作可以是用户开启车载中控台以使得车载中控台上电。在该实施例中,基础应用层获取用户针对第一电子操作的操作,并将该操作发送给基础服务层的设备发现模块,以便于设备发现模块确定第一电子设备与其他电子设备进行通信使用的接入技术。
在另一些实施例中,该通知事件包括用于指示接入技术为SLB的信息。在该实施例中,基础应用层获取用户针对第一电子设备的操作,且基于该操作确定第一电子设备与其他电子设备进行通信使用的接入技术为SLB。
S512、第一电子设备的设备发现模块配置且向控制器发送广播事件,该广播事件包括于广播的参数。
可选地,广播事件还包括用于指示请求接入至第一电子设备的设备的设备过滤信息,对于首次连接,该设备过滤信息用于指示允许第一电子设备接入第一电子设备的白名单以内和以外的设备,即,允许第一电子设备接入所有请求接入至第一电子设备的设备,其中,第一电子设备的白名单内的设备是曾经与第一电子设备连接过的设备。
关于广播事件的具体描述参考上文的S412中的相关描述,不再赘述。
S513、第一电子设备的设备发现模块根据通知事件,向通道管理模块发送用于指示第 一电子设备的广播状态的广播状态信息。关于广播状态信息的具体描述参考上文的S413中的相关描述,不再赘述。
S514、第一电子设备的控制器根据广播事件,发送广播消息。
控制器基于从S512中接收到的广播事件确定广播消息且发送广播消息,该广播消息包括但不限于:系统消息、第一电子设备的地址信息。
系统消息用于对端设备(例如,第二电子设备)进行资源分配,包括但不限于:系统消息的发送周期(domainSysInforPeriod)、系统消息在一个发送周期内连续超帧的个数(domainSysInforOnDuartion)、非竞争接入资源(non contention access resource)、竞争接入资源(contention access resource)、允许接入的设备类型(例如,车载设备)
应理解,S514的广播消息的格式是SLB对应的广播消息的格式。
需要说明的是,S512可在S513之前或之后或可与S513同时执行,S514可在S513之前或之后或可与S513同时执行。
S515、第二电子设备的基础应用层向设备发现模块发送扫描模式信息,该扫描模式信息用于指示第二电子设备的扫描模式为默认扫描模式。
S516、第二电子设备的设备发现模块基于默认扫描模式,配置且向控制器发送扫描参数。
关于S515-S516的具体描述可参考上文S415-S416的相关描述,不再赘述。
S517、第二电子设备的控制器基于该扫描参数对周围的设备进行扫描,扫描到第一电子设备的广播消息,基于该广播消息得到扫描结果,通过设备发现模块向基础应用层发送该扫描结果,即,控制器向设备发现模块发送扫描结果,设备发现模块将该扫描结果发送给基础应用层。其中,扫描结果包括从广播消息中得到第一电子设备的地址信息。
应理解,由于第一电子设备的广播消息是对应于SLB的格式,所以,只有在第二电子设备支持SLB的情况下,第二电子设备才能成功解析第一电子设备发送的广播消息,才能成功执行S517。
若第二电子设备不支持SLB,则无法执行S517,两个电子设备的连接失败,整个流程结束。
S518,第二电子设备的基础应用层根据扫描结果,向通道管理模块发送第二信息。
在一些实施例中,第二信息可以是S517中的扫描结果,即,第二信息包括第一电子设备的地址信息。可选地,第二信息还可以包括:第二电子设备与第一电子设备进行通信的接入技术为SLB。
实现中,基础应用层可以根据用户操作以及从S517中得到的扫描结果,向通道管理模块发送第二信息,具体描述可参考上文S418的相关描述,不再赘述。
过程2、第一电子设备和第二电子设备进行控制通道的建立。
S519、第二电子设备的通道管理模块根据第二信息,向控制器发送该接入信息。
通道管理模块根据第二信息,确定接入信息,且向控制器发送该接入信息。
对于SLB,接入信息包括第一电子设备的地址信息,第一电子设备的地址信息从第二信息中得到。
可选地,接入信息还包括该第二电子设备的地址信息。该第二电子设备的地址信息可以最终被发送至第一电子设备,以便于在两个电子设备连接成功后使得第一电子设备更新白名单(参考S533),以及,在两个电子设备之间完成鉴权加密后使得第一电子设备保存 第二电子设备的地址以将第二电子设备作为可信任的设备(参考S535)。
可选地,接入信息还可以包括:用于指示第二电子设备忽略第二电子设备的白名单的信息,关于该信息的具体描述可参考S419的相关描述,不再赘述。
S520,第二电子设备的控制器根据接入信息,向第一电子设备发送第一接入请求,该第一接入请求用于请求第一电子设备接入第二电子设备。
对应地,第一电子设备的控制器接收该第一接入请求。以及,控制器基于该接入信息发送第一接入请求,该第一接入请求包括第一电子设备的地址信息。
可选地,第一接入请求还包括第二电子设备的地址信息,以便于在第一电子设备和第二电子设备连接成功后使得第一电子设备更新白名单(参考S533),以及,在两个电子设备之间完成鉴权加密后使得第一电子设备保存第二电子设备的地址以将第二电子设备作为可信任的设备(参考S535)。第二电子设备的地址信息可以从S519的接入信息中得到。
第一电子设备接收到该第一接入请求后,基于该第一接入请求执行相关操作(S521-S527),以确定是否同意接入第二电子设备以与第二电子设备建立连接以及在同意接入第二电子设备的情况下实现控制通道的建立。
S521、第一电子设备的控制器向通道管理模块发送第二接入请求,用于请求第一电子设备接入第二电子设备。
可选地,第二接入请求包括第二电子设备的地址信息,可以使得通道管理模块在完成鉴权加密过程后将该地址信息表示的地址保存至本地以将第二电子设备作为可信任的设备,可参考S535。第二电子设备的地址信息可以从S520的第一接入请求中得到。
S522、第一电子设备的通道管理模块向基础应用层发送第三接入请求。
S523、第一电子设备的基础应用层根据第三接入请求,进行能力判断,以确定是否同意第一电子设备接入第二电子设备。具体描述可参考S424的相关描述,不再赘述。
S524、第一电子设备的基础应用层向通道管理模块发送第三请求响应,该第三请求响应用于指示是否同意第一电子设备接入第二电子设备。具体描述可参考S425的相关描述,不再赘述。
S525、第一电子设备的通道管理模块向控制器发送第二请求响应,该第二请求响应用于指示是否同意第一电子设备接入第二电子设备。
若第三请求响应指示同意第一电子设备接入第二电子设备,则第二请求响应指示同意第一电子设备接入第二电子设备;若第三请求响应指示不同意第一电子设备接入第二电子设备,则第二请求响应指示不同意第一电子设备接入第二电子设备。应理解,第二请求响应至少具有与第一请求响应相同的功能,但由于两个请求响应的发送端和接收端不同,可能导致两个请求响应的格式不同。
可选地,在第二请求响应指示不同意第一电子设备接入第二电子设备的情况下,第二请求响应还可用于指示不同意接入第二电子设备的原因。原因可基于实际情况确定,示例性地,原因可以是第一电子设备的资源受限或用户拒绝等。
S526、第一电子设备的控制器向第二电子设备发送响应于第一接入请求的第一请求响应,该第一请求响应用于指示是否同意第一电子设备接入第二电子设备。
控制器基于第二请求响应确定且发送第一请求响应。应理解,第一请求响应至少具有与第二请求响应相同的功能,但由于两个请求响应的发送端和接收端不同,可能导致两个请求响应的格式不同。
在第一请求响应指示同意第一电子设备接入第二电子设备的情况下,继续执行S527和S528,在第一请求响应指示不同意第一电子设备接入第二电子设备的情况下,流程终止。
S527和S528、第一电子设备的控制器向通道管理模块发送LCID,第二电子设备的控制器向通道管理模块发送LCID。具体描述可参考S428和S429的相关描述,不再赘述。
以上,通过过程1和过程2实现了第一电子设备和第二电子设备的控制通道的建立。
可选地,S529、第一电子设备的通道管理模块向设备发现模块发送用于指示停止广播的信息,具体描述可参考S430的相关描述,不再赘述。
可选地,S530、第一电子设备和第二电子设备进行控制通道的鉴权加密,具体描述可参考S431的相关描述,不再赘述。
可选地,S531和S532、第一电子设备的通道管理模块向基础应用层发送用于指示控制通道可用的信息,第二电子设备的通道管理模块向基础应用程发送用于指示控制通道可用的信息。具体描述参考S432和S433的相关描述,不再赘述。
可选地,S533、第一电子设备更新白名单。可选地,S534、第二电子设备更新白名单。具体描述可参考S434和S435的相关描述,不再赘述。
可选地,S535、第一电子设备保存与控制通道有关的属性信息,该属性信息包括但不限于:密钥、第二电子设备的地址、控制通道的状态。具体描述参考S436的相关描述,不再赘述。
可选地,S536、第二电子设备保存与控制通道有关的属性信息,该属性信息包括但不限于:密钥、第一电子设备的地址、控制通道的状态。具体描述可参考S437的相关描述,不再赘述。
场景二、电子设备之间自动连接
该场景描述的是电子设备之间的自动连接,主要连接保存在白名单中的设备。以耳机和手机为例,耳机和手机曾经连接过,后续耳机开盒时可自动与手机连接。该场景的实施例与场景一的首次连接的主要不同之处在于,第二电子设备被配置为自动连接扫描模式,第二电子设备的控制器扫描到白名单的设备后不需要向上层上报扫描结果,可直接发起接入请求,以及,第二电子设备可以配置单设备连接模式和多设备连接模式。
图6是本申请实施例提供的设备的方法600示意性流程图。该方法600描述的是第一电子设备和第二电子设备基于SLE进行控制通道的建立的过程。作为示例,第一电子设备可以为耳机,第二电子设备可以为手机。
方法600的过程与方法400类似,包括方法400的上述过程1和过程2,每个过程的具体步骤存在一些区别。
过程1、第一电子设备发送广播消息,第二电子设备基于该广播消息执行相关操作。
S611、第一电子设备的基础应用层向基础服务层的设备发现模块发送通知事件,该通知事件用于确定第一电子设备的角色信息。
关于第一电子设备的角色信息的具体描述可参考上文S411的相关描述,不再赘述。
在一些实施例中,该通知事件包括用于指示用户针对所述第一电子设备的操作的信息。对于SLE技术而言,若第一电子设备为耳机,示例性地,用户对第一电子设备的操作可以是打开耳机盒或长按键;若第一电子设备为手机,示例性地,用户对第一电子设备的操作可以是打开设置中关于SLE的开关;若第一电子设备为键盘,示例性地,用户对第一电子 设备的操作可以是按压用于连接的物理开关。在该实施例中,基础应用层获取用户针对第一电子操作的操作,并将该操作发送给基础服务层的设备发现模块,以便于设备发现模块确定第一电子设备与其他电子设备进行通信使用的接入技术为SLE,且确定第一电子设备的角色信息。
在另一些实施例中,该通知事件包括用于指示接入技术为SLE的信息。在该实施例中,基础应用层获取用户针对第一电子设备的操作,且基于该操作确定第一电子设备与其他电子设备进行通信使用的接入技术为SLE,以便于设备发现模块确定第一电子设备的角色信息。
在另一些实施例中,通知事件包括第一电子设备的角色信息。在该实施例中,基础应用层获取用户针对第一电子设备的操作,基于该操作确定第一电子设备与其他电子设备进行通信使用的接入技术为SLE,且确定第一电子设备的角色信息。
S612、第一电子设备的设备发现模块配置且向控制器发送广播事件,该广播事件用于指示广播策略,包括用于广播的其他参数。。具体描述可参考上文S412的相关描述,不再赘述。
可选地,广播事件还包括第一电子设备的角色信息。
可选地,该广播事件还包括用于指示请求接入至第一电子设备的设备的设备过滤信息,对于自动连接,该设备过滤信息用于指示仅允许第一电子设备接入第一电子设备的白名单以内的设备,以实现第一电子设备与曾经连接过的电子设备(例如,第二电子设备)的自动连接过程。
S613、第一电子设备的设备发现模块根据通知事件,向通道管理模块发送第一信息。具体描述可参考S413的相关描述,不再赘述。
S614、第一电子设备的控制器根据广播事件,发送广播消息。
广播消息包括但不限于以下内容:第一电子设备的地址信息,第一电子设备的角色信息,广播模式(adv mode),广播标记(adv flag)。具体描述可参考S414的相关描述,不再赘述。
可选地,广播消息还可以包括:第二电子设备的地址信息,以便于第一电子设备可以和第二电子设备进行自动连接。这样,可以实现第一电子设备与特定设备的自动连接。其中,第二电子设备的地址信息可从第一电子设备的白名单中得到。
需要说明的是,S612可在S613之前或之后或可与S613同时执行,S614可在S613之前或之后或可与S613同时执行。
S615、第二电子设备的基础应用层向设备发现模块发送扫描模式信息,该扫描模式信息用于指示第二电子设备的扫描模式为自动连接扫描模式。
自动连接扫描模式需要在一定限制条件下扫描周围的设备或过滤掉一些设备。
示例性地,基础应用层可以基于以下各种触发条件将第一电子设备设置为自动连接扫描模式:第一电子设备和第二电子设备由于距离远等原因断开后,约定在断开后的预设时长内切换为自动扫描;或,周期性在自动连接扫描模式和默认扫描模式之间切换;或,用户在第二电子设备的应用界面上手动点击曾经已连接过的设备以使得基础应用层触发自动连接扫描。
S616、第二电子设备的设备发现模块基于自动连接扫描模式,配置且向控制器发送扫描参数和连接参数。
关于扫描参数的具体描述可参考上文S416的相关描述,不再赘述。
对于SLE,连接参数包括但不限于以下内容:第二电子设备的角色信息、连接模式、使能白名单。
第二电子设备的角色信息可以由第二电子设备自身期望成为的角色确定,用于指示第二电子设备的期望角色为G节点设备或T节点设备,可选地,第二电子设备的设备信息还用于指示第二电子设备的角色是否可以协商,以便于确定第二电子设备的最终角色。
连接模式为单设备连接模式或多设备连接模式。单设备连接模式表示在同一时段内第二电子设备仅能和一个设备建立连接,多设备连接模式表示在同一时段内第二电子设备可同时和多个设备建立连接。在一示例中,采用第二电子设备能够连接的设备的最大数量指示单设备连接模式或多设备连接模式,若第二电子设备能够连接的设备的最大数量为1,则表示单设备连接模式,若第二电子设备能够连接的设备的最大数量大于1,则表示多设备连接模式。在另一示例中,在连接模式为多设备连接模式的情况下,连接参数不仅包括连接模式,还包括用于指示第二电子设备能够连接的设备的最大数量。
使能白名单表示使能第二电子设备的控制器使用白名单,目的在于,一是使得第二电子设备与第二电子设备的白名单内的设备进行连接,以实现自动连接,二是使得控制器在扫描到白名单内的设备后不需向上层上报扫描结果,可直接发起接入请求。
在第二电子设备仅支持一种连接模式的情况下,连接参数中可不包括连接模式,第二电子设备会默认基于自己支持的连接模式进行连接。对于SLE,可支持两种连接模式,对于SLB,可仅支持单设备连接模式。
可选地,连接参数还可以包括以下至少一项内容:用于指示发送周期(interval)的信息、用于指示响应时长(timeout)的信息。具体描述可参考S419的相关描述,不再赘述。
需要说明的是,S615和S616与S611-S614的执行顺序并无固定的先后顺序,可任意变化,只要S615和S616在S617之前执行即可。例如,S615和S616在S611-S614之前或之后或可同时执行。再例如,S615和S616可在S611-S614中任一个步骤之前或之后或可同时执行。
S617、在场景1和场景2中,执行不同的操作。
场景1、自动连接
S6171、在连接模式为单设备连接模式时,第二电子设备的控制器根据扫描参数和连接参数对周围的设备进行扫描,扫描到第二电子设备的白名单内的第一电子设备后,直接执行S618(即,发送第一接入请求),停止扫描。
S6172、在连接模式为多设备连接模式时,第二电子设备的控制器根据扫描参数和连接参数对周围的设备进行扫描,扫描到第二电子设备的白名单内的第一电子设备后,执行S618,且,若满足预设条件,则停止扫描,若不满足预设条件,则继续扫描。
在一示例中,预设条件可以为:扫描定时器超时。
在该示例中,控制器可以根据扫描定时器的时长确定是否停止扫描。具体地,若第二电子设备的控制器内的扫描定时器超时,则停止扫描;反之,若第二电子设备的控制器内的扫描定时器未超时,则继续扫描。
在另一示例中,预设条件可以为:第一电子设备为控制器扫描到的第N个设备,控制器扫描到的包括第一电子设备在内的N个设备是第二电子设备的白名单内的设备。
在该示例中,控制器可以根据第二电子设备能够连接的属于白名单的设备的最大数量 N确定是否停止扫描,N为大于1的整数。也就是说,控制器扫描到白名单内设备的数量达到第二电子设备能够连接的设备的最大数量N,则停止扫描;反之,若控制器扫描到白名单内设备的数量未达到第二电子设备能够连接的设备的最大数量N,则继续扫描。
具体地,若控制器扫描到的第一电子设备是控制器扫描到的第N个电子设备,那么,控制器之前扫描到的N-1个设备加上现在扫描到的第一电子设备,控制器已经扫描了白名单内的N个设备,达到最大数量N,在不考虑其他设备中途断开的情况下,意味着第二电子设备大概率会同时和N个设备保持连接,则控制器停止扫描;若控制器扫描到的第一电子设备不是第N个电子设备,那么,控制器之前扫描到的设备加上现在扫描的第一电子设备,控制器未扫描到白名单内的N个设备,未达到最大数量N,则控制器继续进行扫描。
在另一示例中,预设条件可以为:第一电子设备为控制器扫描到的第N个设备且第二电子设备完成控制通道的建立,控制器扫描到的包括第一电子设备在内的N个设备是第二电子设备的白名单内的设备。
需要说明的是,第二电子设备的控制器完成逻辑通道的建立且向通道管理模块发送LCID后,即控制器执行完S627后,表示第二电子设备完成了控制通道的建立,下文对“第二电子设备完成控制通道的建立”的解释同此处。所以,上述预设条件的另一种表述可以为:第一电子设备为控制器扫描到的第N个设备且第二电子设备的控制器向通道管理模块(或基础服务层)发送完LCID。
在该示例中,控制器根据第二电子设备能够连接的属于白名单的设备的最大数量N和第二电子设备是否完成控制通道的建立,确定是否停止扫描。也就是说,控制器扫描到白名单内设备的数量达到第二电子设备能够连接的设备的最大数量N且第二电子设备完成控制通道的建立,则停止扫描;反之,若控制器扫描到白名单内设备的数量达到第二电子设备能够连接的设备的最大数量N,但第二电子设备未完成控制通道的建立,则继续扫描,或,若控制器扫描到白名单内设备的数量未达到第二电子设备能够连接的设备的最大数量N,则继续扫描。
具体地,若控制器扫描到的第一电子设备是控制器扫描到的第N个电子设备,那么,控制器已经扫描了白名单内的N个设备,达到最大数量N,而且,第二电子设备完成了控制通道的建立,意味着第二电子设备与第一电子设备成功连接,在不考虑其他设备中途断开的情况下,进一步保证了第二电子设备会大概率同时和N个设备保持连接,则控制器停止扫描;若控制器扫描到的第一电子设备是控制器扫描到的第N个电子设备,表示控制器已经扫描了白名单内的N个设备,达到最大数量N,但是,第二电子设备未完成控制通道的建立,即,控制通道建立失败,意味着第二电子设备未与第一电子设备成功连接,在不考虑其他设备中途断开的情况下,第二电子设备实际连接的设备还是N-1,未达到最大数量N,则控制器继续扫描;若控制器扫描到的第一电子设备不是第N个电子设备,则控制器继续扫描。
在另一示例中,预设条件可以为:在控制器的扫描定时器未超时的情况下,第一电子设备为控制器扫描到的第N个设备,控制器扫描到的包括第一电子设备在内的N个设备是第二电子设备的白名单内的设备。
在该示例中,控制器可以在扫描定时器未超时的情况下,根据第二电子设备能够连接的属于白名单的设备的最大数量N,确定是否停止扫描。也就是说,若控制器内的扫描定时器未超时且控制器扫描到白名单内设备的数量达到第二电子设备能够连接的设备的最 大数量N,则控制器停止扫描;反之,若控制器内的扫描定时器未超时,但控制器扫描到白名单内设备的数量未达到第二电子设备能够连接的设备的最大数量N,则控制器继续扫描。当然,若扫描定时器超时,控制器也停止扫描。
具体地,若控制器内的扫描定时器未超时且控制器扫描到的第一电子设备是控制器扫描到的第N个电子设备,那么,控制器已经扫描了白名单内的N个设备,达到最大数量N,在不考虑其他设备中途断开的情况下,意味着第二电子设备大概率会同时和N个设备保持连接,则控制器停止扫描;若控制器的扫描定时器未超时且扫描到的第一电子设备不是第N个电子设备,那么,控制器未扫描到白名单内的N个设备,未达到最大数量N,则控制器继续进行扫描;若扫描定时器超时,则控制器停止扫描。
在另一示例中,预设条件可以为:在控制器的扫描定时器未超时的情况下,第一电子设备为控制器扫描到的第N个设备且第二电子设备完成控制通道的建立(执行完S627)。
在该示例中,控制器可以在扫描定时器未超时的情况下,根据第二电子设备能够连接的属于白名单的设备的最大数量N和第二电子设备是否完成控制通道的建立,确定是否停止扫描。
具体地,若控制器内的扫描定时器未超时,控制器扫描到的第一电子设备是控制器扫描到的第N个电子设备,那么,控制器已经扫描了白名单内的N个设备,达到最大数量N,而且,第二电子设备完成了控制通道的建立,意味着第二电子设备与第一电子设备成功连接,在不考虑其他设备中途断开的情况下,进一步保证了第二电子设备会大概率同时和N个设备保持连接,则控制器停止扫描;若控制器的扫描定时器未超时,控制器扫描到的第一电子设备是控制器扫描到的第N个电子设备,那么,控制器已经扫描了白名单内的N个设备,达到最大数量N,但第二电子设备未完成控制通道的建立,意味着第二电子设备未与第一电子设备成功连接,在不考虑其他设备中途断开的情况下,第二电子设备实际连接的设备还是N-1,未达到最大数量N,则控制器继续扫描;若控制器的扫描定时器未超时,且扫描到的第一电子设备不是第N个电子设备,那么,控制器未扫描到白名单内的N个设备,未达到最大数量N,则控制器继续扫描;若扫描定时器超时,则控制器停止扫描。
需要说明的是,在广播消息包括第二电子设备的地址信息的情况下,意味着第一电子设备想和第二电子设备连接,所以,无论在单设备连接模式还是多设备连接模式,第二电子设备在接收到有第二电子设备的地址信息时执行S618。应理解,第二电子设备的地址信息是从第一电子设备的白名单中得到的,表示第一电子设备和第二电子设备之前连接过,所以,第一电子设备也是第二电子设备的白名单中的设备。
场景2、不自动连接
在该场景中,一般是用户设置使得第二电子设备在即使能够自动连接的情况下也无法实现自动连接。例如,第二电子设备的用户之前使用了别人的设备,所以,用户将别人的设备设置为不自动连接。
S6173、第二电子设备的基础应用层根据用户设置,向通道管理模块发送设备信息,该设备信息用于指示不自动连接的设备。示例性地,用户可以在应用的界面上设置不自动连接的设备。
S6174、第二电子设备的通道管理模块向控制器发送删除请求,删除请求中包括用于指示不自动连接的设备的设备信息,控制器基于该删除请求中的设备信息,删除白名单内 设备信息所指示的设备。这样,设备信息中指示的设备后续若需要与第二电子设备连接,执行方法400的实施例。
过程2、第一电子设备和第二电子设备进行控制通道的建立。
S618、第二电子设备的控制器向第一电子设备发送第一接入请求,该第一接入请求用于请求第一电子设备接入第二电子设备。
S619、第一电子设备的控制器根据第一接入请求,向通道管理模块发送第二接入请求,以请求第一电子设备接入第二电子设备,其中,该第二接入请求包括第二电子设备的角色信息。
S620、第一电子设备的通道管理模块确定第一电子设备和第二电子设备最终的角色。
可选地,S621、第一电子设备的通道管理模块向基础应用层发送第三接入请求,以请求第一电子设备接入第二电子设备。可选地,该第三接入请求包括用于指示第一电子设备的最终角色和第二电子设备的最终角色的信息。
可选地,S622、第一电子设备基础应用层根据第三接入请求,进行能力判断,以确定是否同意第一电子设备接入第二电子设备。
可选地,S623、第一电子设备的基础应用层向通道管理模块发送响应于第三接入请求的第三请求响应,该第三请求响应用于指示同意第一电子设备接入第二电子设备。
S624、第一电子设备的通道管理模块向控制器发送第二请求响应,该第二请求响应用于指示是否同意第一电子设备接入第二电子设备。
S625、第一电子设备的控制器向第二电子设备发送响应于第一接入请求的第一请求响应,该第一请求响应用于指示是否同意第一电子设备接入第二电子设备。
S626和S627、第一电子设备的控制器向通道管理模块发送逻辑通道标识(LCID),第二电子设备的控制器向通道管理模块发送逻辑通道标识(LCID)。
以上,通过过程1和过程2实现了第一电子设备和第二电子设备的控制通道的建立。
可选地,S628、第一电子设备的通道管理模块向设备发现模块发送用于指示停止广播的信息。
可选地,S629和S630、第一电子设备的通道管理模块向基础应用层发送用于指示控制通道可用的信息,第二电子设备的通道管理模块向基础应用程发送用于指示控制通道可用的信息。
关于S618-S630的具体描述可参考S420-S430、S432-S433的相关描述,不再赘述。
需要说明的是,在自动连接的场景中,由于第一电子设备和第二电子设备曾经连接过,双方都会保存有之前进行鉴权加密过程中生成的密钥,因此,后续自动连接过程中可以不需要重新生成密钥。当然,若至少一方的密钥丢失,还需再执行鉴权加密过程。
图7是本申请实施例提供的用于设备连接的方法700的示意性流程图。该方法700描述的是第一电子设备和第二电子设备基于SLB进行控制通道的建立以实现自动连接的过程。
方法700的过程与方法400类似,也包括上述过程1和过程2,每个过程的具体步骤存在一些区别。
过程1、第一电子设备发送广播消息,第二电子设备基于该广播消息执行相关操作。
S711,第一电子设备的基础应用层向基础服务层的设备发现模块发送通知事件,该通知事件用于确定第一电子设备与其他电子设备进行通信使用的接入技术。具体描述可参考 S511的相关描述,不再赘述。
S712、第一电子设备的设备发现模块配置且向控制器发送广播事件,该广播事件包括用于广播的参数。可选地,该广播事件还包括用于指示请求接入至第一电子设备的设备的设备过滤信息,对于自动连接,该设备过滤信息用于指示仅允许第一电子设备接入第一电子设备的白名单以内的设备。关于广播参数的具体描述参考上文S512中的相关描述,不再赘述。
S713、第一电子设备的设备发现模块根据通知事件,向通道管理模块发送用于指示第一电子设备的广播状态的广播状态信息。关于广播状态信息的具体描述参考上文S513中的相关描述,不再赘述。
S714、第一电子设备的控制器根据广播事件,发送广播消息。广播消息包括系统消息,该系统消息包括但不限于:第一电子设备的地址信息、资源分配信息。
可选地,广播消息还可以包括:第二电子设备的地址信息,以便于第一电子设备可以和第二电子设备进行自动连接。这样,可以实现第一电子设备与特定设备的自动连接。其中,第二电子设备的地址信息可从第一电子设备的白名单中得到。
需要说明的是,S712可在S713之前或之后或可与S713同时执行,S714可在S713之前或之后或可与S713同时执行。
S715、第二电子设备的基础应用层向设备发现模块发送扫描模式信息,该扫描模式信息用于指示第二电子设备的扫描模式为自动连接扫描模式。具体描述可参考S615的相关描述,不再赘述。
S716、第二电子设备的设备发现模块基于自动连接扫描模式,配置且向控制器发送扫描参数和连接参数。
关于扫描参数的具体描述可参考上文S416的相关描述,不再赘述。
对于SLB,连接参数包括:使能白名单。关于使能白名单的具体描述参考S616的相关描述,不再赘述。
可选地,连接参数还包括:连接模式,该连接模式为单设备连接模式。
在SLB仅支持单设备连接模式的情况下,连接参数可以不包括连接模式,第二电子设备会默认基于自己支持的单设备连接模式进行连接。
需要说明的是,S715和S716与S711-S714的执行顺序并无固定的先后顺序,可任意变化,只要S715和S716在S717之前执行即可。例如,S715和S716在S711-S714之前或之后或可同时执行。再例如,S715和S716可在S711-S714中任一个步骤之前或之后或可同时执行。
S717、在场景1和场景2中,第二电子设备执行不同的操作。
场景1、自动连接
S7171、SLB仅支持单设备连接模式,第二电子设备的控制器根据扫描参数和连接参数对周围的设备进行扫描,扫描到第二电子设备的白名单内的第一电子设备后,直接执行S718(即,发送第一接入请求),停止扫描。
场景2、不自动连接
在该场景中,一般是用户设置使得第二电子设备在即使能够自动连接的情况下也无法实现自动连接。例如,第二电子设备的用户之前使用了别人的设备,所以,用户将别人的设备设置为不自动连接。
S7173、第二电子设备的基础应用层根据用户设置,向通道管理模块发送设备信息,该设备信息用于指示不自动连接的设备。
S7174、第二电子设备的通道管理模块向控制器发送删除请求,删除请求中包括用于指示不自动连接的设备的设备信息,控制器基于该删除请求中的设备信息,删除白名单内设备信息所指示的设备。这样,设备信息中指示的设备后续若需要与第二电子设备连接,执行方法400的实施例。
过程2、第一电子设备和第二电子设备进行控制通道的建立。
S718,第二电子设备的控制器根据接入信息,向第一电子设备发送第一接入请求,该第一接入请求用于请求第一电子设备接入第二电子设备。
S719,第一电子设备的控制器向通道管理模块发送第二接入请求,用于请求第一电子设备接入第二电子设备。
S720、第一电子设备的通道管理模块向基础应用层发送第三接入请求。
S721、第一电子设备的基础应用层根据第三接入请求,进行能力判断,以确定是否同意第一电子设备接入第二电子设备。
S722、第一电子设备的基础应用层向通道管理模块发送第三请求响应,该第三请求响应用于指示是否同意第一电子设备接入第二电子设备。
S723、第一电子设备的通道管理模块向控制器发送第二请求响应,该第二请求响应用于指示是否同意第一电子设备接入第二电子设备。
S724、第一电子设备的控制器向第二电子设备发送响应于第一接入请求的第一请求响应,该第一请求响应用于指示是否同意第一电子设备接入第二电子设备。
S725和S726、第一电子设备的控制器向通道管理模块发送LCID,第二电子设备的控制器向通道管理模块发送LCID。
以上,通过过程1和过程2实现了第一电子设备和第二电子设备的控制通道的建立。
可选地,S727、第一电子设备的通道管理模块向设备发现模块发送用于指示停止广播的信息。
可选地,S728,第一电子设备和第二电子设备进行控制通道的鉴权加密。
可选地,S729和S730、第一电子设备的通道管理模块向基础应用层发送用于指示控制通道可用的信息,第二电子设备的通道管理模块向基础应用程发送用于指示控制通道可用的信息。
关于S718-S730的具体描述可参考S520-S532的相关描述,不再赘述。
本申请实施例还提供了控制通道释放控制通道的方法,通过断开逻辑通道以使得控制通道无法使用,从而释放控制通道。
在一些实施例中,基于用户操作由通道管理模块主动发起用于断开控制通道的断开命令。对于采用SLE进行通信的两个电子设备,G节点设备和T节点设备均可主动发起断开命令,对于采用SLB进行通信的两个电子设备,由G节点设备发起断开命令。
下面,以G节点设备发起断开命令为例,结合图8,对该实施例做说明。应理解,图8中的G节点设备和T节点设备可以支持SLE,也可以支持SLB。还应理解,对于采用SLE进行通信的两个电子设备中的T节点设备发起断开命令以断开控制通道的过程与图8类似,将图8中的G节点设备和T节点设备互换即可。
图8是本申请实施例提供的断开控制通道的方法800的示意性流程图。
S811、G节点设备的基础应用层向通道管理模块发送用户操作的指令。示例性地,用户操作可以是用户在用户界面上的点击断开连接的操作。
S812、G节点设备的通道管理模块根据用户操作的指令,向控制器发送断开(disconnect)指令。
控制器根据断开指令,断开已经建立好的逻辑通道以释放控制通道。若存在专有链路,需要先断开专用链路,再断开逻辑通道。专有链路是指在某些业务场景(例如,高清通话场景)下需要控制器在逻辑通道基础上建立的链路,对于SLE,专用链路是同步一对一双向链路(isochronous connection-oriented one to one bidirectional link,IOB),对于SLB,专有链路是专有逻辑通道(logic channel,LC)。因此,在断开逻辑通道时,需要先断开在逻辑通道的基础上建立的链路,再断开逻辑通道。这样,控制器内的逻辑通道断开,控制通道无法使用,从而断开了控制通道。
S813、G节点设备的控制器向通道管理模块发送命令状态(command status),以指示控制器收到了断开指令。
S814、G节点设备的控制器根据断开指令向T节点设备发送断开请求。
T节点设备的控制器根据该断开请求,断开已经建立好的逻辑通道以释放控制通道,具体描述参考S812的相关描述,不再赘述。
S815、T节点设备的控制器向G节点设备发送响应信息,以指示T节点设备的控制器完成了逻辑通道的断开。
S816、G节点设备的控制器通过通道管理模块向基础应用层发送用于指示断开完成的指令,以通过基础应用层向用户通知设备的断开状态。示例性地,基础应用层可以将该指令发送至应用,以在用户界面上显示设备的断开状态。示例性地,基础应用层可以将该指令发送至播放设备,以通过播放设备提示断开状态,例如,播放设备发出“嘀”或“断开连接”的提示音。
S817、T节点设备的控制器通过通道管理模块向基础应用层发送用于指示断开完成的指令,以通过基础应用层向用户通知设备的断开状态。
在另一些实施例中,对于SLE,两个电子设备在建立连接过程中由一方向另一方发送请求响应(例如,上文S427中由第一电子设备向第二电子设备发送第一请求响应)之后,双方的连接处于不稳定状态,若经过预设时长(例如,N个超帧周期后),G节点设备未能收到T节点设备发送的T帧,则认为双方的连接失败/断开,G节点设备也不再向T节点设备发送C帧。若有接入需求,电子设备需重新启动接入流程,执行方法400或方法600。
在另一些实施例中,对于SLB,SLB的控制链路层的数据重传次数超过最大次数后,则认为双方的连接失败/断开。若有接入需求,电子设备需重新启动接入流程,执行方法500或方法700
图9是本申请实施例提供的用于设备连接的方法900的示意性流程图。该方法900由第一电子设备执行,第一电子设备支持短距离接入技术,通过建立控制通道以实现第一电子设备和第二电子设备的连接,其中,第一电子设备包括基础应用层和控制器,基础服务层包括设备发现模块和通道管理模块,可选地,还包括基础应用层(图中未示出)。
S911、所述基础服务层确定第一角色信息,所述第一角色信息用于指示所述第一电子设备的期望角色,所述第一电子设备的期望角色为主控节点设备或终端节点设备。
具体地,基础服务层中的设备发现模块确定第一角色信息。其中,第一角色信息即为上文的第一电子设备的角色信息,关于第一角色信息的具体描述可参考S411的相关描述。
在一些实施例中,设备发现模块接收来自基础应用层的通知事件,该通知事件用于确定该第一角色信息,设备发现模块根据该通知事件确定该第一角色信息。在一示例中,通知事件包括用户针对第一电子设备的操作的信息。在另一示例中,通知事件包括用于指示接入技术为SLE的信息。在另一示例中,通知事件包括第一电子设备的角色信息。关于通知事件的具体描述可参考上文S411的相关描述,不再赘述。
在一些实施例中,设备发现模块向通道管理模块发送确定的第一角色信息,以使得通达管理模块确定该第一角色信息,便于通道管理模块进行后续的控制通道的建立。示例性地,如S413所示,设备发现模块向通道管理模块发送第一信息,该第一信息包括该第一角色信息,具体描述参考S413的相关描述,不再赘述。
S912、所述基础服务层向所述控制器发送广播事件,所述广播事件用于指示广播策略。
对应地,控制器接收该广播事件。
具体地,基础服务层的设备发现模块向控制器发送广播事件。广播事件包括用于广播的参数,包括但不限于:广播模式(adv mode),发现等级、广播间隔、广播时长、广播标记(adv flag)。具体描述参考S412的相关描述,不再赘述。
S913、所述控制器根据所述广播事件发送广播消息,所述广播消息包括所述第一电子设备的地址信息。
对应地,第二电子设备接收该广播消息。
示例性地,广播消息还可以包括:广播模式(adv mode)、广播标记(adv flag)等信息。关于广播消息的具体描述参考S414的相关描述,不再赘述。
S915、所述控制器根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层发送第二接入请求,所述第一接入请求和所述第二接入请求用于请求所述第一电子设备接入所述第二电子设备,所述第一接入请求和所述第二接入请求包括用于指示所述第二电子设备的期望角色的第二角色信息,所述第二电子设备的期望角色为主控节点设备或终端节点设备。
这里的第二角色信息即为上文的第二电子设备的角色信息。
具体地,在S914中、第二电子设备响应于广播消息,向第一电子设备发送第一接入请求,对应地,第二电子设备的控制器接收该第一接入请求,在S915中,第一电子设备的控制器根据该第一接入请求,向基础服务层的通道管理模块发送第二接入请求。具体描述参考S420和S421的相关描述,不再赘述。
S917、所述控制器根据接收到的所述基础服务层响应于所述第二接入请求发送的第二请求响应发送第一请求响应,所述第一请求响应和所述第二请求响应用于指示同意所述第一电子设备接入所述第二电子设备,所述第一电子设备的最终角色与所述第二电子设备的最终角色不同,所述第一电子设备的最终角色与所述第二电子设备的最终角色是基于所述第一电子设备的期望角色与所述第二电子设备的期望角色确定的。
具体地,在S916中,基础服务层的通道管理模块响应于第二接入请求,向控制器发送第二请求响应,在S917中,控制器根据该第二请求响应发送第一请求响应。具体描述参考S426和S427的相关描述,不再赘述。
S918、所述控制器建立逻辑通道且向所述基础服务层发送用于标识所述逻辑通道的逻 辑通道标识,以建立所述基础服务层中对应于所述逻辑通道的控制通道。
具体地,在第一请求响应和第二请求响应用于指示同意第一电子设备接入第二电子设备的情况下,控制器建立基础的逻辑通道,向基础服务层的通道管理模块发送逻辑通道标识(LCID),从而,建立控制通道。具体描述参考S428的相关描述,不再赘述。
如前所述,控制通道是在基础服务层中设计好的通道,逻辑通道建立完成后,对应的控制通道才可以被使用。这样,当第一电子设备的逻辑通道建立完成后,通道管理模块可基于LCID确定该LCID对应的控制通道,以使用对应的控制通道,从而,完成了控制通道的建立。
本申请实施例提供的用于设备连接的方法,对于新一代的短距离接入技术(例如,SLE),第一电子设备内设置有控制器和上层的基础服务层,由基础服务层触发控制通道的建立,即,基础服务层通过确定第一角色信息和发送广播事件以触发控制通道的建立,基础服务层、控制器和对端设备(例如,第二电子设备)通过接入请求(例如,第一接入请求和第二接入请求)和接入响应(例如,第一请求响应和第二请求响应)等信息的交互,建立逻辑通道,以实现控制通道的建立,从而实现第一电子设备和对端设备间的连接,为后续的数据传输提供基础。并且,本申请提供的短距离接入技术,由于第一电子设备和对端设备的最终角色可以基于双方的期望角色确定,可以使得双方的角色基于实际场景灵活可变,通信的灵活性较高,非常适用于具有灵活和小型化特点的产品以及适用于小带宽、低功耗、低速率的业务,更能较好地适用于多设备连接(即,一个电子设备可同时和多个设备连接且角色不固定)的场景,总之,适用范围广。
可选地,所述广播事件包括所述第一角色信息,所述广播消息包括所述第一角色信息。
本申请实施例提供的用于设备连接的方法,通过在广播消息中携带第一角色信息,可以使得对端设备(例如,第二电子设备)基于第一角色信息确定自己的角色,尽可能在连接过程的初始阶段使得对端设备匹配到与第一电子设备的期望角色不同的期望角色,提高连接效率。
可选地,在所述控制器根据接收到的所述基础服务层响应于所述第二接入请求发送的第二请求响应发送第一请求响应之前,所述方法还包括:
所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色和所述第二电子设备的最终角色;
所述基础服务层向所述控制器发送所述第二请求响应。
具体地,基础服务层的通道管理模块响应于第二接入请求,根据第一角色信息和第二角色信息,确定第一电子设备的最终角色和第二电子设备的最终角色,且由通道管理模块向控制器发送第二请求响应。
本申请实施例提供的用于设备连接的方法,由第一电子设备基于第一电子设备和第二电子设备的期望角色最终确定第一电子设备和第二电子设备的最终角色,可以对双方的角色做最后的把关,使得双方的最终角色都不同以能成功建立控制通道,从而实现设备间的连接。
在同意第一电子设备接入第二电子设备的情况下,本申请实施例提供了以下确定双方的最终角色的实施例。
在一些实施例中,所述第一电子设备的期望角色与所述第二电子设备的期望角色相同, 所述第一角色信息还用于指示所述第一电子设备的期望角色可协商;以及,
所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色,包括:
所述基础服务层更换所述第一电子设备的期望角色,以将所述第一电子设备更换后的期望角色确定为所述第一电子设备的最终角色且将第二电子设备的期望角色确定为所述第二电子设备的最终角色。
具体地,在双方的期望角色相同且第一电子设备的期望角色可协商的情况下,基础服务层的通道管理模块更换第一电子设备的期望角色,使得最终得到的双方的最终角色不同。应理解,在该实施例中,第二电子设备的期望角色可协商或不可协商都行,只要第一电子设备的期望角色可协商就行。
该过程可对应于S422的情况2-1和2-2,具体描述可参考上文描述,不再赘述。
在另一些实施例中,所述第一电子设备的期望角色与所述第二电子设备的期望角色不同;以及,
所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色,包括:
所述基础服务层将所述第一电子设备的期望角色确定为所述第一电子设备的最终角色,将所述第二电子设备的期望角色确定为所述第二电子设备的最终角色。
具体地,在双方的期望角色不同的情况下,基础服务层的通道管理模块将双方的期望角色确定为双方的最终角色。
该过程可对应于S422的情况1,具体描述可参考上文描述,不再赘述。
可选地,所述第一电子设备还包括基础应用层;以及,
在所述控制器根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层发送第二接入请求之后,所述方法还包括:
所述基础服务层根据所述第二接入请求,向所述基础应用层发送第三接入请求,所述第三接入请求用于请求所述第一电子设备接入所述第二电子设备;
所述基础应用层响应于所述第三接入请求,在满足以下至少一项的情况下,向所述基础服务层发送第三请求响应,所述第三请求响应用于指示同意所述第一电子设备接入所述第二电子设备,其中,所述至少一项包括:所述第一电子设备当前能够连接的电子设备的数量大于或等于1,或,检测到用户针对所述第一电子设备显示的接收请求的确认操作;以及,
所述基础服务层向所述控制器发送第二请求响应,包括:
所述基础服务层根据所述第三请求响应,向所述控制器发送所述第二请求响应。
该过程可由基础应用层和基础服务层执行。
具体地,基础服务层的通道管理模块根据所述第二接入请求,向基础应用层发送第三接入请求,基础应用层响应于该第三接入请求,在满足以下至少一项的情况下,向基础服务层的通道管理模块发送第三请求响应,通道管理模块根据该第三请求响应,向控制器发送该第二请求响应。
该过程可对应上文的S423-S424,具体描述可参考上文描述,不再赘述。
本申请实施例提供的用于设备连接的方法,基础应用层根据基础服务层的第三接入请求对第一电子设备进行能力判断,即,基于第一电子设备当前能够连接的电子设备的数量 和用户针对所述第一电子设备显示的接收请求的确认操作,从应用层面确定是否同意接入第二电子设备,考虑了更多实际应用场景,更有利于提高设备连接的成功率。
可选地,所述广播事件还包括第一设备过滤信息,所述第一设备过滤信息用于指示允许所述第一电子设备接入所述第一电子设备的白名单以内和以外的设备。
其中,第一电子设备的白名单内的设备是曾经与第一电子设备连接过的设备。
也就是说,第一过滤信息允许第一电子设备接入所有请求接入至第一电子设备的设备,不仅仅是白名单内的设备。这样,可以实现第一电子设备与新的电子设备(例如,第二电子设备)的首次连接过程。这里的第一过滤信息可对应S412中携带在广播事件中的设备过滤信息。
本申请实施例提供的用于设备连接的方法,虽然第一电子设备内保存有白名单,但第一电子设备并不限于与白名单中的设备连接,也想和未连接过的新的电子设备建立连接,因此,通过在广播事件中携带用于指示允许第一电子设备接入第一电子设备的白名单以内和以外的设备的第一设备过滤信息,可以使得控制器后续接收以及转发来自白名单以外的设备的接入请求,以实现第一电子设备与新的电子设备的首次连接。
可选地,所述第一接入请求还包括所述第二电子设备的地址信息;以及,所述方法还包括:
所述控制器将所述第二电子设备的地址信息所表示的地址添加至所述第一电子设备的白名单中,以更新所述第一电子设备的白名单。
该过程可对应上文的S434,具体描述参考上文的相关描述,不再赘述。
本申请实施例提供的用于设备连接的方法,第一电子设备在和新的电子设备(例如,第二电子设备)建立连接过程中,通过将新的电子设备的地址添加至第一电子设备的白名单中以更新白名单,可以后续双方再次连接过程中实现自动连接,方便快捷,用户体验高。
可选地,所述广播事件还包括第二设备过滤信息,所述第二设备过滤信息用于指示仅允许所述第一电子设备接入所述第一电子设备的白名单以内的设备。
这里的第二设备过滤信息可对应于S612中广播事件中的设备过滤信息。
本申请实施例提供的用于设备连接的方法,通过在广播事件中携带用于指示仅允许第一电子设备接入第一电子设备的白名单以内的设备的第二设备过滤信息,可以使得控制器后续接收以及转发来自白名单以内的设备的接入请求,以实现第一电子设备与曾经连接过的电子设备(例如,第二电子设备)的自动连接过程。
可选地,所述广播消息还包括:所述第二电子设备的地址信息,所述第二电子设备是所述第一电子设备的白名单内的设备。
本申请实施例提供的用于设备连接的方法,通过在广播消息中携带白名单内的设备(例如,第二电子设备)的地址信息,可以实现第一电子设备与特定设备的自动连接。
可选地,所述方法还包括:所述基础服务层向所述基础应用层发送用于指示所述控制通道可用的信息。
具体地,基础服务层的通道管理模块向基础应用层发送用于指示所述控制通道可用的信息。
本申请实施例提供的用于设备连接的方法,基础服务层通过向基础应用层发送用于指示所述控制通道可用的信息,可以使得基础应用层确知控制通道已经建立成功,可发起后续的业务通道的建立以及数据传输。
图10是本申请实施例提供的用于设备连接的方法1000的示意性流程图。该方法1000由第二电子设备执行,第二电子设备支持短距离接入技术,通过建立控制通道以实现第一电子设备和第二电子设备的连接,其中,第二电子设备包括基础应用层和控制器,基础服务层包括设备发现模块和通道管理模块,可选地,还包括基础应用层(图中未示出)。
S1011、控制器接收来自第一电子设备的广播消息,所述广播消息包括所述第一电子设备的地址信息。
S1012、所述基础服务层向所述控制器发送第二角色信息,所述第二角色信息用于指示所述第二电子设备的期望角色,所述第二电子设备的期望角色为主控节点设备或终端节点设备。
具体地,基础服务层的通道管理模块或设备发现模块向控制器发送第二角色信息。
在自动连接的场景中,该第二角色信息可作为连接参数的一项携带在由设备发现模块发送的连接信息中,具体描述可参考S616的描述。
在首次连接的场景中,该第二角色信息可携带在由通道管理模块触发控制器发送第一接入请求的接入信息中,具体描述可参考S419的描述。
S1013、所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述第二电子设备,所述第一接入请求包括所述第二角色信息和所述第一电子设备的地址信息。
S1014、所述控制器接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述第二电子设备,所述第一电子设备的最终角色与所述第二电子设备的最终角色不同,所述第一电子设备的最终角色与所述第二电子设备的最终角色是基于所述第一电子设备的期望角色与所述第二电子设备的期望角色确定的,所述第一电子设备的期望角色为主控节点设备或终端节点设备。
S1015、所述控制器建立逻辑通道且向所述基础服务层发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层中对应于所述逻辑通道的控制通道。
具体地,在第一请求响应指示同意第一电子设备接入第二电子设备的情况下,控制器建立基础的逻辑通道,向基础服务层的通道管理模块发送逻辑通道标识(LCID),从而,建立控制通道。具体描述参考S429的相关描述,不再赘述。
如前所述,控制通道是在基础服务层中设计好的通道,逻辑通道建立完成后,对应的控制通道才可以被使用。这样,当第二电子设备的逻辑通道建立完成后,通道管理模块可基于LCID确定该LCID对应的控制通道,以使用对应的控制通道,从而,完成了第二电子设备的控制通道的建立。
本申请实施例提供的用于设备连接的方法,对于新一代的短距离接入技术(例如,SLE),第二电子设备内设置有控制器和上层的基础服务层,第二电子设备基于控制器扫描到的第一电子设备的广播消息和由基础服务层下发的第二角色信息,向控制器发起第一接入请求以及接收到第一请求响应后,建立逻辑通道,以实现控制通道的建立,从而实现第二电子设备和对端设备间的连接,为后续的数据传输提供基础。并且,本申请提供的短距离接入技术,由于第二电子设备和对端设备的最终角色可以基于双方的期望角色确定,可以使得双方的角色基于实际场景灵活可变,通信的灵活性较高,非常适用于具有灵活和小型化特点的产品以及适用于小带宽、低功耗、低速率的业务,更能较好地适用于多设备连接(即,一个电子设备可同时和多个设备连接且角色不固定)的场景,总之,适用范围 广。
可选地,所述广播消息包括用于指示所述第一电子设备的期望角色的第一角色信息。
在本申请实施例中,提供了自动连接和首次连接两种场景,不同的场景下第二电子设备触发第一接入请求的过程不同。
在自动连接的场景中,可选地,所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,包括:
所述控制器在扫描到所述广播消息后,向所述第一电子设备发送所述第一接入请求,所述第一电子设备是所述第二电子设备的白名单内的设备。
也就是说,在自动连接场景,控制器扫描白名单内的设备后,不需要向上层上报扫描结果,可直接发起第一接入请求。
本申请实施例提供的用于设备连接的方法,由于白名单内的设备都是之前和第二电子设备连接过的设备,所以,控制器通过基于白名单扫描设备,在扫描到白名单内的设备后可直接发起接入请求,简化了向上层上报结果的流程的同时,节省了连接所需的时间以实现设备间快速连接,提高连接过程的效率。
在自动连接的场景中,可选地,所述基础服务层向所述控制器发送第二角色信息,包括:
所述基础服务层向所述控制器发送连接信息,所述连接信息包括所述第二角色信息。
具体地,基础服务层的设备发现模块向控制器发送连接信息,该连接信息中包括连接参数,第二角色信息作为连接参数的一项。
可选地,所述连接信息还包括:用于指示所述控制器使能所述第二电子设备的白名单的信息。
可选地,所述连接信息还包括:用于指示连接模式的信息,所述连接模式为单设备连接模式或多设备连接模式,所述单设备连接模式表示在同一时段内所述第二电子设备仅能够和一个电子设备连接,所述多连接模式表示在同一时段内所述第二电子设备能够和多个电子设备连接。
上述由基础服务层发送连接信息的过程对应上文的S616,S616中的连接参数即为该连接信息中的连接参数,具体描述可参考上文的相关描述。
在自动连接的场景中,可选地,所述第二电子设备的连接模式为多设备连接模式;以及,所述方法还包括:在满足预设条件的情况下,所述控制器停止扫描;或,在不满足预设条件的情况下,所述控制器继续扫描;所述预设条件包括以下任一项:
所述控制器的扫描定时器超时;或,
所述第一电子设备为所述控制器扫描到的第N个设备;或,
所述第一电子设备为所述控制器扫描到的第N个设备且所述第二电子设备完成所述控制通道的建立;或,
在所述控制器的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备;或,
在所述控制器的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备且所述第二电子设备完成控制通道的建立;
其中,所述控制器扫描到的包括所述第一电子设备在内的N个设备是所述第二电子设备的白名单内的设备,N是所述第二电子设备能够连接的设备的最大数量,N为大于1 的整数。
该过程可对应上文S617中的S6172,具体描述可参考上文的相关描述,不再赘述。
本申请实施例提供的用于设备连接的方法,在第二电子设备支持多设备连接模式的情况下,第二电子设备的控制器在满足预设条件时才会停止扫描以停止整个连接过程,否则,在不满足预设条件时会继续扫描以实现多设备连接,这样,控制器不需要每次连接设备时都和上层(例如,基础服务层)进行交互(例如,由上层下发连接信息、扫描参数等)以发起接入请求,即,第二电子设备不需要每次连接设备时都重新开始连接的流程,不仅有效地减少了信令开销,而且,减少了多设备连接过程的时延从而实现多个设备的快速连接。
在自动连接的场景中,可选地,所述广播消息还包括所述第二电子设备的地址信息。
在首次连接的场景中,可选地,所述第二电子设备还包括基础应用层;以及,所述方法还包括:
所述控制器通过所述基础服务层向所述基础应用层发送基于所述广播消息确定的扫描结果,所述扫描结果包括所述第一电子设备的地址信息;
所述基础应用层向所述基础服务层发送第二信息,所述第二信息包括所述第一电子设备的地址信息;以及,
所述基础服务层向所述控制器发送第二角色信息,包括:
所述基础服务层根据所述第二信息向所述控制器发送接入信息,所述接入信息包括所述第二角色信息和所述第一电子设备的地址信息;以及,
所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,包括:
所述控制器响应于所述广播消息,根据所述接入信息发送所述第一接入请求。
具体地,控制器根据广播消息确定扫描结果且通过基础服务层的设备发现模块向基础应用层发送扫描结果(参考S417),基础应用层向基础服务层的通道管理模块发送第二信息(参考S418),通道管理模块根据该第二信息向控制器发送接入信息(参考S419),控制器响应于该广播消息,根据该接入信息发送该第一接入请求(参考S420)。
应理解,在该过程中,第二角色信息携带在通道管理模块发下的接入信息中。
可选地,所述广播消息、所述扫描结果和所述第二信息都包括用于指示所述第一电子设备的期望角色的第一角色信息;以及,
在所述基础服务层根据所述第二信息向所述控制器发送接入信息之前,所述方法还包括:
所述基础服务层根据所述第一电子设备的期望角色,确定所述第二电子设备的期望角色,所述第二电子设备的期望角色与所述第一电子设备的期望角色不同。
具体地,基础服务层的通道管理模块从基础应用层下发的第二信息中得到第一角色信息,根据第一角色信息确定自己的期望角色,通过接入信息下发给控制器。
本申请实施例提供的用于设备连接的方法,通过在第一电子设备的广播消息中携带第一角色信息,可以使得接收该广播消息的第二电子设备最终得到第一角色信息且基于第一角色信息确定自己的角色,尽可能在连接过程的初始阶段使得对端设备匹配到与第一电子设备的期望角色不同的期望角色,提高连接效率。
在首次连接的场景中,可选地,所述接入信息还包括:用于指示所述第二电子设备忽略所述第二电子设备的白名单的信息。
其中,第二电子设备的白名单中的设备是曾经与第二电子设备连接过的设备,指示第 二电子设备忽略第二电子设备的白名单表示第二电子设备可以与白名单以外的设备连接。
本申请实施例提供的用于设备连接的方法,在第二电子设备保存有白名单的情况下,第二电子设备并不限于与白名单中的设备连接,也想和未连接过的新的电子设备建立连接,因此,接入信息中携带用于指示忽略第二电子设备的白名单的信息可实现设备间的首次连接。此外,若第二电子设备之前使能了白名单,在与第一电子设备的首次连接时,若未忽略第二电子设备的白名单,位于第二电子设备周围的曾经与第二电子设备连接的其他电子设备可能会与第二电子设备实现自动连接,由于第二电子设备能够连接的设备是有限的,因此会影响第一电子设备与第二电子设备的连接,所以,通过用于指示第二电子设备忽略第二电子设备的白名单的信息使得第二电子设备不基于白名单进行设备连接,可以进一步保证第一电子设备与第二电子设备首次连接的成功性。
可选地,所述第二信息还包括用于指示所述第一短距离接入技术。
可选地,所述第一接入请求还包括所述第二电子设备的地址信息。
本申请实施例提供的用于设备连接的方法,通过在第一接入请求中携带第二电子设备的地址信息,便于第一电子设备更新第一电子设备的白名单,可很好地适应于首次连接的场景。
可选地,所述基础服务层向所述基础应用层发送用于指示所述控制通道可用的信息。
具体地,基础服务层的通道管理模块向基础应用层发送用于指示所述控制通道可用的信息。
图11是本申请实施例提供的用于设备连接的方法1100的示意性流程图。该方法1100由第二电子设备执行,第二电子设备支持短距离接入技术和多设备连接。应理解,方法1100可应用于任一种短距离接入技术,包括但不限于:Wi-Fi,蓝牙、ZigBee以及本申请的SLE和SLB。
S1110、第一电子设备发送广播消息。具体描述可参考S614。
S1111、第二电子设备在扫描到所述第一电子设备的广播消息后,发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述的第二电子设备,所述第一电子设备是所述第二电子设备的白名单内的设备。具体描述可参考S614-S618。
S1112、所述第二电子设备接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述第二电子设备。具体描述可参考S625。
S1113、所述第二电子设备建立逻辑通道,以建立对应于所述逻辑通道的控制通道。具体描述可参考S627。
在满足预设条件的情况下,所述第二电子设备停止扫描;或,在不满足预设条件的情况下,所述第二电子设备继续扫描;其中,所述预设条件包括以下任一项:
所述第二电子设备的扫描定时器超时;或,
所述第一电子设备为所述第二电子设备扫描到的第N个设备;或,
所述第一电子设备为所述第二电子设备扫描到的第N个设备且所述第二电子设备完成所述控制通道的建立;或,
在所述第二电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备;或,
在所述第二电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述第二电 子设备扫描到的第N个设备且所述第二电子设备完成控制通道的建立;
其中,所述第二电子设备扫描到的包括所述第一电子设备在内的N个设备是所述第二电子设备的白名单内的设备,N是所述第二电子设备能够连接的设备的最大数量,N为大于1的整数。具体描述可参考S6172。
本申请实施例提供的用于设备连接的方法,在第二电子设备支持多设备连接模式的情况下,第二电子设备在满足预设条件时才会停止扫描以停止整个连接过程,否则,在不满足预设条件时会继续扫描以实现多设备连接,这样,第二电子设备不需要每次连接设备时都重新开始连接的流程(例如,由上层下发连接信息、扫描参数等),不仅有效地减少了信令开销,而且,减少了多设备连接过程的时延从而实现多个设备的快速连接。
以上,结合图1至图11,详细说明了本申请实施例提供的用于设备连接的方法,下面将结合图12至图13,详细描述根据本申请实施例提供的电子设备。
图12示出了本申请实施例提供的电子设备1200,电子设备1200可以是上文的第一电子设备或第二电子设备,也可以为第一电子设备或第二电子设备中的芯片,电子设备1200支持短距离接入技术,包括基础服务层1210和控制器1220,基础服务层1210包括设备发现模块1211和通道管理模块1212。
在一种可能的实现方式中,电子设备1200是上文的第一电子设备,用于执行上述方法400或600中第一电子设备对应的各个流程和步骤。
所述基础服务层1210用于,确定第一角色信息,所述第一角色信息用于指示所述电子设备的期望角色,所述电子设备的期望角色为主控节点设备或终端节点设备;
所述基础服务层1210还用于,向所述控制器1220发送广播事件,所述广播事件用于指示广播策略;
所述控制器1220用于,根据所述广播事件发送广播消息,所述广播消息包括所述电子设备的地址信息;
所述控制器1220还用于,根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层1210发送第二接入请求,所述第一接入请求和所述第二接入请求用于请求所述电子设备接入所述第二电子设备,所述第一接入请求和所述第二接入请求包括用于指示所述第二电子设备的期望角色的第二角色信息,所述第二电子设备的期望角色为主控节点设备或终端节点设备;
所述控制器1220还用于,根据接收到的所述基础服务层1210响应于所述第二接入请求发送的第二请求响应发送第一请求响应,所述第一请求响应和所述第二请求响应用于指示同意所述电子设备接入所述第二电子设备,所述电子设备的最终角色与所述第二电子设备的最终角色不同,所述电子设备的最终角色与所述第二电子设备的最终角色是基于所述电子设备的期望角色与所述第二电子设备的期望角色确定的;
所述控制器1220还用于,建立逻辑通道,且向所述基础服务层1210发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层1210中对应于所述逻辑通道的控制通道。
具体地,基础服务层1210中的设备发现模块1211用于确定第一角色信息,还用于向通道管理模块1212发送该第一角色信息,以便于通道管理模块1212进行后续的控制通道的建立;设备发现模块1211用于向控制器1220发送广播事件;控制器1220用于接收第一接入请求、发送第二接入请求、接收第二请求响应、发送第一请求响应、建立逻辑通道 且发送逻辑通道标识。
可选地,所述广播事件包括所述第一角色信息,所述广播消息包括所述第一角色信息。
可选地,所述基础服务层1210还用于,响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述电子设备的最终角色和所述第二电子设备的最终角色;
所述基础服务层1210还用于,向所述控制器1220发送所述第二请求响应。
具体地,基础服务层1210中的通道管理模块1212用于确定两个电子设备的最终角色以及发送第二请求响应。
在一些实施例中,所述电子设备的期望角色与所述第二电子设备的期望角色相同,所述第一角色信息还用于指示所述电子设备的期望角色可协商;以及,
所述基础服务层1210具体用于,更换所述电子设备的期望角色,以将更换后的所述电子设备的期望角色确定为所述电子设备的最终角色且将第二电子设备的期望角色确定为所述第二电子设备的最终角色。
在另一些实施例中,所述电子设备的期望角色与所述第二电子设备的期望角色不同;以及,
所述基础服务层1210具体用于,将所述电子设备的期望角色确定为所述电子设备的最终角色,将所述第二电子设备的期望角色确定为所述第二电子设备的最终角色。
可选地,所述电子设备还包括基础应用层;以及,
所述基础服务层1210还用于,根据所述第二接入请求,向所述基础应用层发送第三接入请求,所述第三接入请求用于请求所述电子设备接入所述第二电子设备;
所述基础应用层还用于,响应于所述第三接入请求,在满足以下至少一项的情况下,向所述基础服务层1210发送第三请求响应,所述第三请求响应用于指示同意所述电子设备接入所述第二电子设备,其中,所述至少一项包括:所述电子设备当前能够连接的电子设备的数量大于或等于1,或,检测到用户针对所述电子设备显示的接收请求的确认操作;以及,
所述基础服务层1210具体用于,根据所述第三请求响应,向所述控制器1220发送所述第二请求响应。
具体地,基础服务层1210中的通道管理模块1212用于根据第二接入请求向基础应用层发送第三接入请求,以及,根据接收到的基础应用层的第三请求响应发送第二请求响应。
可选地,所述广播事件还包括第一设备过滤信息,所述第一设备过滤信息用于指示允许所述电子设备接入所述电子设备的白名单以内和以外的设备。
可选地,所述第一接入请求还包括所述第二电子设备的地址信息;以及,
所述控制器1220还用于,将所述第二电子设备的地址信息所表示的地址添加至所述电子设备的白名单中,以更新所述电子设备的白名单。
可选地,所述广播事件还包括第二设备过滤信息,所述第二设备过滤信息用于指示仅允许所述电子设备接入所述电子设备的白名单以内的设备。
可选地,所述广播消息还包括:所述第二电子设备的地址信息,所述第二电子设备是所述电子设备的白名单内的设备。
可选地,所述基础服务层1210还用于,向所述基础应用层发送用于指示所述控制通道可用的信息。
具体地,基础服务层1210中的通道管理模块1212用于发送该信息。
在另一种可能的实现方式中,电子设备1200是上文的第二电子设备,用于执行上述方法400或600中第二电子设备对应的各个流程和步骤。
所述控制器1220用于,接收来自第一电子设备的广播消息,所述广播消息包括所述第一电子设备的地址信息;
所述基础服务层1210用于,向所述控制器1220发送第二角色信息,所述第二角色信息用于指示所述电子设备的期望角色,所述电子设备的期望角色为主控节点设备或终端节点设备;
所述控制器1220还用于,响应于所述广播消息,向所述第一电子设备发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述电子设备,所述第一接入请求包括所述第二角色信息和所述第一电子设备的地址信息;
所述控制器1220还用于,接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述电子设备,所述第一电子设备的最终角色与所述电子设备的最终角色不同,所述第一电子设备的最终角色与所述电子设备的最终角色是基于所述第一电子设备的期望角色与所述电子设备的期望角色确定的,所述第一电子设备的期望角色为主控节点设备或终端节点设备;
所述控制器1220还用于,建立逻辑通道且向所述基础服务层1210发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层1210中对应于所述逻辑通道的控制通道。
可选地,所述广播消息包括用于指示所述第一电子设备的期望角色的第一角色信息。
可选地,所述控制器1220具体用于,在扫描到所述广播消息后,向所述第一电子设备发送所述第一接入请求,所述第一电子设备是所述电子设备的白名单内的设备。
可选地,所述基础服务层1210具体用于,向所述控制器1220发送连接信息,所述连接信息包括所述第二角色信息,其中,所述连接信息还包括:用于指示所述控制器1220使能所述电子设备的白名单的信息。
具体地,基础服务层1210中的设备发现模块1211用于发送连接信息。
可选地,所述连接信息还包括:用于指示连接模式的信息,所述连接模式为单设备连接模式或多设备连接模式,所述单设备连接模式表示在同一时段内所述电子设备仅能够和一个电子设备连接,所述多连接模式表示在同一时段内所述电子设备能够和多个电子设备连接。
可选地,所述电子设备的连接模式为多设备连接模式;以及,所述控制器1220还用于,在满足预设条件的情况下,停止扫描;或,在不满足预设条件的情况下,继续扫描;所述预设条件包括以下任一项:
所述控制器1220的扫描定时器超时;或,
所述第一电子设备为所述控制器1220扫描到的第N个设备;或,
所述第一电子设备为所述控制器1220扫描到的第N个设备且所述电子设备完成所述控制通道的建立;或,
在所述控制器1220的扫描定时器未超时的情况下,所述第一电子设备为所述控制器1220扫描到的第N个设备;或,
在所述控制器1220的扫描定时器未超时的情况下,所述第一电子设备为所述控制器 1220扫描到的第N个设备且所述电子设备完成控制通道的建立;
其中,所述控制器1220扫描到的包括所述第一电子设备在内的N个设备是所述电子设备的白名单内的设备,N是所述电子设备能够连接的设备的最大数量,N为大于1的整数。
可选地,所述广播消息还包括所述电子设备的地址信息。
可选地,所述电子设备还包括基础应用层;以及,
所述控制器1220还用于,通过所述基础服务层1210向所述基础应用层发送基于所述广播消息确定的扫描结果,所述扫描结果包括所述第一电子设备的地址信息;
所述基础应用层还用于,向所述基础服务层1210发送第二信息,所述第二信息包括所述第一电子设备的地址信息;以及,
所述基础服务层1210具体用于,根据所述第二信息向所述控制器1220发送接入信息,所述接入信息包括所述第二角色信息和所述第一电子设备的地址信息;以及,
所述控制器1220具体用于,响应于所述广播消息,根据所述接入信息发送所述第一接入请求。
具体地,所述控制器1220还用于发送扫描结果,所述基础应用层用于根据扫描结果向设备发现模块1211发送第二信息,通道管理模块1212用于根据第二信息向控制器1220发送接入信息。
可选地,所述广播消息、所述扫描结果和所述第二信息都包括用于指示所述第一电子设备的期望角色的第一角色信息;以及,
所述基础服务层1210具体用于,根据所述第一电子设备的期望角色,确定所述电子设备的期望角色,所述电子设备的期望角色与所述第一电子设备的期望角色不同;
所述基础服务层1210向所述控制器1220发送所述接入信息。
具体的,基础服务层1210中的通道管理模块1212用于确定第一电子设备的期望角色,且发送接入信息。
可选地,所述接入信息还包括:用于指示所述电子设备忽略所述电子设备的白名单的信息。
可选地,所述第二信息还包括用于指示所述第一短距离接入技术。
可选地,所述第一接入请求还包括所述电子设备的地址信息。
可选地,所述基础服务层1210还用于,向所述基础应用层发送用于指示所述控制通道可用的信息。
在另一种可能的实现方式中,电子设备1200是上文的第二电子设备,支持多设备连接模式,用于执行上述方法1100中第二电子设备对应的各个流程和步骤。
控制器1220用于,在扫描到第一电子设备的广播消息后,发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述的电子设备,所述第一电子设备是所述电子设备的白名单内的设备;
控制器1220用于,接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述电子设备;
控制器1220用于,建立逻辑通道,以建立对应于所述逻辑通道的控制通道;
在满足预设条件的情况下,控制器1220用于停止扫描;或,在不满足预设条件的情况下,控制器1220用于继续扫描;其中,所述预设条件包括以下任一项:
所述电子设备的扫描定时器超时;或,
所述第一电子设备为所述电子设备扫描到的第N个设备;或,
所述第一电子设备为所述电子设备扫描到的第N个设备且所述电子设备完成所述控制通道的建立;或,
在所述电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述控制器1220扫描到的第N个设备;或,
在所述电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述电子设备扫描到的第N个设备且所述电子设备完成控制通道的建立;
其中,所述电子设备扫描到的包括所述第一电子设备在内的N个设备是所述电子设备的白名单内的设备,N是所述电子设备能够连接的设备的最大数量,N为大于1的整数。
应理解,各单元执行上述各个方法中相应步骤的具体过程在上述方法实施例中已经详细说明,为了简洁,此处不再赘述。
图13示出了本申请实施例提供的电子设备1300。应理解,电子设备1300可以具体为上述实施例中的第一电子设备或第二电子设备,并且可以用于执行上述方法实施例中与第一电子设备或第二电子设备对应的各个步骤和/或流程。
电子设备1300包括处理器1310、收发器1320和存储器1330。其中,处理器1310、收发器1320和存储器1330通过内部连接通路互相通信,处理器1310可以实现电子设备1200中各种可能的实现方式中基础服务层和控制器的功能,收发器1320可以实现电子设备1200中各种可能的实现方式中基础服务层和控制器的功能。存储器1330用于存储指令,处理器1310用于执行存储器1330存储的指令,或者说,处理器1310可以调用这些存储指令实现电子设备1200中基础服务层和控制器的功能,以控制收发器1320发送信号和/或接收信号。
可选地,该存储器1330可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器1310可以用于执行存储器中存储的指令,并且当该处理器1310执行存储器中存储的指令时,该处理器1310用于执行上述与接入网设备或核心网设备对应的方法实施例的各个步骤和/或流程。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
需要说明的是,在本申请实施中,“协议”可以指通信领域的标准协议。
还需要说明的是,本申请实施例中,“预定义”可以通过在设备(例如,包括站点和接入点)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。
需要说明的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。
在本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。 “元件的至少部分”是指元件的部分或全部。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (30)

  1. 一种用于设备连接的方法,其特征在于,应用于第一电子设备中,所述第一电子设备支持短距离接入技术,包括基础服务层和控制器,所述方法包括:
    所述基础服务层确定第一角色信息,所述第一角色信息用于指示所述第一电子设备的期望角色,所述第一电子设备的期望角色为主控节点设备或终端节点设备;
    所述基础服务层向所述控制器发送广播事件,所述广播事件用于指示广播策略;
    所述控制器根据所述广播事件发送广播消息,所述广播消息包括所述第一电子设备的地址信息;
    所述控制器根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层发送第二接入请求,所述第一接入请求和所述第二接入请求用于请求所述第一电子设备接入所述第二电子设备,所述第一接入请求和所述第二接入请求包括用于指示所述第二电子设备的期望角色的第二角色信息,所述第二电子设备的期望角色为主控节点设备或终端节点设备;
    所述控制器根据接收到的所述基础服务层响应于所述第二接入请求发送的第二请求响应发送第一请求响应,所述第一请求响应和所述第二请求响应用于指示同意所述第一电子设备接入所述第二电子设备,所述第一电子设备的最终角色与所述第二电子设备的最终角色不同,所述第一电子设备的最终角色与所述第二电子设备的最终角色是基于所述第一电子设备的期望角色与所述第二电子设备的期望角色确定的;
    所述控制器建立逻辑通道,且向所述基础服务层发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层中对应于所述逻辑通道的控制通道。
  2. 根据权利要求1所述的方法,其特征在于,所述广播事件包括所述第一角色信息,所述广播消息包括所述第一角色信息。
  3. 根据权利要求1或2所述的方法,其特征在于,在所述控制器根据接收到的所述基础服务层响应于所述第二接入请求发送的第二请求响应发送第一请求响应之前,所述方法还包括:
    所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色和所述第二电子设备的最终角色;
    所述基础服务层向所述控制器发送所述第二请求响应。
  4. 根据权利要求3所述的方法,其特征在于,所述第一电子设备的期望角色与所述第二电子设备的期望角色相同,所述第一角色信息还用于指示所述第一电子设备的期望角色可协商;以及,
    所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色,包括:
    所述基础服务层更换所述第一电子设备的期望角色,以将更换后的所述第一电子设备的期望角色确定为所述第一电子设备的最终角色且将第二电子设备的期望角色确定为所述第二电子设备的最终角色。
  5. 根据权利要求3所述的方法,其特征在于,所述第一电子设备的期望角色与所述第二电子设备的期望角色不同;以及,
    所述基础服务层响应于所述第二接入请求,根据所述第一角色信息和所述第二角色信息,确定所述第一电子设备的最终角色,包括:
    所述基础服务层将所述第一电子设备的期望角色确定为所述第一电子设备的最终角色,将所述第二电子设备的期望角色确定为所述第二电子设备的最终角色。
  6. 根据权利要求3至5中任一项所述的方法,其特征在于,所述第一电子设备还包括基础应用层;以及,
    在所述控制器根据接收到的第二电子设备响应于所述广播消息的第一接入请求向所述基础服务层发送第二接入请求之后,所述方法还包括:
    所述基础服务层根据所述第二接入请求,向所述基础应用层发送第三接入请求,所述第三接入请求用于请求所述第一电子设备接入所述第二电子设备;
    所述基础应用层响应于所述第三接入请求,在满足以下至少一项的情况下,向所述基础服务层发送第三请求响应,所述第三请求响应用于指示同意所述第一电子设备接入所述第二电子设备,其中,所述至少一项包括:所述第一电子设备当前能够连接的电子设备的数量大于或等于1,或,检测到用户针对所述第一电子设备显示的接收请求的确认操作;以及,
    所述基础服务层向所述控制器发送第二请求响应,包括:
    所述基础服务层根据所述第三请求响应,向所述控制器发送所述第二请求响应。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述广播事件还包括第一设备过滤信息,所述第一设备过滤信息用于指示允许所述第一电子设备接入所述第一电子设备的白名单以内和以外的设备。
  8. 根据权利要求7所述的方法,其特征在于,所述第一接入请求还包括所述第二电子设备的地址信息;以及,所述方法还包括:
    所述控制器将所述第二电子设备的地址信息所表示的地址添加至所述第一电子设备的白名单中,以更新所述第一电子设备的白名单。
  9. 根据权利要求1至6中任一项所述的方法,其特征在于,所述广播事件还包括第二设备过滤信息,所述第二设备过滤信息用于指示仅允许所述第一电子设备接入所述第一电子设备的白名单以内的设备。
  10. 根据权利要求9所述的方法,其特征在于,所述广播消息还包括:所述第二电子设备的地址信息,所述第二电子设备是所述第一电子设备的白名单内的设备。
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,所述方法还包括:
    所述基础服务层向所述基础应用层发送用于指示所述控制通道可用的信息。
  12. 一种用于设备连接的方法,其特征在于,应用于第二电子设备中,所述第二电子设备支持短距离接入技术,包括基础服务层和控制器,所述方法包括:
    所述控制器接收来自第一电子设备的广播消息,所述广播消息包括所述第一电子设备的地址信息;
    所述基础服务层向所述控制器发送第二角色信息,所述第二角色信息用于指示所述第二电子设备的期望角色,所述第二电子设备的期望角色为主控节点设备或终端节点设备;
    所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述第二电子设备,所述第一接入请求包括所述第二角色信息和所述第一电子设备的地址信息;
    所述控制器接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述第二电子设备,所述第一电子设备的最终角色与所述第二电子设备的最终角色不同,所述第一电子设备的最终角色与所述第二电子设备的最终角色是基于所述第一电子设备的期望角色与所述第二电子设备的期望角色确定的,所述第一电子设备的期望角色为主控节点设备或终端节点设备;
    所述控制器建立逻辑通道且向所述基础服务层发送用于标识所述逻辑通道的逻辑通道标识,以建立所述基础服务层中对应于所述逻辑通道的控制通道。
  13. 根据权利要求12所述的方法,其特征在于,所述广播消息包括用于指示所述第一电子设备的期望角色的第一角色信息。
  14. 根据权利要求12或13所述的方法,其特征在于,所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,包括:
    所述控制器在扫描到所述广播消息后,向所述第一电子设备发送所述第一接入请求,所述第一电子设备是所述第二电子设备的白名单内的设备。
  15. 根据权利要求14所述的方法,其特征在于,所述基础服务层向所述控制器发送第二角色信息,包括:
    所述基础服务层向所述控制器发送连接信息,所述连接信息包括所述第二角色信息,其中,所述连接信息还包括:用于指示所述控制器使能所述第二电子设备的白名单的信息。
  16. 根据权利要求15所述的方法,其特征在于,所述连接信息还包括:用于指示连接模式的信息,所述连接模式为单设备连接模式或多设备连接模式,所述单设备连接模式表示在同一时段内所述第二电子设备仅能够和一个电子设备连接,所述多连接模式表示在同一时段内所述第二电子设备能够和多个电子设备连接。
  17. 根据权利要求14至16中任一项所述的方法,其特征在于,所述第二电子设备的连接模式为多设备连接模式;以及,所述方法还包括:
    在满足预设条件的情况下,所述控制器停止扫描;或,在不满足预设条件的情况下,所述控制器继续扫描;所述预设条件包括以下任一项:
    所述控制器的扫描定时器超时;或,
    所述第一电子设备为所述控制器扫描到的第N个设备;或,
    所述第一电子设备为所述控制器扫描到的第N个设备且所述第二电子设备完成所述控制通道的建立;或,
    在所述控制器的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备;或,
    在所述控制器的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备且所述第二电子设备完成控制通道的建立;
    其中,所述控制器扫描到的包括所述第一电子设备在内的N个设备是所述第二电子设备的白名单内的设备,N是所述第二电子设备能够连接的设备的最大数量,N为大于1的整数。
  18. 根据权利要求14至17中任一项所述的方法,其特征在于,所述广播消息还包括所述第二电子设备的地址信息。
  19. 根据权利要求12或13所述的方法,其特征在于,所述第二电子设备还包括基础应用层;以及,所述方法还包括:
    所述控制器通过所述基础服务层向所述基础应用层发送基于所述广播消息确定的扫描结果,所述扫描结果包括所述第一电子设备的地址信息;
    所述基础应用层向所述基础服务层发送第二信息,所述第二信息包括所述第一电子设备的地址信息;以及,
    所述基础服务层向所述控制器发送第二角色信息,包括:
    所述基础服务层根据所述第二信息向所述控制器发送接入信息,所述接入信息包括所述第二角色信息和所述第一电子设备的地址信息;以及,
    所述控制器响应于所述广播消息,向所述第一电子设备发送第一接入请求,包括:
    所述控制器响应于所述广播消息,根据所述接入信息发送所述第一接入请求。
  20. 根据权利要求19所述的方法,其特征在于,所述广播消息、所述扫描结果和所述第二信息都包括用于指示所述第一电子设备的期望角色的第一角色信息;以及,
    所述基础服务层根据所述第二信息向所述控制器发送接入信息,包括:
    所述基础服务层根据所述第一电子设备的期望角色,确定所述第二电子设备的期望角色,所述第二电子设备的期望角色与所述第一电子设备的期望角色不同;
    所述基础服务层向所述控制器发送所述接入信息。
  21. 根据权利要求19或20所述的方法,其特征在于,所述接入信息还包括:用于指示所述第二电子设备忽略所述第二电子设备的白名单的信息。
  22. 根据权利要求19至21中任一项所述的方法,其特征在于,所述第二信息还包括用于指示所述第一短距离接入技术。
  23. 根据权利要求12至22中任一项所述的方法,其特征在于,所述第一接入请求还包括所述第二电子设备的地址信息。
  24. 根据权利要求12至23中任一项所述的方法,其特征在于,所述方法还包括:
    所述基础服务层向所述基础应用层发送用于指示所述控制通道可用的信息。
  25. 一种用于设备连接的方法,其特征在于,应用于第二电子设备中,所述第二电子设备支持短距离接入技术,所述第二电子设备的连接模式为多设备连接模式,所述方法包括:
    所述第二电子设备在扫描到第一电子设备的广播消息后,发送第一接入请求,所述第一接入请求用于请求所述第一电子设备接入所述的第二电子设备,所述第一电子设备是所述第二电子设备的白名单内的设备;
    所述第二电子设备接收所述第一电子设备响应于所述第一接入请求的第一请求响应,所述第一请求响应用于指示同意所述第一电子设备接入所述第二电子设备;
    所述第二电子设备建立逻辑通道,以建立对应于所述逻辑通道的控制通道;
    在满足预设条件的情况下,所述第二电子设备停止扫描;或,在不满足预设条件的情况下,所述第二电子设备继续扫描;其中,所述预设条件包括以下任一项:
    所述第二电子设备的扫描定时器超时;或,
    所述第一电子设备为所述第二电子设备扫描到的第N个设备;或,
    所述第一电子设备为所述第二电子设备扫描到的第N个设备且所述第二电子设备完成所述控制通道的建立;或,
    在所述第二电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述控制器扫描到的第N个设备;或,
    在所述第二电子设备的扫描定时器未超时的情况下,所述第一电子设备为所述第二电子设备扫描到的第N个设备且所述第二电子设备完成控制通道的建立;
    其中,所述第二电子设备扫描到的包括所述第一电子设备在内的N个设备是所述第二电子设备的白名单内的设备,N是所述第二电子设备能够连接的设备的最大数量,N为大于1的整数。
  26. 一种电子设备,其特征在于,包括:
    存储器,用于存储计算机指令;
    处理器,用于调用所述存储器中存储的计算机指令,以执行如权利要求1至11中任一项所述的方法,或,以执行如权利要求12至24中任一项所述的方法,或,以执行如权利要求25任一项所述的方法。
  27. 一种通信系统,其特征在于,包括:
    第一电子设备,用于执行如权利要求1至11中任一项所述的方法;
    第二电子设备,用于执行权利要求12至24中任一项所述的方法。
  28. 一种计算机可读存储介质,其特征在于,用于存储计算机指令,所述计算机指令用于实现如权利要求1至11中任一项所述的方法,或,用于实现如权利要求12至24所述的方法,或,用于实现如权利要求25所述的方法。
  29. 一种计算机程序产品,其特征在于,包括计算机指令,所述计算机指令用于实现如权利要求1至11中任一项所述的方法,或,用于实现如权利要求12至24中任一项所述的方法,或,用于实现如权利要求25所述的方法。
  30. 一种芯片,其特征在于,所述芯片包括:
    存储器:用于存储指令;
    处理器,用于从所述存储器中调用并运行所述指令,使得安装有所述芯片系统的通信设备执行如权利要求1至11中任一项所述的方法,或,用于实现如权利要求12至24中任一项所述的方法,或,用于执行如权利要求25所述的方法。
PCT/CN2022/108173 2021-08-02 2022-07-27 用于设备连接的方法、电子设备和系统 WO2023011277A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22851991.4A EP4380238A1 (en) 2021-08-02 2022-07-27 Method for device connection, electronic devices, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110878581.9 2021-08-02
CN202110878581.9A CN115701724B (zh) 2021-08-02 2021-08-02 用于设备连接的方法、电子设备和系统

Publications (1)

Publication Number Publication Date
WO2023011277A1 true WO2023011277A1 (zh) 2023-02-09

Family

ID=85142315

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108173 WO2023011277A1 (zh) 2021-08-02 2022-07-27 用于设备连接的方法、电子设备和系统

Country Status (3)

Country Link
EP (1) EP4380238A1 (zh)
CN (1) CN115701724B (zh)
WO (1) WO2023011277A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103813479A (zh) * 2014-03-13 2014-05-21 宁波保税区攀峒信息科技有限公司 一种临时通信网构建方法
CN105594236A (zh) * 2013-09-26 2016-05-18 Gh9有限会社 低功耗短距离无线通信系统
CN108111999A (zh) * 2017-12-28 2018-06-01 北京地平线机器人技术研发有限公司 短距离通信设备分享请求和控制方法及电子设备
CN112740733A (zh) * 2020-12-24 2021-04-30 华为技术有限公司 一种安全接入方法及装置
CN112789873A (zh) * 2019-09-11 2021-05-11 开利公司 具有子网的蓝牙网状路由
CN113039857A (zh) * 2018-11-13 2021-06-25 高通股份有限公司 多无线接入技术双重连接的优化辅节点报告
CN113170377A (zh) * 2021-04-19 2021-07-23 华为技术有限公司 一种网络连接建立方法及相应的装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8879667B2 (en) * 2011-07-01 2014-11-04 Intel Corporation Layer shifting in open loop multiple-input, multiple-output communications
US9008917B2 (en) * 2012-12-27 2015-04-14 GM Global Technology Operations LLC Method and system for detecting proximity of an end device to a vehicle based on signal strength information received over a bluetooth low energy (BLE) advertising channel
WO2020124371A1 (zh) * 2018-12-18 2020-06-25 华为技术有限公司 一种数据信道的建立方法及设备
WO2020191570A1 (zh) * 2019-03-25 2020-10-01 华为技术有限公司 建立无线通信连接的方法和相关设备
CN110581882B (zh) * 2019-07-31 2021-07-16 华为技术有限公司 一种业务实现方法及电子设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105594236A (zh) * 2013-09-26 2016-05-18 Gh9有限会社 低功耗短距离无线通信系统
CN103813479A (zh) * 2014-03-13 2014-05-21 宁波保税区攀峒信息科技有限公司 一种临时通信网构建方法
CN108111999A (zh) * 2017-12-28 2018-06-01 北京地平线机器人技术研发有限公司 短距离通信设备分享请求和控制方法及电子设备
CN113039857A (zh) * 2018-11-13 2021-06-25 高通股份有限公司 多无线接入技术双重连接的优化辅节点报告
CN112789873A (zh) * 2019-09-11 2021-05-11 开利公司 具有子网的蓝牙网状路由
CN112740733A (zh) * 2020-12-24 2021-04-30 华为技术有限公司 一种安全接入方法及装置
CN113170377A (zh) * 2021-04-19 2021-07-23 华为技术有限公司 一种网络连接建立方法及相应的装置

Also Published As

Publication number Publication date
CN115701724A (zh) 2023-02-10
CN115701724B (zh) 2024-05-03
EP4380238A1 (en) 2024-06-05

Similar Documents

Publication Publication Date Title
KR102228343B1 (ko) 테더링되지 않은 무선 접속된 디바이스들 사이의 역할 스와핑
WO2020253695A1 (zh) 一种智能家居设备的接入方法及一种电子设备
JP6374526B2 (ja) 無線通信システムにおけるデータ送信率調節方法及び装置
US9716969B2 (en) Method and apparatus for controlling device in wireless communication system
US10798548B2 (en) Method for controlling device by using Bluetooth technology, and apparatus
CN112313977B (zh) 利用通信共存的低时延音频流式传输
EP3893109B1 (en) Method and device for connecting bluetooth devices
EP3849223B1 (en) Bluetooth headset device and communication method for the same
US10349253B2 (en) Method for transmitting and receiving data, and device therefor
TW201607263A (zh) 經由藍芽低能量傳達之多通道音訊之同步化
US20160299739A1 (en) Method for controlling data streaming using bluetooth communication
WO2021043219A1 (zh) 一种蓝牙回连方法及相关装置
CN113348685B (zh) 一种建立蓝牙数据通道的方法及装置
US10721611B2 (en) Method and device for controlling device by using Bluetooth technology
WO2022135303A1 (zh) 一种tws耳机连接方法及设备
KR102632536B1 (ko) 블루투스 네트워크 환경에서 응답 메시지를 전송하기 위한 전자 장치 및 그에 관한 방법
EP4210362A1 (en) Bluetooth communication system, bluetooth connection method, electronic device, and storage medium
WO2023036178A1 (zh) 蓝牙连接方法、装置、耳机设备及计算机可读存储介质
US10194477B2 (en) Method and apparatus for controlling a device using bluetooth technology
US11445453B2 (en) Method and apparatus for controlling power of device by using bluetooth technology
WO2021043277A1 (zh) 配置蓝牙连接参数的方法和电子设备
WO2023011277A1 (zh) 用于设备连接的方法、电子设备和系统
WO2023103732A1 (zh) 耳机设备的状态控制方法、装置、耳机设备及存储介质
WO2023050128A1 (zh) 数据传输方法和装置
WO2022041681A1 (zh) 无线耳机、控制无线耳机的方法及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22851991

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2022851991

Country of ref document: EP

Effective date: 20240301