WO2022228083A1 - 一种多设备建立连接的方法及设备 - Google Patents

一种多设备建立连接的方法及设备 Download PDF

Info

Publication number
WO2022228083A1
WO2022228083A1 PCT/CN2022/085797 CN2022085797W WO2022228083A1 WO 2022228083 A1 WO2022228083 A1 WO 2022228083A1 CN 2022085797 W CN2022085797 W CN 2022085797W WO 2022228083 A1 WO2022228083 A1 WO 2022228083A1
Authority
WO
WIPO (PCT)
Prior art keywords
devices
message
information
same
electronic device
Prior art date
Application number
PCT/CN2022/085797
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 EP22794554.0A priority Critical patent/EP4311282A4/en
Publication of WO2022228083A1 publication Critical patent/WO2022228083A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1042Peer-to-peer [P2P] networks using topology management mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities
    • 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
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • 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

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a method and device for establishing a connection for multiple devices.
  • a multi-screen collaboration function (or referred to as a multi-device collaboration function) is provided, thereby supporting applications and services of multi-device collaboration, such as multi-screen collaboration and information sharing.
  • multiple terminal devices such as mobile phones, tablets, PCs, and display screens need to be connected together to work together with multiple devices, that is, multi-device interconnection, so that service data can be transmitted between multiple terminal devices.
  • the WiFi P2P protocol is developed based on the 802.11 protocol framework and belongs to a centralized network communication structure. That is, WiFi P2P requires that each terminal device must be configured with a role, such as group owner (GO) or group client (GC). As a central node, GO can communicate with any GC node connected to the GO, but cannot communicate with each other between GO and GO, and between GC and GC. However, the business that needs to be coordinated may exist in any two devices among the interconnected devices, such as between one GC and another GC. Obviously, the multi-device interconnection based on the WiFi P2P protocol limits the practical application requirements of distributed services.
  • the present application provides a method and device for establishing a connection between multiple devices, so that the roles of multiple interconnected devices are equal, and the distributed services will not be restricted due to the roles of each device.
  • a method for establishing a connection between multiple devices is provided, and the method is used for any device among the multiple devices.
  • the multiple devices establish a connection to form a system, for example, the multiple devices include a first device, a second device, and more. many devices.
  • the following takes the method being executed by the first device as an example.
  • the method includes:
  • the first device sends a first message, and the first message is used to discover other devices; the first device receives a second message from one or more devices, and the second message is a response message to the first message; the first device is based on One or more second messages determine to establish a connection with a second device among the one or more devices; the first device and the second device negotiate link information for establishing direct communication between the first device and the second device, and establishes a direct communication connection with the second device based on the link information.
  • the first device may send a first message for discovering other nearby devices, and any device near the first device can feed back the second message to the first device after listening to the first message.
  • the first device selects a device capable of supporting the service to be performed by the first device according to the received one or more second messages, and establishes a communication connection with the selected device.
  • the connectable devices of the first device negotiate link information, and establish direct communication with the selected device based on the link information, thereby forming a distributed system. There is no need to assign specific roles to each device, so the roles of each device in the established distributed system are equal, and services will not be restricted due to role problems.
  • the second message includes service capability information, where the service capability information is used to indicate whether the device can support the service to be performed by the first device, and the first device determines based on one or more second messages
  • Two devices establish a connection, including:
  • the first device acquires the service capability information carried by the one or more second messages, and according to the acquired service capability information, determines from one or more devices that a device capable of supporting the service to be performed by the first device is the second device , and establish a connection with the second device. It can be understood that some of the multiple devices attached to the first device may not support the service to be performed by the first device, and it is obviously unnecessary if the first device establishes a connection with the device. Therefore, in this solution, the first device can determine in advance the devices that support the service to be performed by the first device among the devices near the first device, so as to reduce unnecessary connection processes.
  • the method further includes:
  • the first device sends a ranking priority (RP) of the first device, and the RP can be used to indicate the priority of the first device, which is used to determine the master device in the system, and the devices other than the master device in the system are A slave device; a first device receives respective RPs from one or more devices, and determines a master device based on the received one or more RPs.
  • RP ranking priority
  • the RP includes a first part and a second part, the first part is used to indicate the identity information of the first device, the second part is used to indicate the priority information of the first device, and the priority information includes the following information One or more of: the device level, the protocol version number of the device, or the number of devices connected to the device, where the device level includes one or more of the type of the device, the battery life of the device, and the hardware capability of the device.
  • the embodiment of the present application does not limit the specific implementation form of the priority information of the device, for example, it includes the above several types, which are relatively flexible.
  • Various priority information can ensure the accuracy of the determined master device as soon as possible.
  • the first device determines the master device based on the received one or more RPs according to a preset rule, and the preset rule satisfies:
  • the first device is the master device and the second device is the slave device;
  • the first device is the master device and the second device is the slave device;
  • the device type of the first device is the same as the device type of the second device, the battery life of the first device is the same as the battery life of the second device, and the hardware capability of the first device is higher than the hardware capability of the second device, the first device
  • the master device, the second device is the slave device;
  • the device type of the first device is the same as the device type of the second device
  • the battery life of the first device is the same as the battery life of the second device
  • the hardware capabilities of the first device are the same as the hardware capabilities of the second device
  • the protocol version is higher than the protocol version with the second device
  • the first device is the master device and the second device is the slave device;
  • the device type of the first device is the same as the device type of the second device
  • the battery life of the first device is the same as the battery life of the second device
  • the hardware capabilities of the first device are the same as the hardware capabilities of the second device
  • the The protocol version is the same as the protocol version of the second device
  • the number of devices connected to the first device is higher than the number of devices connected to the second device
  • the first device is the master device
  • the second device is the slave device
  • the device type of the first device is the same as the device type of the second device
  • the battery life of the first device is the same as the battery life of the second device
  • the hardware capabilities of the first device are the same as the hardware capabilities of the second device
  • the The protocol version is the same as the protocol version of the second device
  • the number of devices connected to the first device is the same as the number of devices connected to the second device
  • the MAC addresses are compared bit by bit, and the MAC address of the first device is higher than that of the second device.
  • the first device is the master device and the second device is the slave device.
  • each slave device may perform time synchronization with the master device for subsequent services.
  • Two synchronization modes namely active synchronization mode and passive synchronization mode, are shown below.
  • Passive synchronization mode that is, the master device actively informs the time, and the slave device synchronizes based on the time of the master device.
  • Active synchronization means that the slave device actively requests time synchronization.
  • the first device is a master device, and the method further includes: the first device periodically sends a time synchronization frame, where the time synchronization frame carries time information and basic information used for time synchronization of each slave device A service set identifier (basic service set identifier, BSSID), where the BSSID is used to indicate the identity information of the system where multiple devices are located.
  • BSSID basic service set identifier
  • the first device is a slave device, and the method further includes:
  • the first device broadcasts a time synchronization request message, and the time synchronization request message is used to request time synchronization with a device that completes time synchronization in the system where multiple devices are located; the first device receives a response message from the third device, and the response message carries The time information and time domain position of the third device, where the time domain position is used to indicate the time domain position of the exchange information in the process of mutual discovery of multiple devices; the first device completes time pre-synchronization according to the time information in the response information, And monitor the action signaling frame from the third device at the time domain position to complete the final synchronization.
  • active time synchronization does not need to wait for the master device to send a time synchronization frame, and can complete synchronization with the master device in advance, thereby reducing the synchronization delay.
  • an electronic device in a second aspect, includes a display screen, one or more processors, a memory, a transceiver, and one or more programs.
  • the one or more programs are stored in the memory, and the one or more programs include instructions that, when executed by the electronic device, cause the electronic device to perform the above-mentioned first aspect or A method provided by the first device in any possible implementation manner.
  • the transceiver is used to send a first message and receive a second message from one or more devices, the first message is used to discover other devices, and the second message is a response message to the first message;
  • Executing the instructions by the at least one processor causes the electronic device to perform: determining to establish a connection with a second one of the one or more devices based on the one or more second messages; and negotiating with the second device for Link information for direct communication is established between the electronic device and the second device, and a direct communication connection is established with the second device based on the link information.
  • the second message includes service capability information, where the service capability information is used to indicate whether the device can support a service to be performed by the electronic device, and the processor is specifically configured to: acquire one or more second The service capability information carried in the message respectively; according to the obtained service capability information, it is determined from one or more devices that the device capable of supporting the service to be performed by the electronic device is the second device, and it is determined to establish a connection with the second device.
  • the service capability information is used to indicate whether the device can support a service to be performed by the electronic device
  • the processor is specifically configured to: acquire one or more second The service capability information carried in the message respectively; according to the obtained service capability information, it is determined from one or more devices that the device capable of supporting the service to be performed by the electronic device is the second device, and it is determined to establish a connection with the second device.
  • the transceiver is also used for:
  • the RP can be used to indicate the priority of the electronic device, and used to determine the master device in the system where the electronic device is located, and the devices other than the master device in the system are slave devices;
  • Respective RPs from one or more devices are received, and a master device is determined based on the received one or more RPs.
  • the RP includes a first part and a second part, the first part is used to indicate the identity information of the electronic device, the second part is used to indicate the priority information of the electronic device, the
  • the priority information includes one or more of the following information:
  • the device class includes one or more of the type of the device, the battery life of the device, and the hardware capability of the device.
  • the processor is specifically configured to determine the master device based on the received one or more RPs according to a preset rule, and the preset rule satisfies:
  • the electronic device is the master device and the second device is the slave device;
  • the electronic device is the master device and the second device is the slave device;
  • the electronic device is the master device,
  • the second device is a slave device;
  • the device type of the electronic device is the same as the device type of the second device
  • the battery life of the electronic device is the same as the battery life of the second device
  • the hardware capability of the electronic device is the same as the hardware capability of the second device
  • the protocol version of the electronic device If the protocol version with the second device is higher than that of the second device, the electronic device is the master device and the second device is the slave device;
  • the device type of the electronic device is the same as that of the second device
  • the battery life of the electronic device is the same as the battery life of the second device
  • the hardware capability of the electronic device is the same as the hardware capability of the second device
  • the protocol version of the electronic device is the same as that of the second device.
  • the protocol versions of the two devices are the same, the number of devices connected to the electronic device is higher than the number of devices connected to the second device, the electronic device is the master device, and the second device is the slave device;
  • the device type of the electronic device is the same as that of the second device
  • the battery life of the electronic device is the same as the battery life of the second device
  • the hardware capability of the electronic device is the same as the hardware capability of the second device
  • the protocol version of the electronic device is the same as that of the second device.
  • the protocol versions of the two devices are the same, and the number of devices connected to the electronic device is the same as the number of devices connected to the second device. Then compare the MAC addresses bit by bit.
  • the MAC address of the electronic device is higher than the MAC address of the second device, and the electronic device is the master device.
  • the second device is a slave device.
  • the electronic device is the master device, and the transceiver is further used for:
  • a time synchronization frame is periodically sent, and the time synchronization frame carries time information used for time synchronization of each slave device and a BSSID, where the BSSID is used to indicate the identity information of the system where the multiple devices are located.
  • the electronic device is a slave device, and the transceiver is further used for:
  • the time synchronization request message is used to request time synchronization with a device that has completed time synchronization in the system where multiple devices are located;
  • the time pre-synchronization is completed according to the time information in the response information, and the action signaling frame from the third device is monitored at the time domain position to complete the final synchronization.
  • an electronic device comprising a module/unit for performing the method performed by the first device in the first aspect or any possible implementation manner.
  • a system in a fourth aspect, includes a first device, a second device, and a third device.
  • the system may also include other devices.
  • the devices included in the system can implement distributed services, such as multiple screen collaboration.
  • Each device may be implemented by the electronic device of the second aspect or the electronic device of the third aspect.
  • a chip in a fifth aspect, includes a processor and an interface, the interface is used for communicating with the processor and receiving information from other devices; the processor is used for executing the above-mentioned first aspect and the first aspect The method described in any of the possible implementations of .
  • a computer-readable storage medium is provided, the computer-readable storage medium is used to store a computer program, and when the computer program runs on a computer, the computer is made to execute one or more of the following methods : the method executed by the first device in the first aspect or any one of the possible implementation manners.
  • a seventh aspect provides a computer program product comprising instructions, the computer program product is used to store a computer program, and when the computer program is run on a computer, the computer is caused to perform one or more of the following methods: The method performed by the first device in the above-mentioned first aspect or any possible implementation manner.
  • Fig. 1 is a schematic diagram of a scenario in which distributed services are restricted due to the role of terminal equipment
  • FIG. 2 is a schematic diagram of another scenario in which distributed services are restricted due to the role of terminal equipment
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the architecture of a distributed system provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of establishing a connection between multiple devices according to an embodiment of the present application.
  • Fig. 6 is a kind of frame structure that bears the first part of the priority order value
  • FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the application (application, app) involved in this application is a software program that can realize one or more specific functions.
  • multiple applications may be installed in an electronic device.
  • camera application SMS application, MMS application, image application, various mailbox applications, WeChat (WeChat), Tencent chat software (QQ), WhatsApp Messenger, Line, photo sharing (instagram), Kakao Talk, or DingTalk etc.
  • the applications mentioned below can be applications that have been installed when the electronic device leaves the factory, or applications that are downloaded from the network or acquired from other electronic devices by the user during the use of the electronic device (for example, applications sent by other electronic devices) .
  • the information involved in the embodiments of the present application is, for example, an application, or a file, such as a multimedia file
  • the multimedia file includes, for example, an image file, a video file, or an audio file
  • the file may also include a text file, such as Microsoft (Microsoft) work ( office) files, such as word files, excel files, or powerpoint files, etc.
  • the files may also include image files corresponding to drawing applications, such as Microsoft office visio files or photoshop files.
  • “at least one” refers to one or more, and “multiple” refers to two or more.
  • “And/or”, describing the association relationship of associated objects, indicates that there can be three kinds of relationships, such as , A and/or B, can indicate: the existence of A alone, the existence of A and B at the same time, the existence of B alone, where A and B can be singular or plural.
  • the character “/” generally indicates that the associated object is a kind of "or ” relationship.
  • “At least one of the following items” or similar expressions refers to any combination of these items, including any combination of single item(s) or plural items(s).
  • a, b or c At least one item (a) of , can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
  • ordinal numbers such as “first” and “second” mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the size, content, order, and timing of multiple objects , priority or importance, etc.
  • the first device and the second device are only used to distinguish different files, but do not indicate the difference in size, content, priority, or importance of the two files.
  • a multi-screen collaboration function (or referred to as a multi-device collaboration function) is provided, thereby supporting applications and services of multi-device collaboration, such as multi-screen collaboration and information sharing.
  • device 1 can cast a screen to device 2, so that files on device 1 can be opened on device 2.
  • a mirror image of the mobile phone is displayed on the display screen of the PC, and the mirror image of the mobile phone displayed on the PC can also be understood as a screen-casting interface.
  • the user operates on the screen projection interface on the PC. For example, if the user chooses to open file A, the PC can open file A, but in fact file A is a file in the mobile phone. Compared with a mobile phone, a PC has a larger display screen area, and a user viewing the file on the PC can improve the user's viewing effect.
  • distributed services applications or services that rely on the collaborative work of multiple devices are collectively referred to as distributed services.
  • distributed services multiple terminal devices such as mobile phones, tablets, PCs, and display screens need to be connected together, that is, multi-device interconnection, so that distributed services can run collaboratively in multiple terminal devices.
  • WiFi P2P Wireless Fidelity Peer-to-Peer
  • the WiFi P2P protocol is a point-to-point connection technology that enables multiple WiFi devices to form a network without an access point (also known as an access point, AP). Multiple WiFi devices are able to communicate with each other.
  • the network may also be referred to as a P2P Network, or a P2P group.
  • the general principle of the WiFi P2P protocol is that a Transmission Control Protocol (TCP)/Internet Protocol (IP) link can be established directly between two workstations (also known as stations) (Station, STA).
  • TCP Transmission Control Protocol
  • IP Internet Protocol
  • One of the two STAs can be regarded as an AP in the traditional sense, and is called a group owner (GO). Relatively speaking, the other STA of the two STAs can be called a group.
  • User group client, GC
  • GC group client
  • a GO in a P2P Network or a P2P Group can correspond to one GC, or can correspond to multiple GCs, that is, there can be a one-to-one relationship or a one-to-many relationship between the GO and the GC.
  • the WiFi P2P protocol is developed based on the 802.11 protocol framework and belongs to a centralized network communication structure. That is, WiFi P2P requires that each terminal device must be configured with a role, such as GO or GC. As a central node, GO can communicate with any GC node connected to the GO, but cannot communicate with each other between GO and GO, and between GC and GC. However, distributed services may exist in any two devices among multiple interconnected devices, such as between one GC and another GC. Obviously, the multi-device interconnection based on the WiFi P2P protocol limits the practical application requirements of distributed services.
  • FIG. 1 shows a scenario in which distributed services are restricted due to the role of terminal devices.
  • FIG. 1 includes three terminal devices, which are respectively a terminal device 101 , a terminal device 102 and a terminal device 103 located in a network.
  • the terminal device 101 and the terminal device 102 are mobile phones
  • the terminal device 103 is a PAD as an example.
  • the terminal device 103 is a GO, and the terminal device 101 and the terminal device 102 are both GCs.
  • the terminal device 103 can perform a collaborative service with the terminal device 101 , and can also perform a collaborative service with the terminal device 102 . For example, as shown in FIG.
  • the terminal device 103 and the terminal device 102 can perform screen projection services. If the business that needs to be coordinated exists in any two GCs in multiple interconnected settings, since the GC and the GC cannot communicate with each other, it is obvious that the coordinated business cannot be performed. For example, as shown in FIG. 1, it is necessary to realize information sharing between the terminal device 101 and the terminal device 102, but since the terminal device 101 and the terminal device 102 are both GCs, the roles played by the terminal device 102 and the terminal device 101 are limited. The connection between the terminal device 102 and the terminal device 103 needs to be disconnected.
  • FIG. 1 takes the terminal device 101 as the GO and the terminal device 102 as the GC as an example. That is to say, the role of a device can change as the chain is established. For example, after the initial chain establishment of the terminal device 101, the role of the terminal device 101 is GC, and after the chain is re-established, the role of the terminal device 101 is GO.
  • FIG. 2 shows another scenario in which distributed services are restricted due to the role of the terminal device.
  • FIG. 2 includes four terminal devices, which are respectively a terminal device 101 and a terminal device 102 located in a network, and a display 103 and a display 104 .
  • FIG. 2 takes as an example that the terminal device 101 and the terminal device 102 are mobile phones.
  • the terminal device 101 and the terminal device 102 can work in a computer mode, which is more convenient.
  • the terminal device 101 can project the screen to the display 103
  • the terminal device 102 can project the screen to the display 104 .
  • the roles played by the terminal device 101 and the terminal device 102 are GO
  • the roles played by the display 103 and the display 104 are GC.
  • the terminal device 101 and the terminal device 102 need to share information, since the terminal device 101 and the terminal device 102 are both GO, the terminal device 101 and the terminal device 102 cannot share information with each other. That is, due to the conflict of P2P roles, the connection between the terminal device 101 and the terminal device 102 cannot be established to complete the file transmission. To this end, the terminal device 101 needs to disconnect from the display 103 , the terminal device 102 disconnects from the display 104 , and the terminal device 101 and the terminal device 102 reconnect. For example, after the terminal device 101 and the terminal device 102 establish a connection, the terminal device 101 acts as a GO, and the terminal device 102 acts as a GC, then the terminal device 101 and the terminal device 102 can share information.
  • the multi-device interconnection based on the WiFi P2P protocol limits the practical application requirements of distributed services due to the role of chain building.
  • the embodiments of the present application provide a new method for interconnecting multiple devices. Based on this method, the roles of multiple interconnected devices can be equalized, and distributed services will not be restricted due to the roles of each device.
  • the electronic device may be a portable electronic device, such as a mobile phone, a PAD, a portable computer, a wearable device with a wireless communication function (such as a smart watch, smart glasses, smart bracelet, or smart helmet, etc.), or in-vehicle equipment, etc.
  • portable electronic devices include, but are not limited to, carry-on Or portable electronic devices with other operating systems.
  • the above-mentioned electronic device may not be a portable device, for example, a desktop computer, such as a PC, or a television, or a display device or the like.
  • FIG. 3 shows a schematic structural diagram of an electronic device 300 .
  • the illustrated electronic device 300 is only an example, and that the electronic device 300 may have more or fewer components than those shown, two or more components may be combined, or may have different Parts configuration.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the electronic device 300 may include a processor 310 , an external memory interface 320 , an internal memory 321 , a universal serial bus (USB) interface 330 , a charge management module 340 , a power management module 341 , and a battery 342 , Antenna 1, Antenna 2, Mobile Communication Module 350, Wireless Communication Module 360, Audio Module 370, Speaker 370A, Receiver 370B, Microphone 370C, Headphone Interface 370D, Sensor Module 380, Key 390, Motor 391, Indicator 392, Camera 393 , display screen 394, and subscriber identification module (subscriber identification module, SIM) card interface 395 and so on.
  • a processor 310 an external memory interface 320 , an internal memory 321 , a universal serial bus (USB) interface 330 , a charge management module 340 , a power management module 341 , and a battery 342 , Antenna 1, Antenna 2, Mobile Communication Module 350, Wireless Communication Module 360, Audio Module 370, Speaker
  • the sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, and ambient light.
  • the processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 300 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 310 for storing instructions and data.
  • the memory in processor 310 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 310 . If the processor 310 needs to use the instruction or data again, it can be directly called from the memory, so that repeated access can be avoided, the waiting time of the processor 310 can be reduced, and the efficiency of the system can be improved.
  • the processor 310 may execute the information sharing method provided by the embodiments of the present application.
  • the embodiment of the present application provides a fast collaborative operation service (Fast Collaborative Service).
  • the collaborative fast operation service may be a software module, the software module may run on the processor 310, and the software module may be understood as a computer program.
  • the software module can provide system-level capabilities. Taking the Android system as an example, from a business perspective, the software module can be placed in the system service (system_server) process, and the activity manager service in the system_server process (activity manager service, Modules such as AMS), package manager service (PMS), or window manager service (window manager service) jointly build the basic capabilities of the platform.
  • system_server system service
  • the activity manager service in the system_server process activity manager service, Modules such as AMS), package manager service (PMS), or window manager service (window manager service) jointly build the basic capabilities of the platform.
  • the collaborative shortcut operation service can also be placed in other processes.
  • the processor 310 integrates different devices, such as integrating a CPU and a GPU
  • the CPU and the GPU can cooperate to execute the methods provided by the embodiments of the present application.
  • some algorithms are executed by the CPU, and another part of the algorithms are executed by the GPU Execute for faster processing efficiency.
  • processor 310 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver ( universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface , and/or Universal Serial Bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the USB interface 330 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 330 can be used to connect a charger to charge the electronic device 300, and can also be used to transmit data between the electronic device 300 and peripheral devices.
  • the charging management module 340 is used to receive charging input from the charger.
  • the power management module 341 is used to connect the battery 342 , the charging management module 340 and the processor 310 .
  • the power management module 341 receives input from the battery 342 and/or the charging management module 340, and supplies power to the processor 310, the internal memory 321, the external memory, the display screen 394, the camera 393, and the wireless communication module 360.
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • processor 310 may contain multiple sets of I2C buses.
  • the processor 310 can be respectively coupled to the touch sensor 380K, the charger, the flash, the camera 393 and the like through different I2C bus interfaces.
  • the processor 310 can couple the touch sensor 380K through the I2C interface, so that the processor 310 and the touch sensor 380K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 300 .
  • a mobile industry processor interface (mobile industry processor interface, MIPI) interface can be used to connect the processor 310 with peripheral devices such as the display screen 394 and the camera 393 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 310 communicates with the camera 393 through a CSI interface, so as to implement the photographing function of the electronic device 300 .
  • the processor 310 communicates with the display screen 394 through the DSI interface to implement the display function of the electronic device 300 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 310 with the camera 393, the display screen 394, the wireless communication module 360, the audio module 370, the sensor module 380, and the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the wireless communication function of the electronic device 300 can be implemented by the antenna 1, the antenna 2, the mobile communication module 350, the wireless communication module 360, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 300 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 350 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 300 .
  • the mobile communication module 350 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 350 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave and radiate it out through the antenna 1.
  • at least part of the functional modules of the mobile communication module 350 may be provided in the processor 310 .
  • at least part of the functional modules of the mobile communication module 350 may be provided in the same device as at least part of the modules of the processor 310 .
  • the wireless communication module 360 can provide applications on the electronic device 300 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 360 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 360 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310 .
  • the wireless communication module 360 can also receive the signal to be sent from the processor 310 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
  • the antenna 1 of the electronic device 300 is coupled with the mobile communication module 350, and the antenna 2 is coupled with the wireless communication module 360, so that the electronic device 300 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 300 .
  • the electronic device 300 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the electronic device 300 implements a display function through a GPU, a display screen 394, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 394 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 310 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 394 is used to display images, videos, and the like.
  • Display screen 394 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 300 can realize the shooting function, or realize the function of capturing images, through the ISP, the camera 393, the video codec, the GPU, the display screen 394, and the application processor.
  • the ISP is used to process the data fed back by the camera 393 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 393 .
  • Camera 393 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 300 may include 1 or N cameras 393 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 300 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 300 may support one or more video codecs.
  • the electronic device 300 can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • MPEG2 moving picture experts group
  • MPEG3 MPEG4
  • MPEG4 moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 300 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • Internal memory 321 may be used to store computer executable program code, which includes instructions.
  • the internal memory 321 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 300 and the like.
  • the internal memory 321 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 310 executes various functional applications and data processing of the electronic device 300 by executing instructions stored in the internal memory 321 and/or instructions stored in a memory provided in the processor.
  • the external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device.
  • the external memory card communicates with the processor 310 through the external memory interface 320 to realize the data storage function. Such as saving pictures, videos and other files in an external memory card.
  • the electronic device 300 may implement audio functions through an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, and an application processor. Such as music playback, recording, etc.
  • the keys 390 include a power-on key, a volume key, and the like. Keys 390 may be mechanical keys. It can also be a touch key.
  • the electronic device 300 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 300 .
  • Motor 391 can generate vibrating cues.
  • the motor 391 can be used for incoming call vibration alerts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects.
  • the touch vibration feedback effect can also support customization.
  • the indicator 392 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 395 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 300 by inserting into the SIM card interface 395 or pulling out from the SIM card interface 395 .
  • the components shown in FIG. 3 do not constitute a specific limitation on the electronic device 300, and the mobile phone may also include more or less components than those shown in the figure, or combine some components, or separate some components, Or a different component arrangement.
  • the combination/connection relationship between the components in FIG. 3 can also be adjusted and modified.
  • the embodiments of the present application provide multiple devices, and the multiple devices may be the same device, such as the electronic device 300; or, the multiple devices may also be different devices, for example, some of the multiple devices are electronic devices 300, some devices are monitors.
  • the embodiments of the present application do not limit the implementation form of the multiple devices.
  • the multiple devices may all be electronic devices, or the multiple devices may also be chips in the electronic devices, or some of the multiple devices. It is an electronic device, and some devices are chips in electronic devices.
  • the embodiments of the present application also provide a distributed system correspondingly.
  • the distributed system may include at least two devices among multiple devices.
  • the distributed system may also include other devices. Multi-screen collaboration and information sharing can be performed between any devices in the distributed system.
  • FIG. 4 is a schematic diagram of a distributed system.
  • FIG. 4 takes the distributed system including 5 devices as an example, it should be understood that these 5 devices are in the same network.
  • the five devices are Device 1, Device 2, Device 3, Device 4, and Device 5, respectively.
  • Device 1, device 2, device 3, device 4, and device 5 can perform multi-screen collaboration or information sharing, etc.
  • device 1 can perform multi-screen collaboration or information sharing with device 2 or device 3, device 2 and device 4 can perform multi-screen collaboration, and device 3 and device 5 can perform information sharing.
  • device 1 is a mobile phone
  • device 2 is a portable computer
  • device 3 is a tablet computer
  • device 4 is a personal computer
  • device 5 is a smart speaker.
  • the structure of a mobile phone is, for example, the structure shown in FIG. 3
  • a portable computer, a tablet computer, a personal computer, and a smart speaker may include more or less components than the structure shown in FIG. 3 .
  • a connection needs to be established before a distributed service is performed between device 1, device 2, device 3, device 4, and device 5, such as multi-screen collaboration or information sharing. That is, before any device needs to perform multi-screen collaboration or information sharing, it can be connected with other possible devices, that is, multi-device interconnection.
  • the roles of multiple interconnected devices are equal, and the distributed services are not restricted due to the roles of each device.
  • FIG. 5 a flow of establishing a connection for multiple devices provided by an embodiment of the present application is shown.
  • the method is applied to the network architecture shown in FIG. 4 as an example. It should be understood that the method involves multiple devices, such as each of the devices in FIG. 4 .
  • this method involves a first device and multiple devices.
  • the first device may be a device that needs to perform distributed services, and the multiple devices include, for example, a second device, a third device, or even a fourth device. equipment, etc.
  • the first device needs to perform a distributed service device, it needs to establish a connection with one or more devices around the first device, that is, to form a network, so as to cooperate with one or more devices in the network to perform a distributed service.
  • the first device is the mobile phone in FIG. 4.
  • the mobile phone needs multi-screen collaboration, it can request to establish a connection with the personal computer and/or tablet computer in FIG. 4, so that the mobile phone and the personal computer can perform multi-screen collaboration services.
  • the first device may be any device in FIG. 4 , and the multiple devices may also be any device in FIG. 4 . Because for any device, before the distributed service needs to be performed, the process of establishing a connection with other devices is similar. Therefore, in the following introduction process, the connection between the first device and the second device is used as an example. It should be understood that the process of establishing a connection between the second device and the first device is similar.
  • the first device broadcasts a first message, where the first message is used to discover one or more devices.
  • the first device is a mobile phone
  • the file needs to be shared with another device, such as a PC.
  • the mobile phone can cast the screen to the PC, so that the files on the mobile phone can be opened on the PC.
  • a mobile phone and a PC perform multi-screen collaboration
  • a mirror image of the mobile phone is displayed on the display screen of the PC, and the mirror image of the mobile phone displayed on the PC can also be understood as a screen-casting interface.
  • the user operates on the screen projection interface on the PC.
  • file A is a file in the mobile phone.
  • a PC has a larger display screen area, and a user viewing the file on the PC can improve the user's viewing effect.
  • the first device performs the distributed service, it needs to establish a connection with one or more devices, that is, to form a network, so as to cooperate with one or more devices in the network to perform the distributed service.
  • the first device needs to perform a screen projection service with other devices.
  • the first device may search for one or more devices near the first device. For example, the first device may broadcast a first message for discovering one or more devices. Any device attached to the first device, such as the second device, receives the first message and can respond to the first message to inform the first device of the existence of the second device. Subsequently, the first device establishes a connection with the second device. For another example, the third device attached to the first device receives the first message and can respond to the first message to inform the first device that the third device exists. Subsequently, the first device establishes a connection with the third device. Of course, before the second device performs a service, such as a screen projection service or a file sharing service, the second device may also search for one or more devices attached to the second device, and establish a connection with the found device.
  • a service such as a screen projection service or a file sharing service
  • the embodiment of the present application does not limit the specific name of the first message, for example, the first message may also be called a discovery message, a probe message, or a device discovery message. This embodiment of the present application does not limit the specific implementation manner of the first message.
  • the first message may be generated based on a WiFi protocol, that is, devices discover each other based on WiFi scanning.
  • This approach can be applied to devices without Bluetooth and insensitive to power consumption, such as routers and Internet of Things (IoT) devices.
  • the first device may allocate some discovery windows (Discovery Window, DW), and the first device may broadcast the first message on the DW. Any device (eg, N devices) near the first device can monitor the first message.
  • the second device if the second device receives the first message, it may send a response message for the first message to the first device to inform the first device of the existence of the second device.
  • the first message may be generated based on a Bluetooth communication protocol, that is, devices discover each other through Bluetooth scanning.
  • the first device broadcasts the first message, and any devices (eg, N devices) near the first device can monitor the first message.
  • the second device if the second device receives the first message, it may send a response message for the first message to the first device to inform the first device of the existence of the second device.
  • the first message may be related information of the first device, and is used to authenticate the first device.
  • the relevant information of the first device may include the device identity (ID), IP address of the first device, identity information of the first device, such as the ID of the manufacturer of the first device, the MAC address of the first device, and the first device's ID.
  • the first message may also include information about the service performed by the first device, for example, the service type, that is, the screen projection type, for devices near the first device to know that the service to be performed by the first device is the screen projection service.
  • the following describes a process in which the first device discovers the second device based on Bluetooth scanning, and establishes a connection with the second device.
  • the second device sends a second message to the first device, and correspondingly, the first device receives the second message, where the second message is a response message to the first message.
  • Any device near the first device can monitor the first message.
  • the second device if the second device receives the first message, it may send a second message to the first device to inform the first device of the existence of the second device.
  • the third device if the third device receives the first message, it can send a second message to the first device to inform the first device of the existence of the third device.
  • the embodiment of the present application does not limit the specific name of the second message.
  • the second message may also be called a discovery response message, a probe response message, or a device discovery response message.
  • the second device may authenticate the first device according to the first information carried in the first message.
  • the second device may authenticate the first device based on manual authentication. That is, after receiving the first message, the second device may output a prompt interface, where the prompt interface is used to display the authentication information of the first device, such as the device name and the like. The user can input the authentication information of the first device on the prompt interface to complete the authentication of the first device.
  • the second device may authenticate the first device based on automatic authentication.
  • the second device can obtain the identity information of the first device carried in the first message, such as the ID of the manufacturer of the first device, determine whether the identity information is in the trusted list, and complete the authentication of the first device.
  • a trusted list can be thought of as a list of manufacturer IDs of devices that are allowed to connect.
  • the second device After the second device successfully authenticates the first device, it sends a second message to the first device. It should be understood that if the first message is generated based on the Bluetooth protocol, the second message is sent to the first device through a Bluetooth broadcast channel.
  • the second message may carry second information, and the second information may be used to determine whether the second device can support the distributed service to be performed by the first device.
  • the second information includes service capability information of the second device.
  • the service capability information includes a service type list, where the service type list is used to indicate multiple services supported by the second device.
  • the service capability information may also include one or more of Wi-Fi encryption type, channel information, MAC address information, protocol version information, and multiple input multiple output (multi input multiple output, MIMO) information of the device.
  • the second message also includes the device ID and IP address of the second device, and the like.
  • the first device may determine whether to establish a connection with the second device according to the second information. If the second information indicates that the service capability of the second device can support the distributed service to be performed by the first device, then the first device chooses to establish a connection with the second device; on the contrary, if the second information indicates that the service capability of the second device cannot support For the distributed service to be performed by the first device, the first device may choose not to establish a connection with the second device.
  • the second message is a response message to the first message, and the specific implementation of the second message varies with the first message.
  • the first message may include related information of the first device, in this case, the first message is used to discover multiple devices in the vicinity of the first device.
  • a device near the first device for example, the second message sent by the second device to the first device may include service capability information, such as multiple service types supported by the second device.
  • the first device may determine, according to multiple services supported by the second message, whether the second device supports the screen casting service of the first device.
  • the first message may include related information of the first device and service information, such as screen projection type.
  • the first message may be used to discover devices that support the screen casting service near the first device.
  • a device near the first device for example, the second message sent by the second device to the first device may also include service capability information, such as multiple service types supported by the second device.
  • the first device may determine whether the second device supports the screen casting service according to multiple services supported by the second message.
  • a device among the multiple devices that supports the screencasting service for example, the second device sends a second message to the first device, where the second message includes the information of the second device.
  • Related information and service types supported by the second device such as screen projection types.
  • the first device may determine that the second device corresponding to the second message supports the screen casting service. Alternatively, after multiple devices near the first device receive the first message, the multiple devices respectively send the second message to the first device.
  • the second message sent by the device that supports the screencasting service is used to indicate that the device supports the screencasting service to be performed by the first device, and the second message sent by the device that does not support the screencasting service is used to indicate that the device does not support the screencasting service.
  • the screen projection service to be performed by the first device is simple and direct.
  • the devices that support the screencasting service among the multiple devices send the second message to the first device, and the devices that do not support the screencasting service may not send the first message to the first device.
  • the first device can support the screen casting service with the device of the second message by default.
  • the second message may be a timing notification frame (PNF). That is, after receiving the first message, a device near the first device (for example, the second device) sends the PNF to the first device.
  • the PNF may carry relevant information of the second device and service capability information. Or the PNF is used to indicate whether the second device supports the screen projection service.
  • the first device may receive second messages respectively sent by multiple devices (for example, the second device and the Nth device) for the first message, and the first device may determine, according to the multiple second messages received, that it can One or more devices supporting the distributed service to be performed by the first device.
  • the second device can support the distributed service to be performed by the first device.
  • the third device After the third device successfully authenticates the first device, it sends the second message to the first device. The first device may determine whether to establish a connection with the third device according to the second information in the second message.
  • the first device determines to establish a connection with one or more devices according to the received one or more second messages.
  • the first device may determine, according to the second information carried in the second message from each device, which device or devices among the devices support the distributed service to be performed by the first device. After the first device determines one or more devices that support the distributed service to be performed by the first device, it establishes a connection with the one or more devices.
  • the first device can establish a Socket to send a Bluetooth connection request (or referred to as a Bluetooth message) to the second device through the Socket to request to establish a Bluetooth connection with the second device. communication connection.
  • the second device monitors the first message, and also establishes a Socket, through which the Bluetooth connection request from the first device can be monitored. If the second device monitors the Bluetooth connection request from the mobile phone, the second device establishes a Bluetooth communication connection with the first device in response to the Bluetooth connection request of the first device.
  • the process of establishing a connection between the first device and the third device is similar to the process of establishing a connection between the first device and the second device, and details are not repeated here.
  • the first device and one or more devices negotiate link information, where the link information is used for establishing a WiFi direct communication process between one or more devices and the first device.
  • the first device and the second device may negotiate with each other some information for establishing WiFi direct communication between the first device and the second device, for example, including channel information, link establishment Type and pre-shared key (PSK).
  • the first device sends channel information, link establishment type, and PSK to the second device through a Bluetooth channel with the second device, so that the second device establishes WiFi direct communication with the first device according to the information.
  • the device supporting the distributed service to be performed by the first device also includes a third device
  • the first device and the third device can also communicate with some parts of the WiFi direct connection. information, so that the third device establishes WiFi direct communication with the first device according to the information.
  • any device near the first device that monitors the first message from the first device can feed back a response message for the first message, that is, the second message, to the first device.
  • the first device selects one or more devices capable of supporting the distributed application to be performed by the first device according to the received one or more second messages, and establishes a Bluetooth connection with the one or more devices. After that, the first device and each device can negotiate link information, and establish WiFi direct communication with each device, thereby forming a distributed system.
  • the aforementioned first device is a device that needs to perform a screen projection service.
  • the first device broadcasts a first message to send a device near the first device that supports the screen projection service, such as a second device. If the second device supports the screen projection service, the first device establishes a connection with the second device. It should be understood that, if the second device wants to perform the file sharing service, the second device will also broadcast the first message to discover devices near the second device that support the file sharing service. If the file sharing service devices supported near the second device include the first device, the second device establishes a connection with the first device. Of course, if the first device has established a connection with the second device, it is used to implement the screen projection service. After the second device performs the file sharing service and finds that the first device supports the file sharing service, the second device and the first device can directly perform the file sharing service without re-establishing a connection with the first device.
  • the process shown in FIG. 5 is taken as an example that the first device is a device that needs to perform distributed services. If the second device is a device that needs to perform distributed services, the second device implements networking with the first device and other multiple devices according to the process shown in FIG. 5 . Similarly, if the third device is a device that needs to perform distributed services, the second device implements networking with the first device, the second device, and other devices according to the process shown in FIG. 5 . That is, in the embodiment of the present application, each device establishes a communication channel based on inter-device discovery, and then negotiates link information for establishing WiFi direct communication between devices through the communication channel established between devices.
  • the method for establishing a connection for multiple devices will not limit distributed services due to the role problem.
  • the first device, the second device and the third device are interconnected based on the WiFi P2P protocol, wherein only one device among the first device, the second device and the third device is GO, and the other two devices are GC.
  • the first device can cast the screen to the second device, but at the same time, the second device cannot share information to the third device.
  • the first device, the second device, and the third device are interconnected with the method provided in the embodiment of the present application. The roles of the first device, the second device, and the third device are equal.
  • the first device can cast a screen to the second device, and files can be shared between the second device and the third device.
  • devices establish WiFi direct communication with each other based on Bluetooth discovery, and can broadcast a first message based on Bluetooth when other devices need to be discovered.
  • a first message based on Bluetooth when other devices need to be discovered.
  • the device usually turns on the screen. Therefore, establishing WiFi direct communication between devices based on Bluetooth discovery can also reduce the power consumption of each device.
  • the first device after the first device is networked with multiple devices, it can cooperate with any device in the network to distribute applications. This requires time synchronization among various devices in the distributed system. Therefore, after multiple devices establish WiFi direct communication, time synchronization is required. Since the roles of each device in the distributed system established in the embodiment of the present application are equal, before time synchronization is performed, one device may be selected from multiple devices in the distributed system as the master device, and the time of the master device is to synchronize the time of other devices. Relative to the master device, other devices in the distributed system can be considered as slave devices, and the slave devices can be synchronized according to the time of the master device.
  • multiple devices in the distributed system may be prioritized, and the device with the highest priority may be used as the master device. If the set of all devices in the distributed system is called a domain, the device with the highest priority in the domain is the master device. This embodiment of the present application does not limit the manner of determining the priority.
  • the device priority may be determined according to one or more of the device type of each device, the battery life of the device, the hardware capability of the device, the protocol version adopted by the device, the number of devices connected to the device, and the MAC address of the device. class.
  • the type of the device is, for example, a display, a PC, a tablet, a mobile phone, an IOT device, a smart speaker, or a wearable device.
  • the battery life of the device for example, is the remaining battery level of the device, such as high battery, medium battery, medium-low battery, and low battery. It should be noted that the embodiment of this application does not limit the number of levels of the remaining power level, and each remaining power level can be defined in advance.
  • the remaining power level is greater than or equal to 70% of the total power level, then the level of the remaining power level is high power; If the power is greater than or equal to 50% of the total power and less than 70% of the total power, the remaining power level is medium power; the remaining power is greater than or equal to 30% of the total power and less than 50% of the total power, then the remaining power The power level is medium and low power; the remaining power is less than 30% of the total power, then the remaining power level is low power.
  • the hardware capability of the device for example, the device uses dual WiFi chips or a single WiFi chip.
  • the type of the device, the endurance capability of the device, and the hardware capability of the device are only examples, and the embodiments of the present application do not limit the specific representation of the type of the device, the endurance capability of the device, and the hardware capability of the device.
  • Each device can report its own priority information, for example, each device can report its own priority ranking (ranking priority, RP) value, and the RP value can be used to indicate the priority information of each device.
  • the RP value may be carried in the first message.
  • the RP value may be carried in the synchronization beacon frame sent by each device.
  • the RP value may occupy one field, or may occupy multiple fields, which is not limited in this embodiment of the present application. For example, each content indicated by the RP value may occupy different bits of the same field respectively; or each content indicated by the RP value may occupy different fields respectively.
  • the RP value may include two parts, one part is used to indicate the ranking level (ranking level), and the other part is used to indicate the MAC address of the device, wherein the ranking level may include the device level, the protocol version number of the device, and the connected device. number of devices.
  • the device level further includes the type of the device, the battery life of the device, and the hardware capability of the device.
  • the sorting level field includes three fields, and the three fields are a device level field, a protocol version number field, and a connection number field. It should be noted that the embodiments of the present application do not limit the specific names of the three fields. This embodiment of the present application does not limit the number of bits occupied by each field. Exemplarily, see Table 1 for the definition of the equipment level field.
  • the priority information of each device such as device type, device endurance, device hardware capability, protocol version adopted by the device, number of devices connected to the device, and MAC address of the device may be used.
  • the priority of the address to determine the priority of the device. Since each device determines the priority of each device based on the PR values of all devices in the system, the priorities of all devices determined by each device in the system are consistent. In some embodiments, the priority of each device may be determined according to the device type of each device. If it is determined that the priority of each device is consistent according to the device type of each device, the priority of the device may be further determined according to the battery life of the device, And so on, until the priority of each device is determined.
  • the slave devices can synchronize based on the time of the master device, including but not limited to the following two ways.
  • Synchronization method 1 Passive time synchronization, that is, the master device actively informs the time, and the slave device synchronizes based on the time of the master device.
  • the master device may periodically send time synchronization frames, which may carry time information for time synchronization.
  • the time synchronization frame may be an 802.11 Beacon frame, which carries the time information of a timer synchronization function (timer synchronization function, TSF) and the BSSID of the distributed system.
  • TSF timer synchronization function
  • the BSSID is used to distinguish different networks. Since the 802.11Beacon frame is used as the time synchronization frame, the TSF of the 802.11Beacon frame can be used, so that the hardware clock synchronization with an error level of 10us can be realized, and the synchronization time between devices can be shortened as much as possible.
  • Any slave device receives a time synchronization frame from the master device, and can obtain the BSSID carried by the time synchronization frame. If the acquired BSSID is the same as its own BSSID, it can be considered that the time synchronization frame is sent by a master device located in a network, and synchronization with the master device can be realized according to the time synchronization frame. For example, if the slave device determines that the acquired BSSID is the same as its own BSSID, the TSF counter can be refreshed, thereby realizing time synchronization with the master device.
  • the second synchronization method is active time synchronization, that is, the slave device actively applies for time synchronization.
  • the slave device actively applies for time synchronization, and does not need to wait for the master device to send a time synchronization frame, and can complete synchronization with the master device in advance, thereby reducing the synchronization delay.
  • the slave device to apply for time synchronization is the first slave device.
  • the first slave device can actively broadcast a time synchronization request message, such as a sync_request action signaling frame, to request synchronization time from devices in the same network that have completed time synchronization.
  • the master device or other slave devices may send a response message to the time synchronization request message, such as a sync_response action signaling frame, to the first slave device.
  • the response message may carry the TSF time information of the device and the time domain (social slot) position of the sending information.
  • the social slot position can be considered as the time slot position where all devices in the near field interact when they discover each other, and are used to discover each device in the near field.
  • the first slave device After receiving the response message, the first slave device can complete the time pre-synchronization according to the TSF time information carried in the response message, that is, align with the TSF time information of the master device. At this time, the first slave device may not yet discover other slave devices in the network. It should be understood that each device maintains the TSF time information based on a local timer, but there is a delay in sending the information by the device. Therefore, the first slave device can also monitor the action signaling frame from the master device or other slave devices in the social slot, so as to complete the final synchronization according to the time information carried in the action signaling frame.
  • the flow shown in Figure 5 above shows the process of establishing a connection for multiple devices for the first time.
  • multiple devices have been interconnected, that is, the multiple devices have completed networking.
  • the first device, the second device and the third device have established connections and are located in the same network.
  • a fourth device exists in the near field of the first device, the second device and the third device, and the fourth device has distributed services that need to be performed.
  • the fourth device executes the process shown in FIG. 5 to establish connections with the first device, the second device, and the third device.
  • the fourth device broadcasts the first message, and any device among the first device, the second device, and the third device receives the first message, and sends the second message to the fourth device. If the first device, the second device and the third device all receive the first message, then the first device, the second device and the third device respectively send the second message to the fourth device.
  • the fourth device may determine which devices support the distributed service to be performed by the fourth device according to the second message from the first device, the second device and the third device. If the first device, the second device, and the third device all support the distributed service to be performed by the fourth device, the fourth device may request to establish a connection with the first device, the second device, or the third device, and enter the first device, the second device, or the third device.
  • the fourth device receives a time synchronization frame periodically sent from the master device, and may perform time synchronization according to the time synchronization frame, that is, the fourth device may passively synchronize time.
  • the fourth device may also broadcast a time synchronization request message, that is, the fourth device may also actively synchronize time.
  • the embodiments of the present application further provide an electronic device, for example, a mobile phone, or a PAD, or a portable computer, or a smart speaker.
  • the electronic device may include: a display screen 701; one or more processors 702; one or more memories 703 for storing one or more programs 704; A communication bus 705 is connected.
  • the display screen 701 can be used to display the content of a file in the electronic device; or the display screen 701 can also be used to display the desktop of the electronic device; or the display screen 701 can be used to display an image and so on.
  • the electronic device when one or more programs 704 stored in the memory 703 are executed by one or more processors 702 , the electronic device can be used to execute various steps in the embodiment shown in FIG. 5 or other corresponding embodiments.
  • each functional unit in this embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the first acquisition unit and the second acquisition unit may be the same unit or different units.
  • the above-mentioned integrated unit can be implemented in the form of hardware, can also be implemented in the form of software functional units, or can be implemented in the form of hardware combined with software functional units.
  • the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting" depending on the context.
  • the phrases “in determining" or “if detecting (the stated condition or event)” can be interpreted to mean “if determining" or “in response to determining" or “on detecting (the stated condition or event)” or “in response to the detection of (the stated condition or event)”.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a program product.
  • the program product includes one or more computer instructions. When the program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请公开一种多设备建立连接的方法及设备,该方法包括:第一设备发送第一消息,该第一消息用于发现其他设备;第一设备接收来自一个或多个设备的第二消息,该第二消息为针对第一消息的响应消息;第一设备基于一个或多个第二消息确定与一个或多个设备中的第二设备建立连接;第一设备和第二设备协商用于第一设备和第二设备之间建立直连通信的链路信息,并基于该链路信息与第二设备建立直连通信连接。由于设备间基于发现建立通信连接之后,再协商链路信息,并基于该链路信息建立直连通信,形成系统。这样无需为各个设备分配具体的角色,所以所建立的分布式系统中各个设备的角色对等,不会因角色问题而使得业务受限。

Description

一种多设备建立连接的方法及设备
相关申请的交叉引用
本申请要求在2021年04月30日提交国家知识产权局、申请号为202110478504.4、申请名称为“一种多设备建立连接的方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种多设备建立连接的方法及设备。
背景技术
随着智能终端的发展,一个用户拥有多个智能终端的场景越来越多,例如智能手机、平板电脑,或个人计算机等设备。多设备之间的互联互通给用户带来了较好的体验。为了提高用户的体验,提供了多屏协同功能(或者,称为多设备协同功能),从而可支持多设备协同工作的应用与业务,例如多屏协同、信息共享等。应理解,多设备协同工作需要将手机、平板、PC、显示屏等多个终端设备连接在一起,即多设备互联,从而使业务数据在多个终端设备之间传输。
目前多设备互联之间的数据传输基于WiFi P2P协议,然而WiFi P2P协议基于802.11协议框架开发,属于一种中心式的网络通信结构。也就是,WiFi P2P要求每个终端设备都必须配置一个角色,例如可以是群组拥有者(group owner,GO)或者群组用户(group client,GC)。GO作为中心节点,能够与该GO连接的任意GC节点进行通信,但是GO和GO之间、GC与GC之间不能相互通信。然而,需要协同的业务可能存在于互联的多个设备中任意两个设备,例如一个GC与另一个GC之间,显然基于WiFi P2P协议实现的多设备互联限制了分布式业务的实际应用需求。
发明内容
本申请提供一种多设备建立连接的方法及设备,使得互联的多个设备之间角色对等,不会因各个设备的角色造成对分布式业务的限制。
第一方面,提供了一种多设备建立连接的方法,该方法用于多个设备中的任意设备,这多个设备建立连接形成系统,例如多个设备包括第一设备、第二设备以及更多的设备。下面以该方法由第一设备执行为例。该方法包括:
第一设备发送第一消息,该第一消息用于发现其他设备;第一设备接收来自一个或多个设备的第二消息,该第二消息为针对第一消息的响应消息;第一设备基于一个或多个第二消息确定与一个或多个设备中的第二设备建立连接;第一设备和第二设备协商用于第一设备和第二设备之间建立直连通信的链路信息,并基于该链路信息与第二设备建立直连通信连接。
本申请实施例中,第一设备可发送用于发现附近其他设备的第一消息,第一设备附近的任意设备监听到第一消息,均可以向第一设备反馈第二消息。第一设备根据所接收的一 个或多个第二消息,选择能够支持第一设备要进行的业务的设备,并与所选择的设备建立通信连接。之后,第一设备可连接的设备协商链路信息,并基于该链路信息与所选择的设备建立直连通信,从而组成分布式系统。无需为各个设备分配具体的角色,所以所建立的分布式系统中各个设备的角色对等,不会因角色问题而使得业务受限。
在一种可能的实现方式中,第二消息包括业务能力信息,该业务能力信息用于指示设备是否能够支持第一设备要进行的业务,第一设备基于一个或多个第二消息确定与第二设备建立连接,包括:
第一设备获取所述一个或多个第二消息分别携带的业务能力信息,根据所获取的业务能力信息从一个或多个设备中确定能够支持第一设备要进行的业务的设备为第二设备,并与第二设备建立连接。可以理解的是,第一设备附件的多个设备中有的设备可能不支持第一设备要进行的业务,如果第一设备与该设备建立连接,显然是没有必要的。因此,本方案中,第一设备可提前判断第一设备附近的设备中支持第一设备要进行的业务的设备,以减少不必要的连接过程。
在一种可能的实现方式中,所述方法还包括:
第一设备发送第一设备的优先级排序(ranking priority,RP),RP可用于指示第一设备的优先级,用于确定系统中的主设备,所述系统中除主设备之外的设备为从设备;第一设备接收来自一个或多个设备各自的RP,并基于接收的一个或多个RP确定主设备。可以理解的是,系统中设备间进行业务需时间同步,而基于本申请实施例提供的方法建立的系统中各个设备的角色对等,因此需要选出主设备,以用于从设备时间同步,保证设备间业务的正常进行。该方案中,各个设备各自上报自身的RP,每个设备基于系统中所有设备的RP可保证确定的主设备一致。
在一种可能的实现方式中,RP包括第一部分和第二部分,第一部分用于指示第一设备的身份信息,第二部分用于指示第一设备的优先级信息,优先级信息包括如下信息的一种或多种:设备等级、设备的协议版本号,或设备所连接的设备数量,所述设备等级包括设备的类型、设备的续航能力和设备的硬件能力的一种或多种。本申请实施例对设备的优先级信息的具体实现形式不作限制,例如包括如上几种,较为灵活。多种优先级信息可尽快保证确定的主设备的准确度。
在一种可能的实现方式中,第一设备按照预设规则,基于接收的一个或多个RP确定所述主设备,预设规则满足:
若第一设备的设备类型高于第二设备的设备类型,则第一设备为主设备,第二设备为从设备;
若第一设备的设备类型与第二设备的设备类型相同,第一设备的续航能力高于第二设备的续航能力,则第一设备为主设备,第二设备为从设备;
若第一设备的设备类型与第二设备的设备类型相同,第一设备的续航能力与第二设备的续航能力相同,第一设备的硬件能力高于第二设备的硬件能力,则第一设备为主设备,第二设备为从设备;
若第一设备的设备类型与第二设备的设备类型相同,第一设备的续航能力与第二设备的续航能力相同,第一设备的硬件能力与第二设备的硬件能力相同,第一设备的协议版本高于与第二设备的协议版本,则第一设备为主设备,第二设备为从设备;
若第一设备的设备类型与第二设备的设备类型相同,第一设备的续航能力与第二设备 的续航能力相同,第一设备的硬件能力与第二设备的硬件能力相同,第一设备的协议版本与第二设备的协议版本相同,第一设备连接的设备数高于第二设备连接的设备数,第一设备为主设备,则第二设备为从设备;
若第一设备的设备类型与第二设备的设备类型相同,第一设备的续航能力与第二设备的续航能力相同,第一设备的硬件能力与第二设备的硬件能力相同,第一设备的协议版本与第二设备的协议版本相同,第一设备连接的设备数与第二设备连接的设备数相同,则按位比较MAC地址,第一设备的MAC地址高于第二设备的MAC地址,第一设备为主设备,第二设备为从设备。
本申请实施例中多个设备建立连接之后,为了后续进行业务,各个从设备可与主设备进行时间同步。下面示出了两种同步方式,即主动同步方式和被动同步方式。被动同步方式,即主设备主动告知时间,从设备基于主设备的时间进行同步。主动同步方式,即从设备主动请求时间同步。
在一种可能的实现方式中,第一设备为主设备,所述方法还包括:第一设备周期性地发送时间同步帧,该时间同步帧携带用于各从设备时间同步的时间信息和基本服务集标识符(basic service set identifier,BSSID),所述BSSID用于指示多个设备所在系统的身份标识信息。该方案即被动时间同步,任意从设备接收到时间同步帧,都可以与主设备进行时间同步,便于任意设备间的业务正常进行。
在一种可能的实现方式中,第一设备为从设备,所述方法还包括:
第一设备广播时间同步请求消息,该时间同步请求消息用于请求与多个设备所在系统内的完成时间同步的设备进行时间同步;第一设备接收来自第三设备的响应消息,该响应消息携带第三设备的时间信息以及时域位置,所述时域位置用于指示多个设备相互发现过程中交互信息的时域位置;第一设备根据所述响应信息中的时间信息完成时间预同步,并在所述时域位置监听来自第三设备的action信令帧,完成最终同步。该方案即主动时间同步不需要等待主设备发送时间同步帧,可提前与主设备完成同步,从而降低同步时延。
第二方面,提供一种电子设备,该电子设备包括显示屏、一个或多个处理器、存储器、收发器,以及一个或多个程序。其中,所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行上述第一方面或者任意一种可能的实施方式中由第一设备所提供的方法。
例如,所述收发器用于发送第一消息,以及接收来自一个或多个设备的第二消息,该第一消息用于发现其他设备,第二消息为针对第一消息的响应消息;
所述至少一个处理器执行所述指令时使得所述电子设备执行:基于一个或多个第二消息确定与所述一个或多个设备中的第二设备建立连接;和第二设备协商用于电子设备和第二设备之间建立直连通信的链路信息,并基于链路信息与第二设备建立直连通信连接。
作为一种可选的实现方式,第二消息包括业务能力信息,该业务能力信息用于指示设备是否能够支持电子设备要进行的业务,所述处理器具体用于:获取一个或多个第二消息分别携带的业务能力信息;根据所获取的业务能力信息从一个或多个设备中确定能够支持电子设备要进行的业务的设备为第二设备,并确定与第二设备建立连接。
作为一种可选的实现方式,所述收发器还用于:
发送所述电子设备的优先级排序RP,所述RP可用于指示电子设备的优先级,用于确定电子设备所在系统中的主设备,所述系统中除主设备之外的设备为从设备;
接收来自一个或多个设备各自的RP,并基于接收的一个或多个RP确定主设备。
作为一种可选的实现方式,所述RP包括第一部分和第二部分,所述第一部分用于指示电子设备的身份信息,所述第二部分用于指示电子设备的优先级信息,所述优先级信息包括如下信息的一种或多种:
设备等级、设备的协议版本号,或设备所连接的设备数量,所述设备等级包括设备的类型、设备的续航能力和设备的硬件能力的一种或多种。
作为一种可选的实现方式,所述处理器具体用于按照预设规则,基于接收的一个或多个RP确定主设备,所述预设规则满足:
若电子设备的设备类型高于第二设备的设备类型,则电子设备为主设备,第二设备为从设备;
若电子设备的设备类型与第二设备的设备类型相同,电子设备的续航能力高于第二设备的续航能力,则电子设备为主设备,第二设备为从设备;
若电子设备的设备类型与第二设备的设备类型相同,电子设备的续航能力与第二设备的续航能力相同,电子设备的硬件能力高于第二设备的硬件能力,则电子设备为主设备,第二设备为从设备;
若电子设备的设备类型与第二设备的设备类型相同,电子设备的续航能力与第二设备的续航能力相同,电子设备的硬件能力与所述第二设备的硬件能力相同,电子设备的协议版本高于与第二设备的协议版本,则电子设备为主设备,第二设备为从设备;
若电子设备的设备类型与第二设备的设备类型相同,电子设备的续航能力与第二设备的续航能力相同,电子设备的硬件能力与第二设备的硬件能力相同,电子设备的协议版本与第二设备的协议版本相同,电子设备连接的设备数高于第二设备连接的设备数,电子设备为主设备,则第二设备为从设备;
若电子设备的设备类型与第二设备的设备类型相同,电子设备的续航能力与第二设备的续航能力相同,电子设备的硬件能力与第二设备的硬件能力相同,电子设备的协议版本与第二设备的协议版本相同,电子设备连接的设备数与第二设备连接的设备数相同,则按位比较MAC地址,电子设备的MAC地址高于第二设备的MAC地址,电子设备为主设备,第二设备为从设备。
作为一种可选的实现方式,电子设备为主设备,所述收发器还用于:
周期性地发送时间同步帧,该时间同步帧携带用于各从设备时间同步的时间信息和BSSID,所述BSSID用于指示多个设备所在系统的身份标识信息。
作为一种可选的实现方式,电子设备为从设备,所述收发器还用于:
广播时间同步请求消息,该时间同步请求消息用于请求与多个设备所在系统内的完成时间同步的设备进行时间同步;
接收来自第三设备的响应消息,该响应消息携带所述第三设备的时间信息以及时域位置,所述时域位置用于指示多个设备相互发现过程中交互信息的时域位置;
根据所述响应信息中的时间信息完成时间预同步,并在所述时域位置监听来自第三设备的action信令帧,完成最终同步。
关于第二方面或各种可选的实施方式所带来的技术效果,可参考对于第一方面或相应的实施方式所带来的技术效果的介绍。
第三方面,提供一种电子设备,所述电子设备包括用于执行第一方面或者任意一种可 能的实施方式中由第一设备所执行的方法的模块/单元。
第四方面,提供一种系统,该系统包括第一设备、第二设备和第三设备,可选的,该系统还可以包括其他设备,该系统所包括的设备能够实现分布式业务,例如多屏协同。各个设备可通过第二方面的电子设备或第三方面的电子设备实现。
第五方面,提供一种芯片,该芯片包括处理器和接口,所述接口用于与所述处理器通信以及接收来自其他设备的信息;所述处理器用于执行上述第一方面以及第一方面的任一可能实现方式中所述的方法。
第六方面,提供一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如下的一种或多种方法:上述第一方面或任意一种可能的实施方式中由第一设备所执行的方法。
第七方面,提供一种包含指令的计算机程序产品,所述计算机程序产品用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如下的一种或多种方法:上述第一方面或的任意一种可能的实施方式中由第一设备所执行的方法。
通过本申请实施例提供的技术方案能够使得互联的多个设备之间角色对等,不会因各个设备的角色造成对分布式业务的限制。
附图说明
图1为因终端设备角色导致分布式业务受限的一种场景示意图;
图2为因终端设备角色导致分布式业务受限的另一种场景示意图;
图3为本申请实施例提供的电子设备的架构示意图;
图4为本申请实施例提供的分布式系统的架构示意图;
图5为本申请实施例提供的多设备建立连接的流程图;
图6为承载优先级排序值的第一部分的一种帧结构;
图7为本申请实施例提供的电子设备的一种结构示意图。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述。
在介绍本申请之前,首先对本申请实施例中的部分用语进行简单解释说明,以便于本领域技术人员理解。
本申请涉及的应用(application,app),为能够实现某项或多项特定功能的软件程序。通常,电子设备中可以安装多个应用。例如,相机应用、短信应用、彩信应用、图像应用、各种邮箱应用、微信(WeChat)、腾讯聊天软件(QQ)、WhatsApp Messenger、连我(Line)、照片分享(instagram)、Kakao Talk、或钉钉等。下文中提到的应用,可以是电子设备出厂时已安装的应用,也可以是用户在使用电子设备的过程中从网络下载或从其他电子设备获取的应用(例如,其它电子设备发送的应用)。
本申请实施例涉及的信息,例如为应用,或者为文件,例如多媒体文件,多媒体文件例如包括图像文件、视频文件或音频文件;或者,文件也可以包括文字类文件,例如微软(Microsoft)工作(office)文件,例如word文件、excel文件、或powerpoint文件等;或 者,文件还可以包括画图类应用所对应的图片文件,例如Microsoft office visio文件或photoshop文件等。
本申请实施例中,至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a和b和c,其中a,b,c可以是单个,也可以是多个。
术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
以及,除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的大小、内容、顺序、时序、优先级或者重要程度等。例如,第一设备和第二设备,只是为了区分不同的文件,而并不是表示这两个文件的大小、内容、优先级或者重要程度等的不同。
前文介绍了本申请实施例所涉及到的一些名词概念,下面介绍本申请实施例涉及的技术特征。
随着智能终端的发展,一个用户拥有多个智能终端的场景越来越多,例如智能手机、平板电脑(PAD)、或个人计算机(PC)等设备。多设备之间的互联互通给用户带来了较好的体验。为了提高用户的体验,提供了多屏协同功能(或者,称为多设备协同功能),从而可支持多设备协同工作的应用与业务,例如多屏协同、信息共享等。例如,在多屏协同功能下,设备1可以向设备2进行投屏,从而设备1上的文件可以在设备2上打开。例如手机和PC进行多屏协同,则在PC的显示屏上会显示手机的镜像,在PC上显示的手机的镜像也可理解为投屏界面。用户在PC上的投屏界面上操作,例如用户选择打开文件A,则PC可以打开文件A,但实际上文件A是手机中的文件。PC相对于手机来说显示屏的面积更大,用户在PC上观看该文件,可以提升用户的观看效果。
为了便于描述,在本申请实施例中,将依赖多设备协同工作的应用或业务统称为分布式业务。应理解,支撑分布式业务需要将手机、平板、PC、显示屏等多个终端设备连接在一起,即多设备互联,从而使分布式业务在多个终端设备中协同运行。
为了支持多设备互联之间的数据传输,WiFi联盟(WI-FI alliance,WFA)开发定义了无线保真点对点(wireless fidelity Peer-to-Peer,WiFi P2P)协议。WiFi P2P协议是一种点对点的连接技术,使得多个WiFi设备在没有接入点(又称为访问节点)(access point,AP)的情况下也能构成一个网络(Network),该网络内的多个WiFi设备能够相互通信。该网络也可称为P2P Network,或者P2P组(Group)。WiFi P2P协议的大致原理是:可在两台工作站(又称为站点)(Station,STA)之间直接建立传输控制协议(transmission control protocol,TCP)/网际协议(internet protocol,IP)链接。这两台STA中的一台STA可认为是传统意义上的AP,称为群组拥有者(group owner,GO),相对而言,这两台STA中的另外一台STA可称为群组用户(group client,GC)。也就是GC类似STA,GO类似AP,那么类似STA连接到AP,GC也可连接到GO。应理解,在P2P Network或P2P Group中的一个GO可对应一个GC,也可以对应多个GC,即GO和GC之间可以是一对一的关系,也可以是 一对多的关系。
WiFi P2P协议基于802.11协议框架开发,属于一种中心式的网络通信结构。也就是,WiFi P2P要求每个终端设备都必须配置一个角色,例如可以是GO或GC。GO作为中心节点,能够与该GO连接的任意GC节点进行通信,但是GO和GO之间、GC与GC之间不能相互通信。然而,分布式业务可能存在于互联的多个设备中任意两个设备,例如一个GC与另一个GC之间,显然基于WiFi P2P协议实现的多设备互联限制了分布式业务的实际应用需求。
例如,请参见图1,示出了因终端设备角色导致分布式业务受限的一种场景。
图1包括3个终端设备,这3个终端设备分别是位于一个网络内的终端设备101、终端设备102和终端设备103。图1以终端设备101和终端设备102是手机,终端设备103是PAD为例。在图1中,终端设备101、终端设备102和终端设备103初始建链之后,终端设备103是GO,终端设备101和终端设备102均为GC。终端设备103可以与终端设备101进行协同业务,也可以与终端设备102进行协同业务。例如,如图1所示,终端设备103和终端设备102可进行投屏业务。如果需要协同的业务存在于互联的多个设置中的任意两个GC,由于GC与GC之间不能互相通信,显然无法进行协同业务。例如,如图1所示,需要在终端设备101和终端设备102之间实现信息共享,但是由于终端设备101和终端设备102均为GC,那么受终端设备102和终端设备101充当的角色限制,需要断开终端设备102和终端设备103之间的连接。对终端设备101和终端设备102重新建链,以使得终端设备101为GO,从而实现与终端设备102之间的信息共享,否则无法实现终端设备102和终端设备101之间的信息共享。当终端设备101和终端设备102重新建链之后,终端设备101和终端设备101中一个终端设备充当GO,另一个终端设备充当GC。例如,图1以终端设备101充当GO,终端设备102充当GC为例。也就是说一个设备的角色随着建链的变化,角色是可以变化的,例如终端设备101在初始建链之后,终端设备101的角色为GC,再之后重新建链之后,终端设备101的角色是GO。
又例如,请参见图2,示出了因终端设备角色导致分布式业务受限的另一种场景。
图2包括4个终端设备,这4个终端设备分别是位于一个网络内的终端设备101和终端设备102,以及显示器103和显示器104。图2以终端设备101和终端设备102是手机为例。在一种可能的应用场景,终端设备101和终端设备102可采用电脑模式办公,更为方便。例如,终端设备101可投屏到显示器103,终端设备102可投屏到显示器104。这种情况下,可认为终端设备101和终端设备102充当的角色是GO,显示器103和显示器104充当的角色是GC。但是,如果终端设备101和终端设备102之间需要分享信息,由于终端设备101和终端设备102都是GO,所以终端设备101和终端设备102之间无法相互分享信息。即由于P2P角色冲突,无法建立终端设备101和终端设备102之间的连接完成文件的传输。为此,终端设备101需要断开与显示器103的连接,终端设备102断开与显示器104的连接,终端设备101和终端设备102重新建立连接。例如终端设备101和终端设备102建立连接后,终端设备101充当GO,终端设备102充当GC,那么终端设备101和终端设备102之间可分享信息。
从图1和图2中可以看出,基于WiFi P2P协议实现的多设备互联由于建链的角色限制,限制了分布式业务的实际应用需求。鉴于此,本申请实施例提供了一种新的多设备互联方法,基于该方法可使得互联的多个设备之间角色对等,不会因各个设备的角色造成对分布 式业务的限制。
本申请实施例提供的技术方案可以应用在电子设备中。在本申请一些实施例中,电子设备可以是便携式电子设备,诸如手机、PAD、便携计算机、具备无线通讯功能的可穿戴设备(如智能手表、智能眼镜、智能手环、或智能头盔等)、或车载设备等。便携式电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2022085797-appb-000001
或者其它操作系统的便携式电子设备。还应当理解的是,在本申请其他一些实施例中,上述电子设备也可以不是便携式设备,例如也可以是台式计算机,例如PC,或者也可以是电视机,或者也可以是显示器等设备。
示例性地,图3给出了一种电子设备300的结构示意图。
应理解,图示电子设备300仅是一个范例,并且电子设备300可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
如图3所示,电子设备300可以包括处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,天线2,移动通信模块350,无线通信模块360,音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,传感器模块380,按键390,马达391,指示器392,摄像头393,显示屏394,以及用户标识模块(subscriber identification module,SIM)卡接口395等。其中传感器模块380可以包括压力传感器380A,陀螺仪传感器380B,气压传感器380C,磁传感器380D,加速度传感器380E,距离传感器380F,接近光传感器380G,指纹传感器380H,温度传感器380J,触摸传感器380K,环境光传感器380L,骨传导传感器380M等。
下面结合图3对电子设备300的各个部件进行具体的介绍。
处理器310可以包括一个或多个处理单元,例如,处理器310可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备300的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器310中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器310中的存储器为高速缓冲存储器。该存储器可以保存处理器310刚用过或循环使用的指令或数据。如果处理器310需要再次使用该指令或数据,可从存储器中直接调用,从而可避免重复存取,可减少处理器310的等待时间,因而可提高系统的效率。
处理器310可以运行本申请实施例提供的信息分享的方法。例如本申请实施例提供协同快捷操作服务(Fast Collaborative Service),协同快捷操作服务可以是软件模块,该软件模块可以运行在处理器310上,该软件模块可以理解为计算机程序。例如该软件模块可以提供系统级的能力,以安卓系统为例,从业务角度考虑,该软件模块可以放在系统服务(system_server)进程中,与system_server进程中的活动管理器服务(activity manager service,AMS)、包管理器服务(package manager service,PMS)、或窗口管理器服务(window manager  service)等模块共同构筑平台基础能力。或者,从实现角度考虑,除了system_server进程外,协同快捷操作服务也可以放在其他进程中。当处理器310集成不同的器件,比如集成CPU和GPU时,CPU和GPU可以配合执行本申请实施例提供的方法,例如本申请实施例提供的方法中部分算法由CPU执行,另一部分算法由GPU执行,以得到较快的处理效率。
在一些实施例中,处理器310可以包括一个或多个接口。比如,接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
USB接口330是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口330可以用于连接充电器为电子设备300充电,也可以用于电子设备300与外围设备之间传输数据。充电管理模块340用于从充电器接收充电输入。电源管理模块341用于连接电池342,充电管理模块340与处理器310。电源管理模块341接收电池342和/或充电管理模块340的输入,为处理器310,内部存储器321,外部存储器,显示屏394,摄像头393,和无线通信模块360等供电。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器310可以包含多组I2C总线。处理器310可以通过不同的I2C总线接口分别耦合触摸传感器380K,充电器,闪光灯,摄像头393等。例如:处理器310可以通过I2C接口耦合触摸传感器380K,使处理器310与触摸传感器380K通过I2C总线接口通信,实现电子设备300的触摸功能。
移动产业处理器接口(mobile industry processor interface,MIPI)接口可以被用于连接处理器310与显示屏394,摄像头393等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器310和摄像头393通过CSI接口通信,实现电子设备300的拍摄功能。处理器310和显示屏394通过DSI接口通信,实现电子设备300的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器310与摄像头393,显示屏394,无线通信模块360,音频模块370,传感器模块380等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
电子设备300的无线通信功能可以通过天线1,天线2,移动通信模块350,无线通信模块360,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备300中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块350可以提供应用在电子设备300上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块350可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块350可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块350还 可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块350的至少部分功能模块可以被设置于处理器310中。在一些实施例中,移动通信模块350的至少部分功能模块可以与处理器310的至少部分模块被设置在同一个器件中。
无线通信模块360可以提供应用在电子设备300上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块360可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块360经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器310。无线通信模块360还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备300的天线1和移动通信模块350耦合,天线2和无线通信模块360耦合,使得电子设备300可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备300的结构限定。在本申请另一些实施例中,电子设备300也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备300通过GPU,显示屏394,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏394和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器310可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏394用于显示图像,视频等。显示屏394包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。
电子设备300可以通过ISP,摄像头393,视频编解码器,GPU,显示屏394以及应用处理器等实现拍摄功能,或者说实现采集图像的功能。
ISP用于处理摄像头393反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头393 中。
摄像头393用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备300可以包括1个或N个摄像头393,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备300在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备300可以支持一种或多种视频编解码器。这样,电子设备300可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备300的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器321可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器321可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备300使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器321可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器310通过运行存储在内部存储器321的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备300的各种功能应用以及数据处理。
外部存储器接口320可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口320与处理器310通信,实现数据存储功能。例如将图片,视频等文件保存在外部存储卡中。
电子设备300可以通过音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
按键390包括开机键,音量键等。按键390可以是机械按键。也可以是触摸式按键。电子设备300可以接收按键输入,产生与电子设备300的用户设置以及功能控制有关的键信号输入。马达391可以产生振动提示。马达391可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。指示器392可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口395用于连接SIM卡。SIM卡可以通过插入SIM卡接口395,或从SIM卡接口395拔出,实现与电子设备300的接触和分离。
可以理解的是,图3所示的部件并不构成对电子设备300的具体限定,手机还可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布 置。此外,图3中的部件之间的组合/连接关系也是可以调整修改的。
本申请实施例提供多个设备,这多个设备可以是相同的设备,例如为电子设备300;或者,这多个设备也可以是不同的设备,例如这多个设备中的部分设备为电子设备300,部分设备为显示器。本申请实施例对这多个设备的实现形式不作限制,例如这多个设备均可以是电子设备,或者这多个设备也可以是电子设备中的芯片,又或者这多个设备中的部分设备是电子设备,部分设备是电子设备中芯片。
本申请实施例还对应提供一种分布式系统,该分布式系统可包括多个设备中的至少两个设备,当然,该分布式系统还可以包括其他设备。分布式系统中的任意设备之间可进行多屏协同,信息分享等。
请参见图4,为分布式系统的一种示意图。图4以分布式系统包括5个设备为例,应理解,这5个设备处于同一个网络内。这5个设备分别为设备1、设备2、设备3、设备4和设备5。设备1、设备2、设备3、设备4和设备5之间可进行多屏协同或信息共享等。例如,设备1可与设备2或设备3进行多屏协同或信息共享,设备2与设备4可进行多屏协同,设备3与设备5可进行信息共享。为了便于理解,在下文的介绍过程中,以设备1是手机、设备2是便携计算机、设备3是平板电脑、设备4是个人电脑和设备5是智能音箱为例。手机的结构例如为图3所示的结构,便携计算机、平板电脑、个人电脑和智能音箱可包括比图3所示的结构更多或更少的部件。
应理解,设备1、设备2、设备3、设备4和设备5之间进行分布式业务,例如多屏协同或信息共享之前,需要建立连接。也就是任意设备需要进行多屏协同或信息共享之前,可与其他可能的设备进行连接,即多设备进行互联。
在本申请实施例中,互联的多个设备之间角色对等,不会因各个设备的角色造成对分布式业务的限制。
下面结合附图介绍本申请实施例提供的技术方案。请参见图5,示出了本申请实施例提供的多设备建立连接的流程。在下文的介绍过程中,以该方法应用于图4所示的网络架构为例。应理解,该方法涉及多个设备,例如图4中的各个设备。为了便于描述,下文的介绍中,以该方法涉及第一设备和多个设备,第一设备可以是需要进行分布式业务的设备,多个设备例如包括第二设备和第三设备,甚至第四设备等。应理解,第一设备需要进行分布式业务设备之前,需要与第一设备周围的一个或多个设备建立连接,也就是组网,从而与网络内的一个或多个设备协同进行分布式业务。举例来说,第一设备为图4中的手机,手机需要多屏协同时,可请求与图4中的个人电脑和/或平板电脑建立连接,从而手机与个人电脑可进行多屏协同业务。第一设备可以是图4中的任意设备,多个设备也可以是图4中的任意设备。由于对任意设备来说,需要进行分布式业务之前,与其他设备建立连接的过程类似,因此在下文的介绍过程中,以第一设备和第二设备建立连接为例。应理解,第二设备与第一设备建立连接的过程类似。
S501、第一设备广播第一消息,该第一消息用于发现一个或多个设备。
对于一些应用,例如分布式业务可能需要通过多个设备协同工作,从而使得用户在使用这些应用时的体验更好。例如,在一种可能的场景中,第一设备为手机,为便于查阅文件,需要将文件分享给另一设备,例如PC。手机可以向PC进行投屏,从而手机上的文件可以在PC上打开。例如手机和PC进行多屏协同,则在PC的显示屏上会显示手机的镜像,在PC上显示的手机的镜像也可理解为投屏界面。用户在PC上的投屏界面上操作,例如用 户选择打开文件A,则PC可以打开文件A,但实际上文件A是手机中的文件。PC相对于手机来说显示屏的面积更大,用户在PC上观看该文件,可以提升用户的观看效果。
但是支撑分布式业务需要将手机、平板、PC、显示屏等多个设备连接在一起,即多设备互联。所以,第一设备进行分布式业务之前,需要与一个或多个设备建立连接,也就是组网,从而与网络内的一个或多个设备协同进行分布式业务。为了便于描述,下文中以第一设备要与其他设备进行投屏业务为例。
第一设备进行投屏业务前,第一设备可查找第一设备附近的一个或多个设备。例如,第一设备可广播用于发现一个或多个设备的第一消息。第一设备附件的任意设备,例如第二设备接收到该第一消息,可响应该第一消息,以告知第一设备,第二设备的存在。后续第一设备与第二设备建立连接。又例如,第一设备附件的第三设备接收到该第一消息,可响应该第一消息,以告知第一设备,第三设备的存在。后续第一设备与第三设备建立连接。当然,如果第二设备进行业务,例如投屏业务或文件分享业务前,第二设备也可查找第二设备附件的一个或多个设备,并与查找到的设备建立连接。
需要说明的是,本申请实施例对第一消息的具体名称不作限制,例如第一消息也可称为发现消息、探测消息或设备发现消息等。本申请实施例对第一消息的具体实现方式不作限制。
示例性的,第一消息可基于WiFi协议生成,也就是,设备间基于WiFi扫描发现彼此。这种方式可适用于无蓝牙且对功耗不敏感的设备,例如路由器和物联网(Internet of Things,IOT)设备等。这种方式下,第一设备可分配一些发现窗口(Discovery Window,DW),第一设备可在DW广播第一消息。第一设备附近的任意设备(例如N个设备)都可以监听第一消息。以第二设备为例,如果第二设备接收到第一消息,可向第一设备发送针对第一消息的响应消息,以告知第一设备,第二设备的存在。
示例性的,第一消息可基于蓝牙通信协议生成,也就是设备间通过蓝牙扫描发现彼此。例如第一设备广播第一消息,第一设备附近的任意设备(例如N个设备)都可以监听第一消息。以第二设备为例,如果第二设备接收到第一消息,可向第一设备发送针对第一消息的响应消息,以告知第一设备,第二设备的存在。
其中,第一消息可第一设备的相关信息,用于对第一设备进行认证。例如第一设备的相关信息可包括第一设备的设备标识(identity,ID)、IP地址,第一设备的身份信息,例如第一设备的制造商的ID,第一设备的MAC地址,以及第一设备的设备名称,或者其他可能的信息等。第一消息还可以包括第一设备进行的业务的相关信息,例如包括业务类型,即投屏类型,用于第一设备附近的设备知道第一设备要进行的业务为投屏业务。下面介绍第一设备基于蓝牙扫描发现第二设备,并与第二设备建立连接的过程。
S502、第二设备向第一设备发送第二消息,相应的,第一设备接收该第二消息,该第二消息为所述第一消息的响应消息。
第一设备附近的任意设备都可以监听第一消息。以第二设备为例,如果第二设备接收到第一消息,可向第一设备发送第二消息,以告知第一设备第二设备的存在。以第三设备为例,如果第三设备接收到第一消息,可向第一设备发送第二消息,以告知第一设备第三设备的存在。需要说明的是,本申请实施例对第二消息的具体名称不作限制,例如第二消息也可称为发现响应消息、探测响应消息或设备发现响应消息等。
应理解,如果第一消息是基于蓝牙协议生成,那么第二消息也基于蓝牙协议生成。第 二设备接收到第一消息,可根据第一消息携带的第一信息对第一设备进行认证。以第二设备为例,例如第二设备可基于手动认证对第一设备进行认证。即第二设备接收到第一消息之后,可输出提示界面,该提示界面用于显示第一设备的认证信息,例如设备名称等。用户可在提示界面输入第一设备的认证信息,完成对第一设备的认证。又例如,第二设备可基于自动认证对第一设备进行认证。即第二设备可获取第一消息携带的第一设备的身份信息,例如第一设备的制造商的ID,判断该身份信息是否在可信列表中,完成对第一设备的认证。可信列表可认为是允许连接的设备的制造商的ID列表。
第二设备对第一设备认证成功后,向第一设备发送第二消息。应理解,如果第一消息是基于蓝牙协议生成,那么第二消息是通过蓝牙广播信道发送给第一设备。该第二消息可携带第二信息,该第二信息可用于确定第二设备是否能够支持第一设备要进行的分布式业务。例如第二信息包括第二设备的业务能力信息。该业务能力信息包括业务类型列表,所述业务类型列表用于指示第二设备支持的多种业务。该业务能力信息还可包括Wi-Fi加密类型、信道信息、MAC地址信息、协议版本信息,以及设备的多输入多输出(multi input multi outpu,MIMO)信息等中的一种或多种。当然,第二消息还包括第二设备的设备ID和IP地址等。第一设备根据第二信息可确定是否要与第二设备建立连接。如果第二信息指示第二设备的业务能力能够支持第一设备要进行的分布式业务,那么第一设备选择与第二设备建立连接;相反,如果第二信息指示第二设备的业务能力不能支持第一设备要进行的分布式业务,那么第一设备可选择不与第二设备建立连接。
第二消息是第一消息的响应消息,第二消息的具体实现根据第一消息的不同也有不同。以第一设备进行投屏业务为例。在一些实施例中,第一消息可包括第一设备的相关信息,这种情况下,第一消息用于发现第一设备附近的多个设备。第一设备附近的设备,例如第二设备向第一设备发送的第二消息可包括业务能力信息,例如第二设备支持的多个业务类型。第一设备可根据第二消息支持的多个业务确定第二设备是否支持第一设备的投屏业务。
在另一些实施例中,第一消息可包括第一设备的相关信息以及业务信息,例如投屏类型。这种情况下,第一消息可用于发现第一设备附近支持投屏业务的设备。第一设备附近的设备,例如第二设备向第一设备发送的第二消息也可包括业务能力信息,例如第二设备支持的多个业务类型。第一设备可根据第二消息支持的多个业务确定第二设备是否支持投屏业务。或者,第一设备附近的多个设备接收第一消息之后,这多个设备中支持投屏业务的设备,例如第二设备向第一设备发送第二消息,该第二消息包括第二设备的相关信息以及第二设备支持的业务类型,例如投屏类型。第一设备接收到第二消息,可确定与第二消息对应的第二设备支持投屏业务。或者,第一设备附近的多个设备接收第一消息之后,多个设备分别向第一设备发送第二消息。其中,支持投屏业务的设备发送的第二消息用于指示所述设备支持第一设备要进行的投屏业务,不支持投屏业务的设备发送的第二消息用于指示所述设备不支持第一设备要进行的投屏业务,简单直接。当然,第一设备附近的多个设备接收第一消息之后,这多个设备中支持投屏业务的设备向第一设备发送第二消息,不支持投屏业务的设备可不向第一设备发送第二消息。这种情况下,第一设备接收到第二消息,可默认与第二消息的设备支持投屏业务。
应理解,如果第一消息是基于WiFi协议生成,那么第二消息可以是定时通知帧(timing notification frame,PNF)。即第一设备附近的设备(例如第二设备)接收第一消息之后,向第一设备发送PNF。PNF可携带第二设备的相关信息,以及业务能力信息。或者PNF 用于指示第二设备是否支持投屏业务。
应理解,第一设备可能接收到多个设备(例如第二设备和第N个设备)针对第一消息分别发送的第二消息,第一设备可根据所接收的多个第二消息,确定能够支持第一设备要进行的分布式业务的一个或多个设备。在下文的介绍中,以第二设备能够支持第一设备要进行的分布式业务为例。同理,第三设备对第一设备认证成功后,向第一设备发送第二消息。第一设备根据第二消息中的第二信息可确定是否要与第三设备建立连接。
S503、第一设备根据接收的一个或多个第二消息确定与一个或多个设备建立连接。
第一设备根据来自各个设备的第二消息携带的第二信息,可确定各个设备中哪个或哪些设备支持第一设备要进行的分布式业务。第一设备确定支持第一设备要进行的分布式业务的一个或多个设备之后,与这一个或多个设备建立连接。
以这一个或多个设备包括第二设备为例。当第一设备需要与第二设备建立连接时,第一设备可建立一个Socket,以通过该Socket向第二设备发送蓝牙连接请求(或称为蓝牙报文),以请求与第二设备建立蓝牙通信连接。第二设备监测到来自第一消息,也建立一个Socket,通过该Socket可以监听来自第一设备的蓝牙连接请求。如果第二设备监听到来自手机的蓝牙连接请求,那么第二设备响应于第一设备的蓝牙连接请求,与第一设备建立蓝牙通信连接。同理,第一设备与第三设备建立连接过程类似第一设备与第二设备建立连接过程,这里不再赘述。
S504、第一设备和一个或多个设备协商链路信息,该链路信息用于一个或多个设备和第一设备之间建立WiFi直连通信过程。
以支持第一设备要进行的分布式业务的设备包括第二设备为例。第一设备与第二设备建立蓝牙连接之后,第一设备和第二设备可互相协商用于建立第一设备和第二设备之间的WiFi直连通信的一些信息,例如包括信道信息、建链类型以及预共享密码(pre-shared key,PSK)。例如,第一设备通过与第二设备之间的蓝牙信道将信道信息、建链类型以及PSK等发送给第二设备,以便第二设备根据这些信息与第一设备建立WiFi直连通信。应理解,如果支持第一设备要进行的分布式业务的设备还包括第三设备,那么第一设备与第三设备建立蓝牙连接之后,第一设备和第三设备也可WiFi直连通信的一些信息,以便第三设备根据这些信息与第一设备建立WiFi直连通信。
以此类推,第一设备附近的任意设备监听到来自第一设备的第一消息,均可以向第一设备反馈针对第一消息的响应消息,即第二消息。第一设备根据所接收的一个或多个第二消息,选择能够支持第一设备要进行的分布式应用的一个或多个设备,并与这一个或多个设备建立蓝牙连接。之后,第一设备与各个设备中可协商链路信息,并与各个设备建立WiFi直连通信,从而组成分布式系统。
需要说明的是,前述以第一设备是需要进行投屏业务的设备,在进行业务之前,第一设备广播第一消息,以发送第一设备附近支持投屏业务的设备,例如第二设备。如果第二设备支持投屏业务,那么第一设备与第二设备建立连接。应理解,如果第二设备要进行文件分享业务,第二设备也会广播第一消息,以发现第二设备附近支持文件分享业务的设备。如果第二设备附近支持的文件分享业务设备包括第一设备,那么第二设备与第一设备建立连接。当然,如果第一设备已经与第二设备建立连接,用于实现投屏业务。后续第二设备进行文件分享业务发现第一设备支持文件分享业务,那么第二设备与第一设备直接可进行文件分享业务,不需要重新与第一设备建立连接。
图5所示的流程以第一设备是需要进行分布式业务的设备为例。如果第二设备是需要进行分布式业务的设备,那么第二设备按照图5所示的流程实现与第一设备以及其余多个设备实现组网。同理,如果第三设备是需要进行分布式业务的设备,那么第二设备按照图5所示的流程实现与第一设备、第二设备以及其余多个设备实现组网。即本申请实施例中,各个设备基于设备间发现之后建立通信通道,再通过设备间建立的通信通道协商设备间建立WiFi直连通信的链路信息。无需为各个设备分配具体的角色,所以所建立的分布式系统中各个设备的角色对等,因此分布式业务可在任意设备间协同。相较于基于WiFi P2P协议实现的多设备互联来说,本申请实施例提供的多设备建立连接的方法,不会因角色问题而使得分布式业务受限。例如,基于WiFi P2P协议实现的第一设备、第二设备和第三设备互联,其中第一设备、第二设备和第三设备中只有一个设备是GO,其余两个设备是GC。以第一设备是GO,第二设备和第三设备是GC为例,第一设备可投屏到第二设备,但是同时,第二设备无法将信息分享到第三设备。然而,以本申请实施例提供的方法实现第一设备、第二设备和第三设备互联。第一设备、第二设备和第三设备之间的角色对等,第一设备可投屏到第二设备,同时第二设备和第三设备之间可共享文件。
另外,设备间基于蓝牙发现彼此建立WiFi直连通信,可在需要发现其余设备时,基于蓝牙广播第一消息。相较于各个设备在DW广播自身的信息来说,无需等待DW的带来,以在DW广播自身的信息,从而可节省发现设备的时延,即降低各个设备建链的时延。且等待DW广播自身的信息期间,设备通常亮屏,因此设备间基于蓝牙发现彼此建立WiFi直连通信还可以降低各个设备的功耗。
以第一设备为例,第一设备与多个设备组网之后,可与该网络内的任意设备协同分布式应用。这需要分布式系统中各个设备之间时间同步,为此,多个设备建立WiFi直连通信之后,需要进行时间同步。由于本申请实施例所建立的分布式系统中各个设备角色对等,因此在进行时间同步之前,可从分布式系统中的多个设备中选择一个设备作为主设备,以该主设备的时间为准,对其余设备的时间进行同步。相对于该主设备,分布式系统内的其余设备可认为是从设备,从设备可根据主设备的时间来同步。
在可能的实现方式中,可对分布式系统中的多个设备进行优先级排序,将优先级最高的设备作为主设备。如果将分布式系统内所有设备的集合称为域,那么域内优先级最高的设备即为主设备。本申请实施例对优先级的确定方式不作限制。
作为一种示例,可根据各个设备的设备类型、设备的续航能力、设备的硬件能力、设备采用的协议版本、设备连接的设备数量和设备的MAC地址的一种或多种来确定设备的优先级。其中,设备的类型,例如为显示器、PC、平板、手机、IOT设备、智能音箱或穿戴设备等。设备的续航能力,例如为设备的剩余电量等级,例如高电量、中电量、中低电量以及低电量等。需要说明的是,本申请实施例对剩余电量等级的等级数量不作限制,各个剩余电量等级可事先定义,例如剩余电量大于或等于总电量的70%,那么该剩余电量的等级为高电量;剩余电量大于或等于总电量的50%,且小于总电量的70%,那么该剩余电量的等级为中电量;剩余电量大于或等于总电量的30%,且小于总电量的50%,那么该剩余电量的等级为中低电量;剩余电量小于总电量的30%,那么该剩余电量的等级为低电量。设备的硬件能力,例如设备采用双WiFi芯片或者单WiFi芯片。需要说明的是,设备的类型、设备的续航能力和设备的硬件能力等仅是举例说明,本申请实施例对设备的类型、设备的续航能力和设备的硬件能力的具体表现形式不作限制。
各个设备可上报自身的优先级信息,例如各个设备可上报自身的优先级排序(ranking priority,RP)值,该RP值可用于指示各个设备的优先级信息。如果各个设备基于蓝牙发现彼此,那么RP值可携带在第一消息中。如果各个设备基于WiFi发现彼此,即第一消息基于WiFi协议生成,那么RP值可携带在各个设备发送的同步信标帧中。RP值可占用一个字段,也可以占用多个字段,对此,本申请实施例不作限制。例如,RP值指示的各个内容可分别占用同一字段的不同比特;或者RP值指示的各个内容可分别占用不同的字段。
示例性的,RP值可包括两部分,一部分用于指示排序等级(ranking level),另一部分用于指示设备的MAC地址,其中,排序等级可包括设备等级、设备的协议版本号、设备所连接的设备数量。设备等级又包括设备的类型、设备的续航能力和设备的硬件能力。
举例来说,请参见图6,为承载RP值的第一部分的一种帧结构。即排序等级字段包括3个字段,这3个字段为设备等级字段、协议版本号字段和连接数字段。需要说明的是,本申请实施例对这3个字段的具体名称不作限制。本申请实施例对各个字段所占用的比特数不作限制。示例性的,设备等级字段的定义可参见表1。
表1
Figure PCTCN2022085797-appb-000002
本申请实施例根据各个设备上报的RP值,可按照各个设备的优先级信息,例如设备类型、设备的续航能力、设备的硬件能力、设备采用的协议版本、设备连接的设备数量和设备的MAC地址的优先级来确定设备的优先级。由于各个设备都是基于系统内的所有设备的PR值确定各个设备的优先级,所以系统内的每个设备确定的所有设备的优先级一致。在一些实施例中,可优先根据各个设备的设备类型来确定设备的优先级,如果根据各个设备的设备类型确定各个设备的优先级一致,可进一步根据设备的续航能力来确定设备的优先级,依次类推,直到确定出各个设备的优先级。例如可依次执行:1)比较各设备的类型,设备类型较高的设备为主设备,如果各设备的类型相同,可继续2);2)比较各设备的续航能力,续航能力较高的设备为主设备,如果各设备的续航能力相同,可继续3);3)比较各设备的硬件能力,设备硬件能力较高的为主设备,如果各设备的硬件能力相同,可继续4);4)比较各设备的协议版本,版本号较高的设备为主设备,如果各设备的版本号相同,可继续5);5)比较各设备所连接的设备数,连接数高的设备为主设备,如果各设 备所连接的设备数相同,继续6);6)分别对各设备的MAC地址按位比较,MAC地址较高的设备为主设备。
在分布式系统内选出主设备之后,从设备可基于主设备的时间进行同步,包括但不限于以下两种方式。
同步方式一、被动时间同步,即主设备主动告知时间,从设备基于主设备的时间进行同步。
例如,主设备可周期性发送时间同步帧,该时间同步帧可携带用于时间同步的时间信息。例如,该时间同步帧可以是802.11Beacon帧,携带有定时器同步功能(timer synchronization function,TSF)时间信息以及该分布式系统的BSSID。应理解,BSSID用于区分不同的网络。由于采用802.11Beacon帧作为时间同步帧,可沿用802.11Beacon帧的TSF,从而能够实现10us误差级别的硬件时钟同步,尽量缩短设备间的同步时间。任意从设备接收到来自主设备的时间同步帧,可获取该时间同步帧携带的BSSID。如果获取到的BSSID与自身的BSSID相同,那么可认为该时间同步帧是位于一个网络内的主设备发送的,可以根据该时间同步帧实现与主设备的同步。例如,从设备确定获取到的BSSID与自身的BSSID相同,则可以刷新TSF计数器,从而实现与主设备的时间同步。
同步方式二、主动时间同步,即从设备主动申请时间同步。从设备主动申请时间同步,不需要等待主设备发送时间同步帧,可提前与主设备完成同步,从而降低同步时延。
以要申请时间同步的从设备是第一从设备为例,第一从设备可主动广播时间同步请求消息,例如sync_request action信令帧,以向同一网络内已经完成时间同步的设备请求同步时间。主设备或其他从设备接收到该时间同步请求消息,可向第一从设备发送针对该时间同步请求消息的响应消息,例如sync_response action信令帧。该响应消息可携带本设备的TSF时间信息和发送信息的时域(social slot)位置。social slot位置可认为是近场所有设备相互发现时交互的时隙位置,用于发现近场内的各个设备。第一从设备接收到该响应消息,可根据该响应消息携带的TSF时间信息完成时间预同步,也就是与主设备的TSF时间信息对齐。此时,第一从设备可能还没有发现网络内的其他从设备。应理解,每个设备维护TSF时间信息是基于本地定时器,然而设备发送信息存在时延。因此,第一从设备还可在social slot监听来自主设备或其他从设备的action信令帧,以根据该action信令帧携带的时间信息完成最终同步。
如上图5所示的流程示出了多个设备初次建立连接的过程。在可能的场景中,多个设备已经实现互联,即这多个设备已经完成组网。然而多个设备还存在其他设备需要进行组网。例如,第一设备、第二设备和第三设备已经建立连接,位于同一个网络。位于第一设备、第二设备和第三设备的近场内存在第四设备,该第四设备有需要进行的分布式业务。这种场景下,第四设备执行如图5所示的流程,与第一设备、第二设备和第三设备建立连接。即第四设备广播第一消息,第一设备、第二设备以及第三设备中任意设备接收到第一消息,向第四设备发送第二消息。以第一设备、第二设备和第三设备均接收到第一消息,那么第一设备、第二设备和第三设备分别向第四设备第二消息。第四设备可根据来自第一设备、第二设备和第三设备的第二消息确实哪些设备支持第四设备要进行的分布式业务。如果第一设备、第二设备和第三设备都支持第四设备要进行的分布式业务,那么第四设备可请求与第一设备、第二设备或第三设备建立连接,进入第一设备、第二设备和第三设备所在的网络。如果第一设备、第二设备和第三设备中部分设备支持第四设备要进行的分布 式业务,那么第四设备可请求与部分设备建立连接,加入第一设备、第二设备和第三设备所在的系统。应理解,第四设备加入已经完成组网的系统中,那么重新组成的系统中,各个设备需要重新确定该系统的主设备。应理解,第四设备加入系统之后,需要与系统中设备进行时间同步。例如,第四设备接收到来自主设备周期性发送的时间同步帧,可根据该时间同步帧进行时间同步,即第四设备可以被动时间同步。又例如,第四设备也可以广播时间同步请求消息,即第四设备也可以主动时间同步。
基于以上实施例,本申请实施例还提供了一种电子设备,该电子设备例如为手机、或PAD、或便携计算机、或智能音箱等。如图7所示,该电子设备可以包括:显示屏701;一个或多个处理器702;一个或多个存储器703,用于存储一个或多个程序704;上述各器件可以通过一个或多个通信总线705连接。所述显示屏701可以用于显示电子设备中的某个文件的内容;或者所述显示屏701还可以用于显示电子设备的桌面;或者所述显示屏701可以用于显示一个图像等等。
其中,当存储器703中存储的一个或多个程序704被一个或多个处理器702执行时,电子设备可以用于执行如图5所示的实施例或其他相应实施例中的各个步骤。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。本发明实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。例如,上述实施例中,第一获取单元和第二获取单元可以是同一个单元,也不同的单元。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现,也可以采用硬件结合软件功能单元的形式实现。
上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以程序产品的形式实现。所述程序产品包括一个或多个计算机指令。在计算机上加载和执行所述程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程设备。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (17)

  1. 一种多设备建立连接的方法,用于包括多个设备的系统,所述多个设备包括第一设备,其特征在于,包括:
    第一设备发送第一消息,所述第一消息用于发现其他设备;
    所述第一设备接收来自一个或多个设备的第二消息,所述第二消息为针对所述第一消息的响应消息;
    所述第一设备基于一个或多个所述第二消息确定与所述一个或多个设备中的第二设备建立连接;
    所述第一设备和所述第二设备协商用于所述第一设备和所述第二设备之间建立直连通信的链路信息,并基于所述链路信息与所述第二设备建立直连通信连接。
  2. 如权利要求1所述的方法,其特征在于,所述第二消息包括业务能力信息,所述业务能力信息用于指示设备是否能够支持所述第一设备要进行的业务,所述第一设备基于一个或多个所述第二消息确定与所述第二设备建立连接,包括:
    所述第一设备获取所述一个或多个第二消息分别携带的业务能力信息;
    所述第一设备根据所获取的业务能力信息从所述一个或多个设备中确定能够支持所述第一设备要进行的业务的设备为所述第二设备;
    所述第一设备确定与所述第二设备建立连接。
  3. 如权利要求1或2所述的方法,其特征在于,所述方法还包括:
    所述第一设备发送所述第一设备的优先级排序RP,所述RP可用于指示所述第一设备的优先级,用于确定所述系统中的主设备,所述系统中除所述主设备之外的设备为从设备;
    所述第一设备接收来自所述一个或多个设备各自的RP,并基于接收的一个或多个RP确定所述主设备。
  4. 如权利要求3所述的方法,其特征在于,所述RP包括第一部分和第二部分,所述第一部分用于指示所述第一设备的身份信息,所述第二部分用于指示所述第一设备的优先级信息,所述优先级信息包括如下信息的一种或多种:
    设备等级、设备的协议版本号,或设备所连接的设备数量,所述设备等级包括设备的类型、设备的续航能力和设备的硬件能力的一种或多种。
  5. 如权利要求4所述的方法,其特征在于,所述第一设备按照预设规则,基于接收的一个或多个RP确定所述主设备,所述预设规则满足:
    若所述第一设备的设备类型高于所述第二设备的设备类型,则所述第一设备为主设备,所述第二设备为从设备;
    若所述第一设备的设备类型与所述第二设备的设备类型相同,所述第一设备的续航能力高于所述第二设备的续航能力,则所述第一设备为主设备,所述第二设备为从设备;
    若所述第一设备的设备类型与所述第二设备的设备类型相同,所述第一设备的续航能力与所述第二设备的续航能力相同,所述第一设备的硬件能力高于所述第二设备的硬件能力,则所述第一设备为主设备,所述第二设备为从设备;
    若所述第一设备的设备类型与所述第二设备的设备类型相同,所述第一设备的续航能力与所述第二设备的续航能力相同,所述第一设备的硬件能力与所述第二设备的硬件能力相同,所述第一设备的协议版本高于与所述第二设备的协议版本,则所述第一设备为主设 备,所述第二设备为从设备;
    若所述第一设备的设备类型与所述第二设备的设备类型相同,所述第一设备的续航能力与所述第二设备的续航能力相同,所述第一设备的硬件能力与所述第二设备的硬件能力相同,所述第一设备的协议版本与所述第二设备的协议版本相同,所述第一设备连接的设备数高于所述第二设备连接的设备数,所述第一设备为主设备,则所述第二设备为从设备;或者,
    若所述第一设备的设备类型与所述第二设备的设备类型相同,所述第一设备的续航能力与所述第二设备的续航能力相同,所述第一设备的硬件能力与所述第二设备的硬件能力相同,所述第一设备的协议版本与所述第二设备的协议版本相同,所述第一设备连接的设备数与所述第二设备连接的设备数相同,则按位比较MAC地址,所述第一设备的MAC地址高于所述第二设备的MAC地址,所述第一设备为主设备,所述第二设备为从设备。
  6. 如权利要求3-5任一所述的方法,其特征在于,所述第一设备为主设备,所述方法还包括:
    所述第一设备周期性地发送时间同步帧,所述时间同步帧携带用于各从设备时间同步的时间信息和基本服务集标识符BSSID,所述BSSID用于指示所述多个设备所在系统的身份标识信息。
  7. 如权利要求3-6任一项所述的方法,其特征在于,所述第一设备为从设备,所述方法还包括:
    所述第一设备广播时间同步请求消息,所述时间同步请求消息用于请求与所述多个设备所在系统内的完成时间同步的设备进行时间同步;
    所述第一设备接收来自第三设备的响应消息,所述响应消息携带所述第三设备的时间信息以及时域位置,所述时域位置用于指示所述多个设备相互发现过程中交互信息的时域位置;
    所述第一设备根据所述响应信息中的时间信息完成时间预同步,并在所述时域位置监听来自所述第三设备的action信令帧,完成最终同步。
  8. 一种电子设备,其特征在于,所述电子设备包括存储器及与所述存储器耦合的至少一个处理器,以收发器;所述存储器用于存储指令,所述至少一个处理器用于执行所述指令;其中,所述收发器,用于发送第一消息,以及接收来自一个或多个设备的第二消息,所述第一消息用于发现其他设备,所述第二消息为针对所述第一消息的响应消息;
    所述至少一个处理器执行所述指令时使得所述电子设备执行:基于一个或多个所述第二消息确定与所述一个或多个设备中的第二设备建立连接;
    和所述第二设备协商用于所述电子设备和所述第二设备之间建立直连通信的链路信息,并基于所述链路信息与所述第二设备建立直连通信连接。
  9. 如权利要求8所述的电子设备,其特征在于,所述第二消息包括业务能力信息,所述业务能力信息用于指示设备是否能够支持所述电子设备要进行的业务,所述处理器具体用于:获取所述一个或多个第二消息分别携带的业务能力信息;
    根据所获取的业务能力信息从所述一个或多个设备中确定能够支持所述电子设备要进行的业务的设备为所述第二设备;
    所述第一设备确定与所述第二设备建立连接。
  10. 如权利要求8或9所述的电子设备,其特征在于,所述收发器还用于:
    发送所述电子设备的优先级排序RP,所述RP可用于指示所述电子设备的优先级,用于确定所述电子设备所在系统中的主设备,所述系统中除所述主设备之外的设备为从设备;
    接收来自所述一个或多个设备各自的RP,并基于接收的一个或多个RP确定所述主设备。
  11. 如权利要求10所述的电子设备,其特征在于,所述RP包括第一部分和第二部分,所述第一部分用于指示所述电子设备的身份信息,所述第二部分用于指示所述电子设备的优先级信息,所述优先级信息包括如下信息的一种或多种:
    设备等级、设备的协议版本号,或设备所连接的设备数量,所述设备等级包括设备的类型、设备的续航能力和设备的硬件能力的一种或多种。
  12. 如权利要求11所述的电子设备,其特征在于,所述处理器具体用于按照预设规则,基于接收的一个或多个RP确定所述主设备,所述预设规则满足:
    若所述电子设备的设备类型高于所述第二设备的设备类型,则所述电子设备为主设备,所述第二设备为从设备;
    若所述电子设备的设备类型与所述第二设备的设备类型相同,所述电子设备的续航能力高于所述第二设备的续航能力,则所述电子设备为主设备,所述第二设备为从设备;
    若所述电子设备的设备类型与所述第二设备的设备类型相同,所述电子设备的续航能力与所述第二设备的续航能力相同,所述电子设备的硬件能力高于所述第二设备的硬件能力,则所述电子设备为主设备,所述第二设备为从设备;
    若所述电子设备的设备类型与所述第二设备的设备类型相同,所述电子设备的续航能力与所述第二设备的续航能力相同,所述电子设备的硬件能力与所述第二设备的硬件能力相同,所述电子设备的协议版本高于与所述第二设备的协议版本,则所述电子设备为主设备,所述第二设备为从设备;
    若所述电子设备的设备类型与所述第二设备的设备类型相同,所述电子设备的续航能力与所述第二设备的续航能力相同,所述电子设备的硬件能力与所述第二设备的硬件能力相同,所述电子设备的协议版本与所述第二设备的协议版本相同,所述电子设备连接的设备数高于所述第二设备连接的设备数,所述电子设备为主设备,则所述第二设备为从设备;或者,
    若所述电子设备的设备类型与所述第二设备的设备类型相同,所述电子设备的续航能力与所述第二设备的续航能力相同,所述电子设备的硬件能力与所述第二设备的硬件能力相同,所述电子设备的协议版本与所述第二设备的协议版本相同,所述电子设备连接的设备数与所述第二设备连接的设备数相同,则按位比较MAC地址,所述电子设备的MAC地址高于所述第二设备的MAC地址,所述电子设备为主设备,所述第二设备为从设备。
  13. 如权利要求10-12任一项所述的电子设备,其特征在于,所述电子设备为主设备,所述收发器还用于:
    周期性地发送时间同步帧,所述时间同步帧携带用于各从设备时间同步的时间信息和基本服务集标识符BSSID,所述BSSID用于指示所述多个设备所在系统的身份标识信息。
  14. 如权利要求10-13任一项所述的电子设备,其特征在于,所述电子设备为从设备,所述收发器还用于:
    广播时间同步请求消息,所述时间同步请求消息用于请求与所述多个设备所在系统内的完成时间同步的设备进行时间同步;
    接收来自第三设备的响应消息,所述响应消息携带所述第三设备的时间信息以及时域位置,所述时域位置用于指示所述多个设备相互发现过程中交互信息的时域位置;
    根据所述响应信息中的时间信息完成时间预同步,并在所述时域位置监听来自所述第三设备的action信令帧,完成最终同步。
  15. 一种分布式系统,其特征在于,包括多个如权利要求8-14任一项的电子设备。
  16. 一种芯片,其特征在于,所述芯片包括处理器和接口,所述接口用于与所述处理器通信以及接收来自其他设备的信息;所述处理器用于执行如权利要求1-7任一项所述的方法。
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令在被电子设备调用时,使所述电子设备执行如权利要求1至7任一项所述的方法。
PCT/CN2022/085797 2021-04-30 2022-04-08 一种多设备建立连接的方法及设备 WO2022228083A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22794554.0A EP4311282A4 (en) 2021-04-30 2022-04-08 METHOD FOR ESTABLISHING A CONNECTION BETWEEN MULTIPLE DEVICES AND DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110478504.4 2021-04-30
CN202110478504.4A CN115278611A (zh) 2021-04-30 2021-04-30 一种多设备建立连接的方法及设备

