Distributed service transmission method and communication device
By obtaining dual-ended role and capability information, determining the transmission strategy of WiFi point-to-point connections, it solves the problem that GC devices cannot establish distributed service connections with other devices, and improves transmission success rate and system flexibility.
Patent Information
- Application Number
- CN202310979972.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
In WiFi point-to-point connection, the client (GC) device in the group cannot establish a distributed service connection with other devices, resulting in the failure of distributed service transmission.
By obtaining dual-ended role information and capability information, it is determined to determine the transmission strategy, including reusing existing connections, disconnecting existing connections and re-establishing, or directly establishing new connections to improve the success rate of distributed service transmission.
It improves the probability of successful transmission of distributed services through point-to-point connections through WiFi, and enhances the flexibility and reliability of the system.
Smart Images

Figure CN119450810A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a distributed service transmission method and a communication device. Background Art
[0002] WiFi point-to-point (wireless fidelity peer-to-peer) is also called WiFi direct (wireless fidelity direct). ) Alliance launched the "WiFi DIRECT" standard protocol. WiFi point-to-point connection can support two WiFi devices to connect and communicate directly with each other without the intervention of WiFi hotspots. WiFi point-to-point connection can support the interconnection between electronic devices and high-speed data transmission, and is widely used in distributed services (such as data sharing, multicasting, etc.).
[0003] WiFi point-to-point connections include P2P (peer-to-peer) connections, HML (Huawei Magneto Link) or AWDL (Apple Wireless Direct Link). After the P2P connection is established, the group owner (GO) / group client (GC) role of the device in the P2P connection is fixed. A GO device can be connected to multiple GC devices at the same time, but a GC device can only be connected to one GO device at the same time and cannot be connected to other devices, that is, the GC device cannot initiate new distributed services or receive distributed services from other devices. Therefore, when it is necessary to transmit distributed services via WiFi point-to-point connection, the transmission may fail. Summary of the invention
[0004] The embodiments of the present application provide a distributed service transmission method and a communication device for improving the probability of successful transmission of distributed services.
[0005] In a first aspect, a distributed service transmission method is provided, which can be applied to a first device, where the first device is, for example, a sending end of a distributed service, and the method includes: responding to a first operation of a first user, where the first operation is used to indicate transmission of a first distributed service via a WiFi point-to-point connection; sending first role information and / or first capability information, and receiving second role information and / or second capability information from a second device, where the capability information is used to indicate whether connection with at least two devices is supported, and the role information is used to indicate a group manager GO or a group client GC; determining a transmission strategy for transmitting the first distributed service between the first device and the second device via the WiFi point-to-point connection based on the first role information and / or first capability information, and the second role information and / or second capability information.
[0006] In an embodiment of the present application, the transmission strategy of the distributed service is determined based on the role information and / or capability information of both ends. Compared with the transmission strategy of the distributed service determined only based on its own role, the transmission strategy of the distributed service determined in the embodiment of the present application is more accurate and comprehensive, which helps to improve the probability of successful transmission of the distributed service.
[0007] In a possible implementation, the transmission strategy of the first distributed service includes one of the following items: transmitting the first distributed service through an existing WiFi point-to-point connection between the first device and the second device; disconnecting the existing WiFi point-to-point connection of the first device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; disconnecting the existing WiFi point-to-point connection of the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; disconnecting the existing WiFi point-to-point connection between the first device and the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; or, the first device and the second device establish a WiFi point-to-point connection to transmit the first distributed service.
[0008] In the above technical solution, when determining the transmission strategy of the first distributed service initiated by the first device according to the role information and / or capability information of both ends, if the role information of both ends indicates that the first device and the second device are the GC and GO of the same group, it is determined that the first device and the second device can reuse the existing WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; if the first role information indicates that the first device is a GC device of the first group, and the second role information indicates that the second device is a GO device of the second group or the second device has no second role information (the absence of the second role information can, for example, indicate that the second device has not established a P2P connection with other devices, that is, the second device has no role), it is determined that the first device needs to disconnect the current WiFi point-to-point connection and needs to establish a WiFi point-to-point connection to transmit the first distributed service; if the first role information indicates that the first device is a GO device of the first group or the first device has no role, the second role information Indicates that the second device is a GC device of the second group, then it is determined that the second device needs to disconnect the current WiFi point-to-point connection, and needs to establish a WiFi point-to-point connection to transmit the first distributed service; if the first role information indicates that the first device is a GC (GO) device, and the second role information indicates that the second device is a GC (GO) device, then it is determined that the existing WiFi point-to-point connection of the first device needs to be disconnected, and the existing WiFi point-to-point connection of the second device needs to be disconnected, and a WiFi point-to-point connection needs to be established to transmit the first distributed service; if the capability information of both ends indicates that both the first device and the second device support connection with at least two devices, or the first role information indicates that the first device is a GO device and the second role information indicates that the second device has no role, or the first role information indicates that the first device has no role and the second role information indicates that the second device is a GO, then it is determined that the first device and the second device can establish a WiFi point-to-point connection to transmit the first distributed service.
[0009] In a possible implementation, the method further includes: if the transmission strategy of the first distributed service includes disconnecting an existing WiFi point-to-point connection of the first device, displaying first information, the first information being used to indicate whether to disconnect the existing WiFi point-to-point connection; and in response to a second operation of the first user to disconnect the existing WiFi point-to-point connection, disconnecting the existing WiFi point-to-point connection of the first device.
[0010] In the above technical solution, if it is determined that the existing WiFi point-to-point connection needs to be disconnected, the first device can also display information to allow the user to confirm whether it needs to be disconnected, thereby reducing the probability of interruption of higher priority distributed services and improving user experience.
[0011] In a possible implementation, the method further includes: if the transmission strategy of the first distributed service includes disconnecting an existing WiFi point-to-point connection of the second device, sending second information to the second device, the second information being used to instruct the second device to disconnect the existing WiFi point-to-point connection; and receiving response information from the second device, the response information being used to indicate that the second device has disconnected the existing WiFi point-to-point connection.
[0012] In the above technical solution, when the receiving end needs to disconnect the existing WiFi point-to-point connection, a second message is sent to the second device to instruct the second device to disconnect the existing WiFi point-to-point connection, which helps to increase the probability of successfully establishing the WiFi point-to-point connection between the first device and the second device.
[0013] In a possible implementation manner, the second information is carried in a signaling connection established between the first device and the second device.
[0014] In the above technical solution, the efficiency of establishing a new WiFi point-to-point connection can be improved by instructing the receiving end to disconnect the existing WiFi point-to-point connection through existing signaling (for example, signaling transmitted for encrypting the signaling channel).
[0015] In a possible implementation, the first role information and / or the first capability information is carried in a broadcast message of the first device, and the broadcast message is used to discover a device for establishing a signaling connection; or, the first role information and / or the first capability information is carried in a signaling connection established between the first device and the second device.
[0016] In the above technical scheme, carrying the role information and / or capability information in the broadcast message can be applicable to application scenarios where the first device and the second device have not established a signaling connection, while carrying the role information and / or capability information in the signaling connection established between the first device and the second device can be applicable to scenarios where the first device and the second device have established a signaling connection, and to scenarios where the first device and the second device belong to a networked "super terminal".
[0017] In a second aspect, a distributed service transmission method is provided, which can be applied to a second device, which is, for example, a receiving end of a distributed service, and the method includes: receiving first role information and / or first capability information from a first device, wherein the first role information and / or first capability information is sent by the first device in response to a first operation of a first user, wherein the first operation is used to indicate the transmission of a first distributed service via a wireless fidelity WiFi point-to-point connection, and the capability information is used to indicate whether connection with at least two devices is supported, and the role information is used to indicate a group manager GO or a group client GC; sending second role information and / or second capability information, wherein the capability information is used to indicate whether connection with at least two devices is supported, and the role information is used to indicate a group manager GO or a group client GC; determining a transmission strategy for transmitting the first distributed service between the second device and the first device via a WiFi point-to-point connection based on the first role information and / or first capability information, and the second role information and / or second capability information.
[0018] In a possible implementation, the transmission strategy of the first distributed service includes one of the following items: transmitting the first distributed service through an existing WiFi point-to-point connection between the first device and the second device; disconnecting the existing WiFi point-to-point connection of the first device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; disconnecting the existing WiFi point-to-point connection of the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; disconnecting the existing WiFi point-to-point connection between the first device and the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; or, the first device and the second device establish a WiFi point-to-point connection to transmit the first distributed service.
[0019] In a possible implementation, the method further includes: receiving second information from the first device, the second information being used to instruct the second device to disconnect an existing WiFi point-to-point connection; displaying first information, the first information being used to indicate whether to disconnect the existing WiFi point-to-point connection; disconnecting the existing WiFi point-to-point connection of the second device in response to a second operation of the second user to disconnect the existing WiFi point-to-point connection of the first device; and sending response information to the first device, the response information being used to indicate that the second device has disconnected the existing WiFi point-to-point connection.
[0020] In a possible implementation manner, the second information is carried in a signaling connection established between the first device and the second device.
[0021] In a possible implementation, the second role information and / or the second capability information is carried in a broadcast message of the second device, and the broadcast message is used to discover a device for establishing a signaling connection; or, the second role information and / or the second capability information is carried in a signaling connection established between the first device and the second device.
[0022] In a third aspect, a communication device is provided, which may be an electronic device, or a chip or chip system used in an electronic device. The communication device includes a communication interface and a processor, and optionally, a memory. The memory is used to store a computer program, and the processor is coupled to the memory and the communication interface. When the processor reads the computer program or instruction, the communication device executes the method executed by the first device in the first aspect or the method executed by the second device in the second aspect.
[0023] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store a computer program. When the computer program is run on a computer, the computer executes the method provided in the first aspect or the second aspect above.
[0024] According to a fifth aspect, a computer program product is provided, comprising a computer program. When the computer program is run on a computer, the computer is enabled to execute the method described in the first aspect or the second aspect.
[0025] In a sixth aspect, a chip system is provided, comprising a processor and an interface, wherein the processor is used to call and execute instructions from the interface so that the chip system implements the method described in the first aspect or the second aspect above.
[0026] For the beneficial effects of the second to sixth aspects mentioned above, refer to the beneficial effects of the first aspect and will not be repeated. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a communication system applicable to an embodiment of the present application;
[0028] Figure 2 A schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application;
[0029] Figure 3 A software system architecture diagram provided for an embodiment of the present application;
[0030] Figure 4 is a schematic diagram of a P2P connection;
[0031] Figure 5 A flowchart of a distributed service transmission method provided in an embodiment of the present application;
[0032] Figure 6 A schematic diagram of a display interface provided in an embodiment of the present application;
[0033] Figure 7 Another display interface diagram provided in an embodiment of the present application;
[0034] Figure 8 A flowchart of an example of a distributed service transmission method provided in an embodiment of the present application;
[0035] Fig. 9 A flowchart of another example of a distributed service transmission method provided in an embodiment of the present application;
[0036] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0038] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0039] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0040] Please refer to Figure 1 , which is a schematic diagram of a communication system applicable to an embodiment of the present application. The communication system may include various electronic devices, which can support WiFi point-to-point connection and realize the transmission of distributed services based on WiFi point-to-point connection. Among them, the electronic device may include, for example, a mobile phone 11, a tablet computer 12, a large-screen device 13, etc. The embodiment of the present application does not specifically limit the type of electronic device (such as a mobile phone 11, a tablet computer 12 or a large-screen device 13). Optionally, the communication system 10 may also include other devices, such as smart home devices and other Internet of Things (IOT) devices, etc., Figure 1 Not shown in FIG.
[0041] Exemplarily, the electronic device in the embodiments of the present application may be a mobile phone, a wearable device (such as a smart bracelet, a smart watch, a headset, etc.), a tablet computer, a handheld computer, a netbook, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a cellular phone, a personal digital assistant (PDA), an augmented reality (AR)\virtual reality (VR) device, etc., and may also be a television, a large screen, a speaker, a refrigerator, an air conditioner, a vehicle-mounted device (also referred to as a vehicle computer), a printer, a projector, etc. Exemplary embodiments of electronic devices include but are not limited to devices equipped with Or devices with other operating systems.
[0042] Each electronic device in the communication system can be connected to form a near field communication network through WiFi point-to-point (such as P2P, HML or AWDL) and other connection methods. WiFi point-to-point means that devices can be connected point-to-point based on short-distance communication and other methods without relying on a local area network.
[0043] After multiple (two or more) electronic devices establish a WiFi point-to-point connection, they become electronic devices in a network. In a network, different electronic devices can perform their own services, or services can be distributed on different electronic devices. For example, Figure 1The various electronic devices shown constitute a network, and the mobile phone 11 can synchronize the video it plays to the large-screen device 13 for playback via WiFi point-to-point connection in the form of screen projection; the mobile phone 11 can also transfer the photos it stores to the tablet computer 12 via WiFi point-to-point connection to realize file sharing.
[0044] In some embodiments, a trust relationship can be established between different electronic devices in the network to implement distributed services. This trust relationship can be established in the discovery phase of the WiFi point-to-point connection initialization process. Optionally, the trust relationship between electronic devices can be established based on a common account. For example, if the mobile phone 11 and the tablet computer 12 are logged in to the same account, the mobile phone 11 can be directly bound to the tablet computer 12 to establish a trust relationship, for example, directly clicking the binding button corresponding to the tablet computer 12 on the mobile phone 11 without waiting for the confirmation of the tablet computer 12. The trust relationship between electronic devices can also be established based on an associated account.
[0045] Multiple electronic devices that have a trust relationship in a network can be called "super terminals". Figure 1 In the architecture shown, the mobile phone 11, the tablet computer 12 and the large-screen device 13 are all logged into the same account, so the network composed of the mobile phone 11, the tablet computer 12 and the large-screen device 13 is called a "super terminal".
[0046] Please refer to Figure 2 , is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be Figure 1 The mobile phone 11 or tablet computer 12 or large-screen device 13 in the illustrated architecture, or other electronic devices that can be used in the above architecture.
[0047] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a wireless communication module 150, a sensor module 160, etc.
[0048] The structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.
[0049] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor, a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. The controller may generate an operation control signal based on the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0050] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device.
[0051] The interface connection relationship between the modules illustrated in the embodiment of the present application is only an illustrative description and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0052] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2 and the wireless communication module 150.
[0053] The wireless communication module 150 can provide wireless communication solutions including WiFi, Bluetooth (BT), wireless data transmission modules (for example, 433MHz, 868MHz, 915MHz) applied to the electronic device 100. The wireless communication module 150 can be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via antenna 1 and / or antenna 2, filters and frequency modulates the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through antenna 1 and / or antenna 2.
[0054] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0055] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can enable the electronic device 100 to perform the distributed service transmission method provided in some embodiments of the present application, as well as various applications and data processing, etc. by running the above instructions stored in the internal memory 121. The internal memory 121 may include a code storage area and a data storage area. Among them, the code storage area can store an operating system. The data storage area can store data created during the use of the electronic device 100, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, a flash memory component, a universal flash storage (UFS), etc. In some embodiments, the processor 110 can enable the electronic device 100 to perform the distributed service transmission method provided in the embodiment of the present application, as well as other applications and data processing by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor 110.
[0056] Please refer to Figure 3, is a software system architecture diagram provided in an embodiment of the present application, and the system architecture mainly includes from bottom to top: hardware layer, hardware abstraction layer (HAL), application framework layer (Framework), and application layer. In addition, between the application layer and the application framework layer, there are also soft bus and WiFi extension interface (WiFi EXT). Among them, the soft bus and WiFi EXT can also be regarded as components of the application framework layer.
[0057] Applications in the application layer (such as Figure 3 The "Huawei Share" application, "Screen Casting" application and "Multi-screen Collaboration" application in the framework are some applications that users can directly access using the Framework interface. They run on electronic devices and are windows for users to interact with electronic devices.
[0058] The soft bus includes a WiFi functional module that can provide services such as WiFi device discovery, WiFi connection, networking, as well as tasks and data buses.
[0059] WiFi EXT provides WiFi extension interface functions to enhance WiFi interface functions so that the application layer can call WiFi related services provided by the Framework.
[0060] Framework is some system capabilities running on the operating system of electronic devices. Taking the Android open source project (AOSP) as an example, AOSP provides some related interfaces and services for operating WiFi point-to-point, such as Figure 3 The WiFi service, WiFi point-to-point service and station (STA) service in it, wherein the WiFi point-to-point service may include, for example, a short-range service, and the interface type corresponding to the WiFi point-to-point service is a WiFi point-to-point management (Manager) type. The interface of the WiFi point-to-point management type includes: providing interfaces such as discovering devices (discoverPeers) and connecting (connect), and these interfaces can be used by users to directly control the WiFi point-to-point connection.
[0061] HAL is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms.
[0062] The hardware layer can include a variety of communication interfaces, such as Figure 3The hardware layer may also include a WiFi driver, a WiFi chip, etc. (not shown in the figure). The WiFi driver is responsible for connecting the WiFi chip to the operating system of the terminal device.
[0063] The Framework layer in the terminal device interacts with the chip through the driver. For example, taking AOSP as an example, the Framework layer uses wpa_supplicant to interact with the driver and support encryption authentication. The application layer provides several interface functions that can be directly called by developers / businesses. After the call, the chip can perform corresponding WiFi point-to-point related operations through the driver. The Framework layer itself is responsible for message forwarding and coordination between the upper-layer application and the lower-layer hardware (including wpa_supplicant, WiFiDriver, Chipset), connection management, etc.
[0064] Among them, in the P2P connection, the P2P protocol stipulates that: when two devices establish a P2P connection and maintain data communication, the roles of both parties are fixed, and other devices can no longer establish a P2P connection with the GC device. That is, in a group, there can be one GO and at least one GC. A GO can accept connections from multiple GCs, but a GC can only connect to one GO. For example, see Figure 4 , which is a schematic diagram of a P2P connection.
[0065] Among them, device A as a GC role and device B as a GO role establish a P2P connection, and device A and device B can transmit distributed service 1 through the P2P connection. Taking device A as a sending device as an example, device B can receive distributed service 1 from device A, and can also forward distributed service 1 to other devices, or device B can also initiate other distributed services to other devices (for example, device C). Among them, the connection mode between device B and device C can be a P2P connection, or it can also be other connection modes, such as upper layer transmission control protocol (TCP) connection and other connection modes.
[0066] When device A needs to initiate a distributed service to device D or receive a distributed service from device D, device A may not be able to establish a P2P connection with device D due to the limitation of the GC role of device A, resulting in the failure of the distributed service initiated by device A to device D. Device D may be a device that acts as a GC role, or a device that acts as a GO role, or a device with no role (for example, a device that has not established a P2P connection with other devices). Optionally, after the distributed service initiated by device A to device D fails, device A may display a prompt message that "The P2P channel is occupied, please turn off the wireless access point (AP) or try again after casting the screen."
[0067] It can be seen that when transmitting distributed services through P2P connections, the device acting as a GC cannot initiate distributed services to other devices, nor can it receive distributed services from other devices, resulting in failure of distributed service transmission.
[0068] In view of this, an embodiment of the present application provides a distributed service transmission method and a communication device that can implement the method, which are used to improve the probability of successful transmission of distributed services. In the distributed service transmission method provided by the embodiment of the present application, when it is necessary to initiate a distributed service, the sending end and the receiving end of the distributed service can obtain the role information and / or capability information of both ends, and determine the transmission strategy of the distributed service based on the role information and / or capability information of both ends. This is more accurate and comprehensive than the transmission strategy of the distributed service determined only based on its own role, which helps to improve the probability of successful transmission of the distributed service.
[0069] Based on the above Figure 1 The network system architecture shown and the above-mentioned related technical introductions, Figure 5 A flow chart of a distributed service transmission method provided in an embodiment of the present application is shown. Figure 5 In the description, the interaction between the first device and the second device is taken as an example. For example, the first device may be Figure 1 In the network system architecture shown in FIG. 1 , the second device may be a mobile phone 11. Figure 1 The tablet computer 12 or large screen 13 in the network system architecture shown.
[0070] S501: A first device responds to a first operation of a first user, where the first operation is used to instruct transmission of a first distributed service through a WiFi point-to-point connection.
[0071] The first user can perform a first operation on the first device to trigger the first device to establish a WiFi point-to-point connection to transmit the first distributed service to the second device. The WiFi point-to-point connection can be, for example, a P2P, HML, or AWDL connection.
[0072] The first device is Figure 1 The phone and second device in Figure 1 For example, if the first user wants to transmit the first distributed service to the second device via a WiFi point-to-point connection, the first user can Figure 6 Click the "Settings" button on the interface shown in a, and the interface displayed is as follows Figure 6 As shown in b in the figure, the first user can click Figure 6 The "WLAN Direct Connection" menu in the interface shown in b in the figure is used to trigger the establishment of a WiFi point-to-point connection. After the first user clicks the "WLAN Direct Connection" menu, a list of available devices may be displayed. The displayed interface is as follows: Figure 6 As shown in c in FIG. 1 , the available device list includes at least one device identifier, and the first user can select a receiving device (such as a second device) of the first distributed service from the available device list. Alternatively, the first user can also click Figure 3 When the first device detects the operation of the first user on the "screen casting" application, the first device can display Figure 6 The interface shown in c.
[0073] S502: The first device sends first role information and / or first capability information, and receives second role information and / or capability information from the second device.
[0074] Before the first device establishes a WiFi point-to-point connection with the second device, a signaling connection may be established first, and security authentication and group information exchange may be performed through the signaling connection. The group information is, for example, information for negotiating the roles of the first device and the second device in the group. The signaling connection may be, for example, a Bluetooth connection or other types of signaling connections. The Bluetooth connection may be, for example, a Bluetooth low energy (BLE) or Bluetooth basic rate (BR) connection. In the following embodiments, the signaling connection is an example of a Bluetooth connection. Therefore, the list of available devices displayed after the first user clicks "WLAN Direct Connection" may include at least one device that has established a Bluetooth connection with the first device, at least one device that forms a "super terminal" network with the first device, and / or a device that has not established a Bluetooth connection with the first device.
[0075] For devices that have not established a Bluetooth connection with the first device, before displaying the list of available devices, the first device can also send a broadcast message to notify the surrounding Bluetooth devices to establish a Bluetooth connection, and receive broadcast messages from the surrounding Bluetooth devices, and display the identification of the Bluetooth device that received the broadcast message in the list of available devices; for devices that have established a Bluetooth connection with the first device, and devices that form a "super terminal" network with the first device, the first device can directly establish a Bluetooth connection with them. Therefore, optionally, the first device can carry its role information and / or capability information in a broadcast message and send it; or, the first device can also carry its role information and / or capability information in the Bluetooth connection established between the first device and the second device and send it. For example, the first device can carry the first role information and / or the first capability information in a Neg_Req and send it, and the Neg_Req is, for example, a signaling message for negotiating a session key. In this way, sending the first role information and / or the first capability information through existing signaling can save signaling overhead and help improve the efficiency of establishing a WiFi point-to-point connection.
[0076] The first role information sent by the first device refers to the GC or GO role obtained through negotiation when the first device establishes a P2P connection with other devices. The first capability information sent by the first device may be, for example, information on whether it supports connection with at least two devices, determined based on the hardware parameters of the first device. When the first device establishes an HML or AWDL connection with other devices, or does not establish a WiFi point-to-point connection with any device, it indicates that the first device does not have the role information of GO and GC, so the first device may not send the role information, but only send the first capability information. When the first device establishes a P2P connection with other devices, and the role of the first device is GO, it indicates that the first device can establish a WiFi point-to-point connection with other devices, such as a P2P connection or an HML connection, so the first device may not send the capability information, but only send the first role information.
[0077] In some embodiments, the first capability information may also be determined based on the attributes of the distributed service (e.g., the first distributed service) to be transmitted by the first device, and the attribute may indicate whether the first distributed service can be transmitted together with other distributed services. Optionally, the attributes of the first distributed service may be, for example, specified by the developer of the first distributed service during development, or may be registered by the first user with the business rule layer when initiating the first distributed service. Therefore, after the user initiates the operation of initiating a distributed service on the device, the device may also display a pop-up box to confirm whether to agree to transmit it together with other distributed services, and the user may make a selection based on the pop-up box. In the embodiment of the present application, the capability information is determined based on the hardware parameters of the device as an example.
[0078] Before sending the first role information and / or the first capability information, the first device may also obtain the role information and capability information of the first device. Figure 3 The Framework shown obtains the role information of the first device from the short-distance service, and the role information may be, for example, GC, GO, or no role, and the first device may obtain the role information of the first device from the short-distance service. Figure 3 The hardware layer shown obtains the chip parameters of the first device, and determines the capability information of the first device based on the chip parameters. For example, if the chip of the first device is HiSilicon 1105, it is determined that the first device supports HML connection, that is, the capability information of the first device is to support connection with at least two devices. If the chip of the first device is HiSilicon 1102, it is determined that the first device does not support HML connection, that is, the capability information of the first device is not to support connection with at least two devices. Optionally, the first capability information sent by the first device may be, for example, whether HML connection is supported, or whether AWDL connection is supported.
[0079] Among them, the relevant description of the second device obtaining role information and capability information can refer to the relevant description of the first device obtaining role information and capability information, which will not be repeated here. The role information obtained by the second device is, for example, the second role information, and the capability information is, for example, the second capability information.
[0080] S503: The first device and the second device determine a transmission strategy for the first distributed service based on the first role information and / or the first capability information, and the second role information and / or the second capability information.
[0081] The transmission strategy of the first distributed service determined by the first device and the second device based on the role information and / or capability information of the two ends (i.e., the first device and the second device) is the same. The following is an example of the transmission strategy of the first distributed service determined by the first device. The transmission strategy of the first distributed service determined by the first device includes one of the following items:
[0082] Strategy 1: Transmit the first distributed service through an existing WiFi point-to-point connection between the first device and the second device, wherein the WiFi point-to-point connection may be, for example, a P2P connection, an HML connection, or an AWDL connection.
[0083] Strategy 2: disconnect the existing WiFi point-to-point connection of the first device, and establish a WiFi point-to-point connection with the second device to transmit the first distributed service. The WiFi point-to-point connection may be, for example, a P2P connection.
[0084] Strategy 3: disconnect the existing WiFi point-to-point connection of the second device, and the first device and the second device establish a WiFi point-to-point connection to transmit the first distributed service. The WiFi point-to-point connection may be, for example, a P2P connection.
[0085] Strategy 4: disconnect the existing WiFi point-to-point connection between the first device and the second device, and establish a WiFi point-to-point connection with the second device to transmit the first distributed service. The WiFi point-to-point connection may be, for example, a P2P connection.
[0086] Strategy 5: The first device and the second device establish a WiFi point-to-point connection to transmit the first distributed service, wherein the WiFi point-to-point connection may be, for example, a P2P connection, an HML connection, or an AWDL connection.
[0087] The above describes the transmission strategy of the first distributed service determined by the first device. The following describes an implementation manner in which the first device determines the transmission strategy of the first distributed service based on the role information and / or capability information of both ends.
[0088] Implementation method 1: The first device determines a transmission strategy for the first distributed service based on the first capability information and the second capability information.
[0089] After acquiring the first capability information and the second capability information, the first device can determine whether both ends support connection with at least two devices based on the capability information of both ends (i.e., the first device and the second device). For example, if the capability information of both ends supports HML connection, or the capability information of both ends supports AWDL connection, it is considered that both the first device and the second device support connection with at least two devices, and the first device and the second device can establish a WiFi point-to-point connection without disconnecting the existing WiFi point-to-point connection, or the first device and the second device can reuse the existing WiFi point-to-point connection between the first device and the second device. Optionally, the first device can also obtain the identifier of the device to which the first device has been connected through the WiFi point-to-point connection, and if the identifier of the device to which the first device has been connected includes the identifier of the second device, the first device can reuse the existing WiFi point-to-point connection between the first device and the second device. Wherein, the WiFi point-to-point connection is, for example, an HML connection or an AWDL connection. The transmission strategy determined by the first device based on the first capability information and the second capability information can refer to Table 1.
[0090] Table 1
[0091] First capability information Second capability information Transmission strategy Support HML Support HML Strategy 5 or Strategy 1 Support AWDL Support AWDL Strategy 5 or Strategy 1
[0092] Implementation method 2: The first device determines a transmission strategy for the first distributed service based on the first capability information and the second role information.
[0093] When the first device determines the transmission strategy of the first distributed service based on the first capability information and the second role information, it indicates that the first device may not have established a P2P connection with other devices, or the first device has established an HML connection or an AWDL connection with other devices, that is, the first device is roleless and can establish a WiFi point-to-point connection with other devices, and regardless of whether the first device supports connection with at least two devices, the first device can establish a WiFi point-to-point connection with the second device. Therefore, in this case, it can be considered that the first device is essentially a transmission strategy of the first distributed service determined based on the second role information. The transmission strategy determined by the first device based on the second role information can refer to Table 2.
[0094] Table 2
[0095] Second role information Transmission strategy GO Strategy 5 GC Strategy 3
[0096] Implementation method 3: The first device determines a transmission strategy for the first distributed service based on the first role information and the second capability information.
[0097] When the first device determines the transmission strategy of the first distributed service based on the first role information and the second capability information, it indicates that the second device may not have established a P2P connection with other devices, or the second device has established an HML connection or an AWDL connection with other devices, that is, the second device is roleless and can establish a WiFi point-to-point connection with other devices, and regardless of whether the second device supports connection with at least two devices, the second device can establish a WiFi point-to-point connection with the first device. Therefore, in this case, it can be considered that the first device is essentially a transmission strategy of the first distributed service determined based on the first role information. The transmission strategy determined by the first device based on the first role information can refer to Table 3.
[0098] Table 3
[0099] First role information Transmission strategy GO Strategy 5 GC Strategy 2
[0100] Implementation method 4: The first device determines a transmission strategy for the first distributed service based on the first role information and the second role information.
[0101] Before the first device determines the transmission strategy of the first distributed service based on the first role information and the second role information, the first device may also obtain the identifier of the device to which the first device is connected through the WiFi point-to-point connection. If the identifier of the device to which the first device is connected includes the identifier of the second device, the first device may reuse the existing WiFi point-to-point connection between the first device and the second device, wherein the WiFi point-to-point connection is a P2P connection. The transmission strategy determined by the first device based on the first role information and the second role information may refer to Table 4, in which the first device is device A and the second device is device B as an example.
[0102] Table 4
[0103]
[0104]
[0105] Implementation method 5: The first device determines a transmission strategy for the first distributed service based on the first role information, the first capability information, and the second role information.
[0106] When the first device determines the transmission strategy of the first distributed service based on the first role information, the first capability information and the second role information, it indicates that the first device has established a P2P connection and the second device has also established a P2P connection. Therefore, regardless of whether the first capability information indicates support for connection with at least two devices, it can be considered that the first device is essentially a transmission strategy for the first distributed service determined based on the first role information and the second role information. Therefore, the transmission strategy determined by the first device based on the first role information, the first capability information and the second role information is shown in Table 4.
[0107] Implementation method 6: The first device determines a transmission strategy for the first distributed service based on the first capability information, the second role information, and the second capability information.
[0108] If the first device determines that both terminals can coexist based on the first capability information and the second capability information, the determined transmission strategy is as shown in Table 1.
[0109] When the capability information of both ends is as follows, it can be determined that the two ends cannot coexist:
[0110] Case A: the first capability information indicates that the HML connection is supported, and the second capability information indicates that the AWDL connection is supported, or the second capability information indicates that the HML connection is not supported.
[0111] Case B: the first capability information indicates that AWDL connection is supported, and the second capability information indicates that HML connection is supported, or the second capability information indicates that ADWL connection is not supported.
[0112] Case C: the first capability information indicates that HML connection is not supported or the first capability information indicates that AWDL connection is not supported, and the second capability information indicates that HML connection is not supported or the first capability information indicates that AWDL connection is not supported.
[0113] If it is determined based on the first capability information and the second capability information that the two ends cannot coexist, it indicates that the first device and the second device need to transmit the first distributed service through a P2P connection. In addition, since there is no first role information, it indicates that the first device has not established a P2P connection with other devices, that is, it can establish a P2P connection with other devices. Therefore, in this case, the first device actually determines the transmission strategy of the first distributed service based on the second role information, and the determined transmission strategy is shown in Table 2.
[0114] Implementation method 7: The first device determines a transmission strategy for the first distributed service based on the first role information, the first capability information, the second role information, and the second capability information.
[0115] If the first device determines that both ends can coexist based on the first capability information and the second capability information, the transmission strategy is determined as shown in Table 1. If the two ends cannot coexist based on the capability information of the two ends, it indicates that the first device and the second device need to transmit the first distributed service through a P2P connection. And since the first device and the second device both have corresponding role information, it indicates that the first device and the second device have established a P2P connection. Therefore, in this case, the first device actually determines the transmission strategy of the first distributed service based on the first role information and the second role information, and the determined transmission strategy is shown in Table 4.
[0116] After introducing the implementation method of determining the transmission strategy of the first distributed service, the following introduces the method of transmitting the first distributed service using different transmission strategies.
[0117] If the transmission strategy of the first distributed service determined by the first device is strategy 1, it indicates that the first device can reuse the P2P connection between the first device and the second device to transmit the first distributed service. Therefore, the first device can transmit the first distributed service to the second device through the existing P2P connection.
[0118] If the transmission strategy of the first distributed service determined by the first device is strategy 2, the first device may display the first information. For example, the first device may display Figure 7 The first user can use the interface shown in the figure to Figure 7 The interface shown confirms whether to disconnect the existing WiFi point-to-point connection. When the first device detects the operation of the first user confirming to disconnect the existing WiFi point-to-point connection, it disconnects the existing WiFi point-to-point connection (for example, the P2P connection between the first device and the third device). After the first device disconnects the existing WiFi point-to-point connection, S504 can be executed.
[0119] If the first device determines that the transmission strategy of the first distributed service is strategy 3, the first device may send a second message to the second device to instruct the second device to disconnect the existing P2P connection. When the second device receives the second message, it may display the first message. For example, the second device may display Figure 7 The second user can use the interface shown in Figure 7 The interface shown confirms whether to disconnect the existing P2P connection. When the second device detects that the second user confirms the operation of disconnecting the existing P2P connection, it disconnects the existing P2P connection (for example, the P2P connection between the second device and the third device) and sends a response message to the first device to indicate that the second device has disconnected the existing P2P connection. After receiving the response message, the first device can execute S504.
[0120] If the first device determines that the transmission strategy of the first distributed service is strategy 4, the first device may display the first information. For example, the first device may display the following information: Figure 7 The first user can use the interface shown in the figure to Figure 7 The interface shown confirms whether to disconnect the existing P2P connection. When the first device detects that the first user confirms the operation of disconnecting the existing P2P connection, it disconnects the existing P2P connection, and after disconnecting the existing P2P connection, it sends a second message to the second device to instruct the second device to disconnect the existing P2P connection. When the second device receives the second message, it can display the first message. For example, the second device can display Figure 7 The second user can use the interface shown in Figure 7 The interface shown confirms whether to disconnect the existing P2P connection. When the second device detects that the second user confirms the operation of disconnecting the existing P2P connection, it disconnects the existing P2P connection (for example, the P2P connection between the second device and the third device) and sends a response message to the first device to indicate that the second device has disconnected the existing P2P connection. After receiving the response message, the first device can execute S504.
[0121] If the first device determines that the transmission policy of the first distributed service is policy 5, the first device may execute S504.
[0122] Optionally, the second information can be carried in a Bluetooth connection established between the first device and the second device. For example, if the first role information and / or the first capability information are carried in a broadcast message of the first device, the first device can carry the second information in a Bluetooth connection of the related information sent by the first device to the second device for encryption. For example, the first device can carry the second information in a Neg_Req, so that sending the second information through existing signaling can save signaling overhead and help improve the efficiency of P2P connection establishment.
[0123] Optionally, after establishing the Bluetooth connection, the first device and the second device may also negotiate a session key based on the Bluetooth connection, and the session key is used to encrypt the transmitted information. In addition, the first device and the second device may also send their respective media access control addresses (MAC), statuses, supported channel lists, operating channel attributes, and other information to the peer device through the Bluetooth connection.
[0124] S504: The first device establishes a P2P connection with the second device. S504 is an optional step. Figure 5 Indicated by dotted line.
[0125] If the transmission strategy of the first distributed service is strategy 2, strategy 3, strategy 4, or strategy 5, and the WiFi point-to-point connection that needs to be established in strategy 5 is a P2P connection, the first device and the second device may also negotiate the roles of the first device and the second device through a Bluetooth connection before establishing the P2P connection. For example, the first device and the second device may send their respective remaining power through a Bluetooth connection, and after knowing the remaining power of both parties, the first device and the second device may determine the GO device and the GC device in the P2P connection based on the remaining power. For example, the first device and the second device may determine that the device with more remaining power is the GO device (the device with more remaining power is, for example, the first device), and the device with less remaining power is the GC device (the device with less remaining power is, for example, the second device).
[0126] After negotiating the roles of the transmitting device and the receiving device, the GO (i.e., the first device) can create a group and initiate a process of establishing a P2P connection to establish a P2P connection. An implementation of the P2P connection establishment process can refer to the WiFi DIRECT protocol, which is not limited in the present embodiment.
[0127] In the above technical solution, when the first device initiates the first distributed service, it can determine whether the currently existing WiFi point-to-point connection can be reused and whether it is necessary to establish a WiFi point-to-point connection based on the role information and / or capability information of the first device and the second device. If it is determined that a WiFi point-to-point connection needs to be established, it can also be determined whether to directly establish the WiFi point-to-point connection or whether the first device and / or the second device need to disconnect the existing WiFi point-to-point connection before establishing the WiFi point-to-point connection. In this way, the probability of the distributed service being transmitted being disconnected can be reduced, and the probability of the successful transmission of the first distributed service can be increased.
[0128] As follows Figure 8 and Fig. 9 Two embodiments are introduced. Figure 5 The distributed service transmission method introduced in the illustrated embodiment is applied to two examples in different scenarios. In these two examples, it is taken that the signaling connection established between the first device and the second device is a Bluetooth connection.
[0129] Please refer to Figure 8 ,for Figure 5 The illustrated embodiment provides a flowchart of an example of a distributed service transmission method. Figure 8 The illustrated embodiment is based on a scenario where the second device has never established a Bluetooth connection with the first device.
[0130] S801: When a first device detects a first operation of a first user, a distributed service application of the first device initiates a first distributed service to a distributed framework of the first device.
[0131] Among them, the distributed business application is, for example, Figure 3 The distributed framework is as follows: Figure 3 In the Framework shown, the distributed service is, for example, the first distributed service.
[0132] S802: The distributed framework of the first device obtains the first role information of the first device from the short-distance service.
[0133] The short-distance service is a service provided by the distributed framework for short-distance communication, and can record the role information of the first device.
[0134] S803: The distributed framework of the first device sends a broadcast message and receives broadcast messages from other devices.
[0135] In this example, the broadcast message carries the role information and / or capability information of the device. For example, the broadcast message sent by the distributed framework of the first device carries the role information (for example, the first role information) and / or capability information (for example, the first capability information) of the first device. Therefore, the distributed framework can also obtain the first capability information before sending the broadcast message. Among them, the way in which the distributed framework obtains the first capability information can, for example, refer to the way in which the first device obtains the first capability information in S502, and the specific information carried in the broadcast message sent by the distributed framework can refer to the way in which the first device sends the first role information and / or first capability information in S502, which will not be repeated here. Among them, the other device includes, for example, a second device, and the second device is a receiving device for the first distributed service.
[0136] S804: The distributed framework of the first device displays a list of available devices on a display interface of the first device.
[0137] The available device list includes an identifier of the second device, and the user can click the identifier of the second device from the available device list.
[0138] S805: The distributed framework of the first device responds to the second operation of the first user on the second device identifier in the available device list.
[0139] S806: The distributed framework of the first device determines a transmission strategy of the first distributed service based on the first role information and / or the first capability information and the second role information and / or the second capability information of the second device.
[0140] Among them, after receiving the broadcast message of the first device, the distributed framework of the second device can also determine the transmission strategy of the distributed service based on the first role information and / or first capability information of the first device, and the second role information and / or second capability information of the second device. The way in which the distributed framework of the first device and the distributed framework of the second device determine the transmission strategy can refer to the way in which the first device determines the transmission strategy of the first distributed service in S503, which will not be repeated here.
[0141] Optionally, if the transmission strategy is strategy 2 or strategy 4, that is, it is necessary to disconnect the existing WiFi point-to-point connection of the first device, then S807 can be executed. If the transmission strategy is strategy 1, the first distributed service is transmitted through the existing WiFi point-to-point connection between the first device and the second device, that is, it is not necessary to execute the following steps S807 to S815. If the transmission strategy is strategy 5, that is, it is necessary to establish a WiFi point-to-point connection, then S809 can be executed.
[0142] S807: The distributed framework of the first device sends the first information to the distributed business application, and the distributed business application pops up a window to display the first information.
[0143] Among them, when it is necessary to disconnect the existing WiFi point-to-point connection of the first device, it indicates that the first device may have established a P2P connection with other devices. Taking the establishment of a P2P connection between the first device and the third device as an example, the first information may be, for example, "whether to disconnect the connection with the third device". If the first user performs a second operation to confirm the disconnection with the third device, for example, the first user selects "Yes" in the pop-up box, S808 may be executed. If the first user performs an operation to refuse to disconnect the connection with the third device, for example, the first user selects "No" in the pop-up box, a prompt message of "First distributed service transmission failed" may be displayed, and no Bluetooth connection request is initiated to the second device.
[0144] S808: The distributed framework of the first device disconnects the existing WiFi point-to-point connection.
[0145] When the distributed framework of the first device disconnects the existing WiFi point-to-point connection, it indicates that the WiFi point-to-point connection P2P connection established between the first device and the second device needs to be interrupted to transmit the existing distributed service, so the distributed framework of the first device can execute S809.
[0146] S809: The distributed framework of the first device establishes a Bluetooth connection with the distributed framework of the second device.
[0147] S810: The distributed framework of the first device sends a Neg_Req to the second device based on the Bluetooth connection.
[0148] The Neg_Req is used to transmit relevant information for negotiating a session key, as well as information such as the MAC address, status, supported channel list, and operating channel attributes of the first device.
[0149] Optionally, if the transmission strategy is strategy 2, strategy 3, strategy 4 or strategy 5, and the WiFi point-to-point connection required to be established by strategy 5 is a P2P connection, the Neg_Req may also include information for negotiating the GO / GC roles of both ends.
[0150] If the transmission strategy is strategy 3 or strategy 4, the Neg_Req may also include second information for instructing the second device to disconnect the existing WiFi point-to-point connection, and the second device executes S811 when receiving the Neg_Req from the first device. If the Neg_Req does not include the second information, the second device executes S813 when receiving the Neg_Req from the first device.
[0151] S811: The distributed framework of the second device sends the first information to the distributed business application, and the distributed business application pops up a window to display the first information.
[0152] When the existing WiFi point-to-point connection of the second device needs to be disconnected, it indicates that the first device may have established a P2P connection with other devices. Taking the establishment of a P2P connection between the second device and the third device as an example, the first information may be, for example, "whether to disconnect the connection with the third device". If the second user performs a second operation to confirm the disconnection with the third device, for example, the second user selects "yes" in the pop-up box, S812 may be executed.
[0153] S812: The distributed framework of the second device disconnects the existing WiFi point-to-point connection.
[0154] S813: The distributed framework of the second device sends Neg_Rsp to the first device based on the Bluetooth connection.
[0155] When the second device receives the Neg_Req from the first device, the distributed framework of the second device can send a response message Neg_Rsp to the first device. The Neg_Rsp is used to transmit relevant information for negotiating the session key, as well as the MAC address, status, supported channel list, operation channel attributes and other information of the second device.
[0156] Optionally, if the Neg_Req from the first device includes information for negotiating the GO / GC roles of both ends, the Neg_Rsp may also include information for negotiating the GO / GC roles of both ends. Optionally, if the roles of both ends are negotiated, S812 may be executed. In this example, it is taken as an example that the first device is negotiated as a GO device and the second device is negotiated as a GC device.
[0157] If the Neg_Req from the first device includes the second information, the Neg_Rsp may also include response information indicating that the existing WiFi point-to-point connection has been disconnected.
[0158] S814: The distributed framework of the first device creates a group.
[0159] S815: The distributed framework of the first device and the distributed framework of the second device establish a WiFi point-to-point connection.
[0160] In the above technical solution, the first device and the second device can carry their respective role information and / or capability information in the broadcast message, determine whether a WiFi point-to-point connection needs to be established before establishing a signaling connection, and complete the negotiation of the roles of both ends in the existing signaling message, which can reduce signaling overhead and increase the probability of successful transmission of distributed services.
[0161] Please refer to Fig. 9 ,for Figure 5 The illustrated embodiment provides a flowchart of another example of a distributed service transmission method. Fig. 9 The illustrated embodiment is based on a scenario in which a Bluetooth connection is established between the second device and the first device.
[0162] S901: When a first device detects a first operation of a first user, a distributed service application of the first device initiates a first distributed service to a distributed framework of the first device.
[0163] Among them, the distributed business application is, for example, Figure 3 The distributed framework is as follows: Figure 3 Framework shown.
[0164] S902: The distributed framework of the first device establishes a Bluetooth connection with the distributed framework of the second device.
[0165] S903: The distributed framework of the first device obtains the first role information from the short distance service of the first device, and the distributed framework of the second device obtains the second role information from the short distance service of the second device.
[0166] The short-distance service is a service provided by the distributed framework for short-distance communication, and can record the role information of the first device.
[0167] S904: The distributed framework of the first device sends a Neg_Req to the second device based on the Bluetooth connection, where the Neg_Req carries the first role information and / or the first capability information.
[0168] The Neg_Req is used to transmit relevant information for negotiating a session key, as well as information such as the MAC address, status, supported channel list, and operating channel attributes of the first device.
[0169] Optionally, the Neg_Req may also include information for negotiating the GO / GC roles of both ends.
[0170] S905: The distributed framework of the second device sends a Neg_Rsp to the first device based on the Bluetooth connection, where the Neg_Rsp carries the second role information and / or the second capability information.
[0171] When the second device receives the Neg_Req from the first device, the distributed framework of the second device can send a response message Neg_Rsp to the first device. The Neg_Rsp is used to transmit relevant information for negotiating the session key, as well as the MAC address, status, supported channel list, operation channel attributes and other information of the second device.
[0172] Optionally, if the Neg_Req from the first device includes information for negotiating the GO / GC roles of both ends, the Neg_Rsp may also include information for negotiating the GO / GC roles of both ends. Optionally, if the roles of both ends are negotiated, S912 may be executed. In this example, it is taken as an example that the first device is negotiated as a GO device and the second device is negotiated as a GC device.
[0173] S906: The distributed framework of the first device and the distributed framework of the second device determine a transmission strategy of the first distributed service based on the first role information and / or the first capability information and the second role information and / or the second capability information of the second device.
[0174] The manner in which the distributed framework of the first device and the distributed framework of the second device determine the transmission strategy can refer to the manner in which the first device determines the transmission strategy of the first distributed service in S503, which will not be described in detail here.
[0175] Optionally, if the transmission strategy is strategy 2 or strategy 4, that is, it is necessary to disconnect the existing WiFi point-to-point connection of the first device, then S907 can be executed. If the transmission strategy is strategy 1, the first distributed service is transmitted through the existing WiFi point-to-point connection between the first device and the second device, that is, there is no need to execute the following steps S907 to S913. If the transmission strategy is strategy 5, and strategy 5 requires the newly created WiFi point-to-point connection to be a P2P connection, then S912 can be executed. If the transmission strategy is strategy 5, and strategy 5 requires the newly created WiFi point-to-point connection to be not a P2P connection, then S913 can be executed.
[0176] S907: The distributed framework of the first device sends the first information to the distributed business application, and the distributed business application pops up a window to display the first information.
[0177] For the relevant description of this step, please refer to the relevant description of S807, which will not be repeated here.
[0178] S908: The distributed framework of the first device disconnects the existing WiFi point-to-point connection.
[0179] S909: The distributed framework of the first device sends second information to the second device.
[0180] S910: The distributed framework of the second device sends first information to the distributed service application, and the distributed service application pops up a window to display the first information.
[0181] For the relevant description of this step, please refer to the relevant description of S811, which will not be repeated here.
[0182] S911: The distributed framework of the second device disconnects the existing WiFi point-to-point connection and sends a response message to the first device.
[0183] The response information is used to indicate that the existing WiFi point-to-point connection has been disconnected.
[0184] S912: The distributed framework of the first device creates a group.
[0185] S913: The distributed framework of the first device and the distributed framework of the second device establish a WiFi point-to-point connection.
[0186] In the above technical solution, the first device and the second device have established a Bluetooth connection and can carry their respective role information and / or capability information in the signaling message used to negotiate the session key, and can complete the negotiation of the dual-end roles in the existing signaling message, which can reduce signaling overhead.
[0187] The following is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown. The electronic device 1000 may be the first device and the second device mentioned above. The electronic device 1000 may include: one or more processors 1001; one or more memories 1002; a communication interface 1003, and one or more computer programs 1004, and the above-mentioned devices may be connected via one or more communication buses 1005. The one or more computer programs 1004 are stored in the above-mentioned memory 1002 and are configured to be executed by the one or more processors 1001, and the one or more computer programs 1004 include instructions. For example, the above-mentioned instructions can be used to execute the relevant steps of the mobile phone in the corresponding embodiments above. The communication interface 1003 is used to realize communication between the mobile phone and other devices (for example, a drone), for example, the communication interface may be a transceiver.
[0188] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is run on a computer, the computer is enabled to execute the method in the above embodiment.
[0189] An embodiment of the present application also provides a graphical user interface on an electronic device, wherein the electronic device has a display screen, a memory, and a processor, wherein the processor is used to execute one or more computer programs stored in the memory, and the graphical user interface includes a graphical user interface displayed when the electronic device executes the method in the above embodiment.
[0190] An embodiment of the present application also provides a chip system, including a processor and an interface, wherein the processor is used to call and execute instructions from the interface so that the chip system implements the method in the above embodiment.
[0191] In order to implement the functions of the method provided in the above embodiment of the present application, the electronic device may include a hardware structure and / or a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
[0192] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0193] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0194] For the purpose of explanation, the foregoing description is described by reference to specific embodiments. However, the above exemplary discussion is not intended to be exhaustive, nor is it intended to limit the present application to the disclosed precise form. According to the above teachings, many modifications and variations are possible. The embodiments are selected and described in order to fully illustrate the principles of the present application and its practical application, so that other persons skilled in the art can make full use of the present application and various embodiments with various modifications suitable for the specific purpose contemplated.
Claims
1. A distributed service transmission method, characterized in that: Applied to a first device, the method includes: In response to a first operation of a first user, the first operation is used to instruct to transmit a first distributed service through a wireless fidelity WiFi point-to-point connection; Sending first role information and / or first capability information, and receiving second role information and / or second capability information from a second device, wherein the capability information is used to indicate whether connection with at least two devices is supported, and the role information is used to indicate a group manager GO or a group client GC; A transmission strategy for transmitting the first distributed service between the first device and the second device via the WiFi point-to-point connection is determined based on the first role information and / or the first capability information, and the second role information and / or the second capability information.
2. The method according to claim 1, characterized in that The transmission strategy of the first distributed service includes one of the following items: transmitting the first distributed service via an existing WiFi point-to-point connection between the first device and the second device; Disconnecting the existing WiFi point-to-point connection of the first device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; Disconnecting the existing WiFi point-to-point connection of the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; disconnecting the existing WiFi point-to-point connection between the first device and the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; or The first device establishes a WiFi point-to-point connection with the second device to transmit the first distributed service.
3. The method according to claim 1 or 2, characterized in that The method further comprises: If the transmission strategy includes disconnecting an existing WiFi point-to-point connection of the first device and displaying first information, the first information is used to indicate whether to disconnect the existing WiFi point-to-point connection of the first device; In response to a second operation of the first user to disconnect the existing WiFi point-to-point connection, the existing WiFi point-to-point connection of the first device is disconnected.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the transmission strategy includes disconnecting an existing WiFi point-to-point connection of the second device, sending second information to the second device, where the second information is used to instruct the second device to disconnect the existing WiFi point-to-point connection; Receive response information from the second device, where the response information is used to indicate that the second device has disconnected the existing WiFi point-to-point connection.
5. The method according to claim 4, characterized in that The second information is carried in a signaling connection established between the first device and the second device.
6. The method according to any one of claims 1 to 5, characterized in that: The first role information and / or the first capability information is carried in a broadcast message of the first device, where the broadcast message is used to discover a device for establishing a signaling connection; or, The first role information and / or the first capability information is carried in a signaling connection established between the first device and the second device.
7. A distributed service transmission method, characterized in that: Applied to the second device, the method includes: Receiving first role information and / or first capability information from a first device, where the first role information and / or first capability information is sent by the first device in response to a first operation of a first user, where the first operation is used to indicate transmission of a first distributed service through a wireless fidelity WiFi point-to-point connection, the capability information is used to indicate whether connection with at least two devices is supported, and the role information is used to indicate a group manager GO or a group client GC; Sending second role information and / or second capability information; A transmission strategy for transmitting the first distributed service between the second device and the first device via a WiFi point-to-point connection is determined based on the first role information and / or the first capability information, and the second role information and / or the second capability information.
8. The method according to claim 7, characterized in that The transmission strategy of the first distributed service includes one of the following items: transmitting the first distributed service via an existing WiFi point-to-point connection between the first device and the second device; Disconnecting the existing WiFi point-to-point connection of the first device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; Disconnecting the existing WiFi point-to-point connection of the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; disconnecting the existing WiFi point-to-point connection between the first device and the second device, and establishing a WiFi point-to-point connection between the first device and the second device to transmit the first distributed service; or The first device establishes a WiFi point-to-point connection with the second device to transmit the first distributed service.
9. The method according to claim 7 or 8, characterized in that The method further comprises: receiving second information from the first device, where the second information is used to instruct the second device to disconnect an existing WiFi point-to-point connection; Displaying first information, where the first information is used to indicate whether to disconnect the existing WiFi point-to-point connection; In response to a second operation of the second user disconnecting the existing WiFi point-to-point connection of the first device, disconnecting the existing WiFi point-to-point connection of the second device; Sending a response message to the first device, where the response message is used to indicate that the second device has disconnected the existing WiFi point-to-point connection.
10. The method according to claim 9, characterized in that The second information is carried in a signaling connection established between the first device and the second device.
11. The method according to any one of claims 7 to 10, characterized in that: The second role information and / or the second capability information is carried in a broadcast message of the second device, where the broadcast message is used to discover a device for establishing a signaling connection; or, The second role information and / or second capability information is carried in a signaling connection established between the first device and the second device.
12. A communication device, characterized in that: include: a processor, a memory, and one or more programs; The one or more programs are stored in the memory, and the one or more programs include instructions. When the instructions are executed by the processor, the communication device executes the method steps as described in any one of claims 1 to 6 or 7 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program. When the computer program is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6 or 7 to 11.
14. A chip system, characterized in that: It comprises a processor and an interface, wherein the processor is used to call and execute instructions from the interface so that the chip system implements the method as claimed in any one of claims 1 to 6 or 7 to 11.