Publications (1)

Publication Number Publication Date
WO2022228083A1 true WO2022228083A1 (zh) 2022-11-03

Family

ID=83744944

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/085797 WO2022228083A1 (zh) 2021-04-30 2022-04-08 一种多设备建立连接的方法及设备

Country Status (3)

Country Link
EP (1) EP4311282A4 (zh)
CN (1) CN115278611A (zh)
WO (1) WO2022228083A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074982A (zh) * 2023-04-06 2023-05-05 深圳开鸿数字产业发展有限公司 网络连接方法、主终端设备及存储介质
CN116512823A (zh) * 2023-07-03 2023-08-01 深圳市领世达科技有限公司 一种可对多个胎压传感器快速无线编程的方法及编程装置
CN117134848A (zh) * 2023-01-20 2023-11-28 荣耀终端有限公司 通道建立方法、设备及存储介质
WO2024139103A1 (zh) * 2022-12-29 2024-07-04 中兴通讯股份有限公司 设备交互方法和系统、电子设备、存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116843330A (zh) * 2022-11-11 2023-10-03 深圳金融科技研究院(中国人民银行金融科技研究院) 支付方法、装置、设备及存储介质
CN117135767B (zh) * 2023-10-24 2024-04-12 荣耀终端有限公司 一种设备间的连接方法及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120151089A1 (en) * 2010-12-08 2012-06-14 Atheros Communications, Inc. Direct data communication in a peer-to-peer network
CN110178389A (zh) * 2019-04-09 2019-08-27 北京小米移动软件有限公司 直连通信的参数确定方法、装置、终端及可读存储介质
CN112312586A (zh) * 2019-08-02 2021-02-02 Oppo广东移动通信有限公司 WiFi直连连接的建立方法、装置、设备及存储介质
CN110121902B (zh) * 2016-12-28 2021-02-12 华为技术有限公司 一种通信建立的方法及终端

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6599541B2 (ja) * 2015-07-30 2019-10-30 エルジー エレクトロニクス インコーポレイティド 無線通信システムにおいてアプリケーションサービスプラットホームセッション形成方法及び装置
US10542410B2 (en) * 2015-09-02 2020-01-21 Lg Electronics Inc. Method and device for exchanging connection capability information in wireless communication system
CN111386749A (zh) * 2018-10-25 2020-07-07 三星电子株式会社 用于在基础设施链路上建立点对点服务会话的方法
CN114679708A (zh) * 2020-12-25 2022-06-28 华为技术有限公司 通信方法、系统及电子设备
CN115278831A (zh) * 2021-04-30 2022-11-01 华为技术有限公司 一种休眠调度方法及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120151089A1 (en) * 2010-12-08 2012-06-14 Atheros Communications, Inc. Direct data communication in a peer-to-peer network
CN110121902B (zh) * 2016-12-28 2021-02-12 华为技术有限公司 一种通信建立的方法及终端
CN110178389A (zh) * 2019-04-09 2019-08-27 北京小米移动软件有限公司 直连通信的参数确定方法、装置、终端及可读存储介质
CN112312586A (zh) * 2019-08-02 2021-02-02 Oppo广东移动通信有限公司 WiFi直连连接的建立方法、装置、设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4311282A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024139103A1 (zh) * 2022-12-29 2024-07-04 中兴通讯股份有限公司 设备交互方法和系统、电子设备、存储介质
CN117134848A (zh) * 2023-01-20 2023-11-28 荣耀终端有限公司 通道建立方法、设备及存储介质
CN116074982A (zh) * 2023-04-06 2023-05-05 深圳开鸿数字产业发展有限公司 网络连接方法、主终端设备及存储介质
CN116512823A (zh) * 2023-07-03 2023-08-01 深圳市领世达科技有限公司 一种可对多个胎压传感器快速无线编程的方法及编程装置
CN116512823B (zh) * 2023-07-03 2023-08-29 深圳市领世达科技有限公司 一种可对多个胎压传感器快速无线编程的方法及编程装置

Also Published As

Publication number Publication date
CN115278611A (zh) 2022-11-01
EP4311282A4 (en) 2024-08-07
EP4311282A1 (en) 2024-01-24

Similar Documents

Publication Publication Date Title
WO2022228083A1 (zh) 一种多设备建立连接的方法及设备
WO2021004381A1 (zh) 一种投屏显示方法及电子设备
WO2021082829A1 (zh) 蓝牙连接方法及相关装置
WO2021185141A1 (zh) Wi-Fi Aware的建链方法、系统、电子设备和存储介质
WO2020133183A1 (zh) 音频数据的同步方法及设备
EP4084486B1 (en) Cross-device content projection method, and electronic device
WO2022228085A1 (zh) 一种休眠调度方法及设备
WO2021175300A1 (zh) 数据传输方法、装置、电子设备和可读存储介质
WO2021258809A1 (zh) 数据同步方法、电子设备和计算机可读存储介质
WO2022068513A1 (zh) 无线通信方法和终端设备
WO2022083386A1 (zh) 投屏方法、系统及电子设备
WO2022143071A1 (zh) 连接建立方法及电子设备
WO2022052731A1 (zh) 传输数据的方法和电子设备
CN114679708A (zh) 通信方法、系统及电子设备
WO2021027623A1 (zh) 一种设备能力发现方法及p2p设备
WO2022042265A1 (zh) 通信方法、终端设备及存储介质
WO2021043250A1 (zh) 一种蓝牙通信方法及相关装置
WO2021185300A1 (zh) 基于业务类型调整数据传输策略的芯片、设备以及方法
WO2022143508A1 (zh) 一种近场中传输数据的方法、设备及系统
WO2022228051A1 (zh) 一种设备组网方法、电子设备及存储介质
WO2022262387A1 (zh) 音量管理的方法及电子设备
WO2022143156A1 (zh) 一种加密通话方法、装置、终端及存储介质
WO2024149146A1 (zh) 组网设备通信的方法以及电子设备
WO2023051204A1 (zh) 跨设备连接方法、电子设备及存储介质
WO2024007998A1 (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: 22794554

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022794554

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022794554

Country of ref document: EP

Effective date: 20231018

NENP Non-entry into the national phase

Ref country code: DE