Method and apparatus for transmitting data
By determining the main device and other devices in the terminal device to establish a physical link, the problem of connection conflicts in WiFi direct connection is solved, and the service success rate and user experience are improved.
Patent Information
- Application Number
- PCT/CN2024/112322
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-27
- Filing Date
- 2024-08-15
- Publication Date
- 2025-07-03
AI Technical Summary
When a terminal device establishes a direct WiFi connection with multiple devices, it may lead to connection conflicts and lead to poor user experience.
By determining the master device in the first device and the multiple devices, the master device establishes a physical link with the other devices, reducing the situation of connection conflicts and improving the user experience.
It improves the success rate of establishing services between terminal devices and multiple devices and improves the user experience.
Smart Images

Figure CN2024112322_03072025_PF_FP_ABST
Abstract
Description
Data transmission method and device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 27, 2023, with application number 202311840355.7 and application name “Data Transmission Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a data transmission method and device. Background Art
[0003] Terminal devices can realize various services between terminal devices through wireless fidelity (WiFi) direct connection technology, such as multi-screen collaboration, keyboard and mouse sharing, etc. between terminal devices through peer-to-peer (P2P) direct connection, WiFi wireless access point (AP) and station (STA) connection and other technologies.
[0004] Among them, multiple terminal devices that establish a WiFi direct connection can be called a group. For example, multiple terminal devices that establish a P2P direct connection can be called a P2P group; a group formed by multiple terminal devices that establish a WiFi AP-STA connection can be called an AP-STA group. However, when a terminal device establishes a WiFi direct connection with multiple terminal devices, connection conflicts may occur. For example, the terminal device can only establish physical links with some of the multiple terminal devices, but fails to establish physical links with the remaining terminal devices, making it impossible for the terminal device to establish services with multiple terminal devices simultaneously, resulting in a poor user experience.
[0005] Summary of the Invention
[0006] The present application provides a data transmission method and apparatus, which can reduce the connection conflict scenarios generated when a first device establishes services with multiple devices, thereby improving user experience.
[0007] In a first aspect, a data transmission method is provided, the method comprising: a first device discovering an online device, the online device including a second device and a third device; in response to a user instruction to establish a first service with the online device, the first device determining a master device from the first device and the online device; the first device instructs the master device to establish a physical link with the remaining devices, the remaining devices being devices other than the master device among the online device and the first device, and the first device is not the master device; or, the first device establishes physical links with the second device and the third device respectively, with the first device being the master device.
[0008] In the data transmission method of the present application, when a first device needs to establish a first service with multiple devices, the first device can determine a master device among the first device and the multiple devices, so that the master device can establish a physical link with the remaining devices. In this way, compared to the first device first determining a master device among one of the multiple devices and the first device to form a group, and then allowing the other devices in the multiple devices to join the group in sequence, the first device can determine a master device among the first device and the multiple devices that is conducive to the first device and the multiple devices forming a group, which can reduce the scenario of connection conflicts, thereby improving the success rate of the first device and the multiple devices in establishing the first service, and further improving the user experience.
[0009] It should be understood that the second device and the third device may be part or all of the online devices discovered by the first device. The second device and / or the third device may refer to one or more devices.
[0010] Among them, the first business can be understood as a global collection. In the case where the first device is the master device, the first device can be understood as device 1 below, the second device can be understood as device 2 below, and the third device can be understood as device 3 below. In the case where the first device is not the master device, the second device or the third device is the master device, and the first device can be understood as the second terminal device below, that is, the one of the second or third devices that serves as the master device can be understood as the first terminal device below, and the one of the second or third devices that does not serve as the master device can be understood as the third terminal device below; or, the first device can be understood as device 4 below, that is, the one of the second or third devices that serves as the master device can be understood as device 6 below, and the one of the second or third devices that does not serve as the master device can be understood as device 5 below.
[0011] In conjunction with the first aspect, in certain implementations of the first aspect, after the first device instructs the master device to establish a physical link with the remaining devices, the method further includes: receiving first information from the master device, the first information being used to indicate that the physical link establishment between the master device and the remaining devices is complete; and in response to the first information, the first device establishing a first service with the online device. In this way, after the physical link is established between the master device and the remaining devices, the first device can establish the first service with the online device based on the physical link established between the master device and the remaining devices.
[0012] The first device can be understood as the second terminal device below, the master device can be understood as the first terminal device below, and the online device can be understood as the second and third terminal devices below. The first message can be understood as the message sent by the first terminal device to the second terminal device to indicate the success of global networking. The first service can be understood as the global favorite.
[0013] In combination with the first aspect, in certain implementations of the first aspect, after the first device establishes a first service with the online device, the method further includes: sending information to the master device for indicating exiting the first state, the first state being a state in which the master device establishes a physical link with the remaining devices; receiving a first response from the master device, and exiting the first state.
[0014] It should be understood that when the first device, the second device, and the third device are in the first state, the first device, the second device, and the third device may not process connection requests from other devices, thereby improving the success rate of global networking. Through the above-mentioned method, after the first device, the second device, and the third device exit the first state, the first device, the second device, and the third device can continue to process connection requests from other devices.
[0015] The first device may be understood as the second terminal device in the following text, the master device may be understood as the first terminal device in the following text, the first state may be understood as the state of the global network in the following text, and the first response may be understood as the response 1 in the following text.
[0016] In combination with the first aspect, in some implementations of the first aspect, after the first device establishes physical links with the second device and the third device respectively, the method further includes: the first device establishes a first service with the online device.
[0017] The establishment of the first service by the first device and the online device can be understood as the smart interconnection of the first device sending data of the first service to the smart interconnection of the second device, and the smart interconnection of the first device sending data of the first service to the smart interconnection of the third device.
[0018] The first device may be understood as device 1 in the following text, the online device may be understood as device 2 and device 3 in the following text, and the first service may be understood as global favorites in the following text.
[0019] In combination with the first aspect, in certain implementations of the first aspect, after the first device establishes the first service with the online device, the method further includes: the first device receives information from the second device and the third device respectively for indicating exiting the first state, where the first state is a state in which the main device establishes a physical link with the remaining devices; in response to the information from the second device and the third device for indicating exiting the first state, the first device exits the first state.
[0020] The first device can be understood as device 1 below, the second device can be understood as device 2 below, and the third device can be understood as device 3 below. The first service can be understood as global favorites below. The first state can be understood as the state of the global network below.
[0021] In combination with the first aspect, in certain implementations of the first aspect, the first device establishes a first service with the online device, including: the first device establishes a first transmission channel with the second device; the first device uses the first transmission channel to send data of the first service to the second device; the first device establishes a second transmission channel with the third device; the first device uses the second transmission channel to send data of the first service to the third device.
[0022] In the case where the first device is the master device, the first device can be understood as device 1 below, the second device can be understood as device 2 below, and the third device can be understood as device 3 below. If the first device is not the master device, the second or third device is the master device, and the first device can be understood as the second terminal device below. That is, the second or third device that is the master device can be understood as the first terminal device below, and the second or third device that is not the master device can be understood as the third terminal device below. The first service can be understood as a global collection, and the data of the first service can be understood as the files collected by the second terminal device or device 1.
[0023] In combination with the first aspect, in certain implementations of the first aspect, a first device and a second device establish a first transmission channel, including: the first device sends information for indicating the multiplexing of a physical link to the second device; receives information from the second device for indicating successful multiplexing of the physical link, where the information for indicating successful multiplexing of the physical link carries information for indicating the device Internet Interconnection Protocol (IP) of the second device; in response to the information for indicating successful multiplexing of the physical link, sends information for indicating the establishment of a transmission channel to the second device, where the information for indicating the establishment of the transmission channel carries information for indicating the device IP of the first device; and receives information from the second device for indicating successful establishment of the transmission channel.
[0024] The first transmission channel is established using the device IP of the first device and the device IP of the second device. The first device can be understood as the second terminal device below, and the second device can be understood as the first terminal device below. The information indicating the successful physical link multiplexing can be understood as the physical link multiplexing response below.
[0025] In combination with the first aspect, in certain implementations of the first aspect, the master device satisfies one or more of the following conditions: the master device is configured with the capability to be the master device in the group; or, the master device is the device with the largest media access control MAC address among the first device and the online device; or, the master device is the device with the smallest power consumption per unit time among the first device and the online device; the master device belongs to the master device in a first group, and the first group is a group established before the first device determines the master device from the first device and the online device; or, the master device is a plug-in device.
[0026] When selecting a device that has the capability to be the master device in a group as the master device, it is convenient to improve the success rate of forming a new group; select the device with the lowest power consumption per unit time and / or select a plug-in device so that the master device is less sensitive to power consumption. Because the power consumption of the master device may be large, this can reduce the situation where the group is disbanded due to insufficient power of the master device. Selecting the device with the largest MAC address allows more types of devices to connect to the master device. Since the master device in the first group is the master device selected when the first group is formed, the master device of the first group may meet one or more of the above rules. Therefore, the first device can directly determine the master device in the first group as the master device.
[0027] The first group may be, for example, a group established by the second device and the third device before the first device determines the master device.
[0028] The master device may be understood as the first terminal device in the following text, and the first device may be understood as the second terminal device in the following text. The conditions satisfied by the master device may be understood as the rules for the second terminal device to determine the GO in the following text.
[0029] In combination with the first aspect, in certain implementations of the first aspect, the first device includes a first smart interconnect and a first WiFi connection module; the first device determines the master device from the first device and the online device, including: the first smart interconnect sends information indicating the first device and the online device to the first WiFi connection module; the first WiFi connection module determines the master device from the first device and the online device.
[0030] The first device can be understood as the second terminal device mentioned below. The first smart interconnection can be understood as the smart interconnection of the second terminal device mentioned below. The first WiFi connection module can be understood as the WiFi connection module of the second terminal device mentioned below.
[0031] In combination with the first aspect, in certain implementations of the first aspect, the master device includes a second WiFi connection module; the first device instructs the master device to establish a physical link with the remaining devices, including: the first WiFi connection module sends information for instructing global networking to the second WiFi connection module, the information for instructing global networking carries information for instructing each of the remaining devices, and the global networking indicates that the master device establishes a physical link with the remaining devices.
[0032] The first device can be understood as the second terminal device below. The first smart interconnection can be understood as the smart interconnection of the second terminal device below. The first WiFi connection module can be understood as the WiFi connection module of the second terminal device below. The main device can be understood as the first terminal device below, and the second WiFi connection module can be understood as the WiFi connection module of the first terminal device below.
[0033] In combination with the first aspect, in some implementations of the first aspect, the physical link between the master device and the first device is established through the first WiFi connection module and the second WiFi connection module.
[0034] The first device can be understood as the second terminal device below. The first smart interconnection can be understood as the smart interconnection of the second terminal device below. The first WiFi connection module can be understood as the WiFi connection module of the second terminal device below. The main device can be understood as the first terminal device below, and the second WiFi connection module can be understood as the WiFi connection module of the first terminal device below.
[0035] In a second aspect, a data transmission device is provided, configured to execute the method in any possible implementation of the first aspect. Specifically, the device includes a module configured to execute the method in any possible implementation of the first aspect.
[0036] In a third aspect, embodiments of the present application provide a data transmission device, which may be an electronic device or a chip or chip system within an electronic device. The data transmission device may include a display unit and a processing unit. When the data transmission device is an electronic device, the display unit may be a display screen. The display unit is configured to perform the display step, so that the electronic device implements a data transmission method described in the first aspect or any possible implementation of the first aspect. When the data transmission device is an electronic device, the processing unit may be a processor. The data transmission device may also include a storage unit, which may be a memory. The storage unit is configured to store instructions, and the processing unit executes the instructions stored in the storage unit, so that the electronic device implements a data transmission method described in the first aspect or any possible implementation of the first aspect. When the data transmission device is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit, so that the electronic device implements a data transmission method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, a cache, etc.), or a storage unit within the electronic device located outside the chip (e.g., a read-only memory, a random access memory, etc.).
[0037] For example, assuming that the apparatus is a first device, it includes a discovery unit and a processing unit. The discovery unit is configured to discover online devices. The processing unit is configured to determine a master device.
[0038] In a possible implementation, the processing unit is further configured to instruct the master device to establish a physical link with other devices.
[0039] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store code instructions, and the processor is used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0040] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0041] In a sixth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when the computer program runs on a computer, enables the computer to execute the method described in the first aspect or any possible implementation of the first aspect.
[0042] In a seventh aspect, the present application provides a chip or chip system, comprising at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is configured to execute a computer program or instruction to perform the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip may be an input / output interface, a pin, or a circuit, etc.
[0043] In one possible implementation, the chip or chip system described above in this application further includes at least one memory, in which instructions are stored. The memory may be a storage unit within the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
[0044] It should be understood that the second to seventh aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] FIG1 is a schematic diagram of an interface of a first terminal device provided in an embodiment of the present application;
[0046] FIG2 is a schematic diagram of an interface of a second terminal device provided in an embodiment of the present application;
[0047] FIG3 is a schematic diagram of an interface of a third terminal device provided in an embodiment of the present application;
[0048] FIG4 is a schematic diagram of an interface of a fourth terminal device provided in an embodiment of the present application;
[0049] FIG5 is a schematic diagram of an interface of a fifth terminal device provided in an embodiment of the present application;
[0050] FIG6 is a schematic diagram of an interface of a sixth terminal device provided in an embodiment of the present application;
[0051] FIG7 is a schematic diagram of an interface of a seventh terminal device provided in an embodiment of the present application;
[0052] FIG8 is a schematic diagram of a physical link and a transmission channel provided in an embodiment of the present application;
[0053] FIG9 is a flow chart of a process of establishing a global collection on a mobile phone and a tablet computer in a method for establishing a global collection;
[0054] FIG10 is a flow chart showing a process of determining a connection conflict in a method for establishing a global favorite;
[0055] FIG11 is a schematic block diagram of the structure of a terminal device provided in an embodiment of the present application;
[0056] FIG12 is a schematic diagram of a software structure of a terminal device provided in an embodiment of the present application;
[0057] FIG13 is a schematic diagram of the software structure of another terminal device provided in an embodiment of the present application;
[0058] FIG14 is a flow chart of a process of device discovery and establishing a global collection in a data transmission method provided in an embodiment of the present application;
[0059] FIG15 is a flow chart illustrating a process of exiting a global networking state in a data transmission method provided in an embodiment of the present application;
[0060] FIG16 is a flow chart of another data transmission method provided in an embodiment of the present application;
[0061] FIG17 is a schematic flow chart of another data transmission method provided in an embodiment of the present application;
[0062] FIG18 is a schematic block diagram of a data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The technical solution in this application will be described below with reference to the accompanying drawings.
[0064] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first and second numerical values are merely used to distinguish different numerical values and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity or execution order, and words such as "first" and "second" do not necessarily mean different.
[0065] It should be noted that in the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0066] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0067] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0068] 1. Terminal devices may be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. For example, terminal devices may be mobile phones, smart TVs, wearable devices, tablet computers, computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of the present application do not limit the specific technologies and specific device forms adopted by the terminal devices.
[0069] 2. Peer-to-peer (P2P) direct connection, also known as wireless fidelity (WiFi) direct connection, is a type of WiFi direct connection technology and an important technology under the "WiFi DIRECT" standard protocol launched by the WiFi Alliance. Through WiFi P2P, two WiFi devices can directly connect and communicate with each other without WiFi intervention.
[0070] Establishing a P2P direct connection between terminal devices typically requires the following four processes: WiFi P2P device discovery, group formation, WiFi protected setup (WPS), and association connection. Through these four processes, a P2P group is formed between multiple terminal devices that establish a P2P direct connection. A P2P group can also be referred to as a WiFi P2P group. Terminal devices in a P2P group can each play one of two roles: a group owner (GO) or a group client (GC). There can be only one GO, and the GC establishes a P2P connection with each GO.
[0071] 3. WiFi wireless access point (AP) and station (STA) technology, also known as WiFi AP-STA technology, is a type of WiFi direct connection technology. Similar to P2P direct connection, it also enables connection and communication between terminal devices. The terminal devices in an AP-STA group play the role of either AP or STA. In WiFi AP-STA technology, a terminal device acting as an STA can connect to a terminal device acting as an AP, forming an AP-STA group.
[0072] 4. Global Collections is a technology that enables file sharing across multiple devices. For example, a user can drag images, text, web pages, and other files from the initiator's global collection into the collection area displayed on the initiator's screen. This allows the user to view and manipulate the files on other devices that have enabled the global collection service.
[0073] In a first possible implementation, the initiator of global collection can initiate global collection based on the user clicking the "Global Collection" icon in the recommended items in the start menu bar. For example, the interface corresponding to the recommended items in the start menu bar of the terminal device can be as shown in FIG1 . Based on the user clicking the "Global Collection" icon, the terminal device can initiate global collection.
[0074] In a second possible implementation, the initiator of global collections can display a global collection icon based on a user's search for global collections in the start menu bar, and activate global collections based on a user's click on the global collection icon. For example, an interface of a terminal device displaying a global collection icon based on a user's search for global collections in the start menu bar can be shown in FIG2 . Based on a user's click on the "Global Collection" icon in this interface, the terminal device can activate global collections.
[0075] In a third possible implementation, the initiator of a global collection can initiate a global collection based on a user dragging a file into a collection area displayed on the initiator's display. For example, as shown in FIG3 , a collection area 301 can be displayed on the terminal device's display. This collection area 301 can be, for example, at the top of the terminal device's display. Based on the user dragging a document into the collection area 301, the terminal device can initiate a global collection.
[0076] In a fourth possible implementation, the initiator of a global collection can initiate a global collection based on a user dragging a file into a collection area displayed on the initiator's display screen while browsing a webpage. For example, as shown in FIG4 , a collection area 401 can be displayed on the terminal device's display screen. While browsing a webpage, the terminal device can initiate a global collection based on the user dragging an image 402 on the webpage into collection area 401.
[0077] In a fifth possible implementation, the initiator of the global collection can create a global collection shortcut based on the user's instruction to create a desktop shortcut in the global collection panel; then, the initiator of the global collection can launch the global collection based on the user's click on the global collection shortcut. For example, as shown in FIG5 , based on the user's click on button 502 in the global collection panel 501, the terminal device can display menu bar 503; based on the user's click on button 504 in menu bar 503, the terminal device can create a desktop shortcut for the global collection on the desktop; based on the user's click on the desktop shortcut for the global collection, the terminal device can launch the global collection.
[0078] After a terminal device activates global favorites, the user's favorited files can be displayed in the favorited file area, such as the favorited file area 301 or the global favorites panel 501 described above. Other terminal devices that have established global favorites with the initiator of the global favorite can also display the user's favorited files in the corresponding favorited file areas. Favorited files can then be dragged and dropped to other applications or shared with other applications.
[0079] In one example, as shown in Figure 6, based on the user's operation of dragging image 402 from a web page into the favorites area 401 in Figure 4, the terminal device can activate global favorites and display the image in the favorites area 601 of the terminal device. Based on the user's operation of dragging the image to a note, the image can be inserted into the note.
[0080] In another example, as shown in Figure 7, after the user selects the picture 702 in the favorite file area 701 of the terminal device, based on the user clicking the share button 703, the terminal device can display a menu bar 704; based on the user clicking the share to note button 705, the picture 702 can be inserted into the editing area 707 of the picture note 706 of the note.
[0081] It should be understood that in the examples shown in Figures 6 and 7, the terminal device may or may not be the initiator of the global collection. The terminal device in the two examples may be any terminal device among the multiple terminal devices that establish the global collection. This application does not make specific limitations on this.
[0082] Currently, information exchange and data transmission between terminal devices can be achieved through technologies such as P2P direct connection and WiFi AP-STA. For example, multiple terminal devices such as mobile phones, tablets, and laptops can use P2P direct connection to achieve functions such as global collection between devices.
[0083] It should be noted that the realization of functions such as global collection between multiple terminal devices requires the transmission channel between the multiple terminal devices, and the transmission channel between the multiple terminal devices is established by relying on physical links.
[0084] 5. Physical link, also called a WiFi physical link or physical channel, can be, for example, a WiFi P2P link, a Bluetooth basic rate (BR) link, a Bluetooth socket link, or a Bluetooth enhanced data rate (EDR) link. Only one physical link can be established between two terminal devices.
[0085] It should be noted that in the embodiment of the present application, the terminal devices establishing a WiFi direct connection can also be considered as establishing a physical link between the terminal devices. For example, when a P2P direct connection is established between the terminal devices, the physical link established between the terminal devices is a WiFi P2P link.
[0086] Therefore, in the embodiments of the present application, the physical link can also be understood as a WiFi direct connection, a P2P connection, a P2P direct connection, or a WiFi AP-STA connection. For example, establishing a physical link between a first terminal device and a second terminal device can also be understood as establishing a P2P direct connection or a WiFi AP-STA connection between the first terminal device and the second terminal device. This application does not specifically limit this.
[0087] In a group formed by multiple terminal devices, a physical link is established between each slave device and the master device. The master device can be, for example, a GO in a P2P group or an AP in an AP-STA group. The slave device can be, for example, a GC in a P2P group or an STA in an AP-STA group. For example, in a P2P group formed by multiple terminal devices, a physical link is established between each GC and the GO; in an AP-STA group formed by multiple terminal devices, a physical link is established between each STA and the AP.
[0088] 7. A transmission channel is a channel for transmitting data based on a physical link. The transmission channel can be used to implement user datagram protocol (UDP) communication and / or transmission control protocol / internet protocol (TCP / IP) communication. Each terminal device can establish multiple transmission channels with multiple other terminal devices, and each transmission channel can be used to transmit a type of business data. The terminal device can establish a transmission channel with the opposite device based on the device IP of the opposite device. For example, the local device can use the device IP of the opposite device to call the protocol stack of the local device to establish a transmission channel with the opposite device, so that the data of the local device can be transmitted to the opposite device through the transmission channel.
[0089] 8 , taking three terminal devices forming a P2P group as an example, the physical link and transmission channel will be further described.
[0090] Figure 8 is a schematic diagram of a physical link and transmission channel provided in an embodiment of the present application. As shown in Figure 8, a P2P group is formed between terminal devices 810, 820, and 830. Terminal device 810 is the GO in the P2P group, and terminal devices 820 and 830 are the GCs in the P2P group.
[0091] As shown in (a) of FIG8 , the terminal device 820 and the terminal device 830 respectively establish a P2P direct connection with the terminal device 810 , that is, a physical link is established between the terminal device 820 and the terminal device 830 and the terminal device 810 .
[0092] As shown in (b) of Figure 8 , in order for terminal device 820 to simultaneously perform global collection services with terminal device 830 and terminal device 810, based on the above physical link, a transmission channel is established between terminal device 810 and terminal device 820 for transmitting global collection service data; and a transmission channel is established between terminal device 820 and terminal device 830 for transmitting global collection service data. During the process of transmitting service data between terminal device 820 and terminal device 830 via the transmission channel, the service data may be forwarded by terminal device 810. For example, terminal device 820 sends service data to terminal device 830, and the service data may be forwarded to terminal device 830 via terminal device 810.
[0093] It should be understood that when multiple terminal devices realize services between terminal devices by establishing WiFi direct connection in addition to P2P direct connection, in the group formed by the multiple terminal devices, the relationship between the physical links and transmission channels between the terminal devices is similar to the relationship shown in Figure 8. Please refer to the description above and will not repeat it here.
[0094] 7. Group dissolution can be defined as the disconnection of the physical link between the master device and each slave device in the group, or the disconnection of the Wi-Fi direct connection between the master device and each slave device in the group. For example, the dissolution of a P2P group can be understood as the disconnection of the P2P direct connection between the GO and each GC in the group.
[0095] Currently, when a terminal device 1 needs to establish a service with multiple terminal devices, the terminal device 1 will establish a WiFi direct connection with one of the multiple terminal devices, and then sequentially establish WiFi direct connections with the remaining terminal devices. However, this method may cause connection conflicts, resulting in the terminal device 1 being unable to establish WiFi direct connections with multiple terminal devices, thereby preventing the service between the terminal device 1 and the multiple terminal devices from being realized, resulting in a poor user experience.
[0096] Exemplarily, terminal device 1 is a mobile phone, and the mobile phone needs to establish a WiFi direct connection with a tablet computer and a laptop computer. The mobile phone first establishes a P2P direct connection with the tablet computer, and the mobile phone is the GO in the P2P group formed by the mobile phone and the tablet computer, and the tablet computer is the GC in the P2P group formed by the mobile phone and the tablet computer; then, the mobile phone is directly connected to the laptop computer through P2P. However, due to hardware limitations and / or protocol limitations, the laptop computer is not fully compatible with the P2P direct connection of the Android system, so that the laptop computer can only connect to other terminal devices as a GO. Since a GO already exists in the P2P group formed by the mobile phone and the tablet computer, a connection conflict will occur. This makes it impossible for the laptop computer to establish a P2P direct connection with the mobile phone, or the laptop computer establishes a P2P direct connection with the mobile phone, but the P2P direct connection between the mobile phone and the tablet computer is disconnected.
[0097] The connection method 900 described above is described in detail below with reference to Figures 9 and 10. Figure 9 illustrates the process of establishing a P2P direct connection between a mobile phone and a tablet computer, while Figure 10 illustrates the process of establishing a P2P direct connection between a laptop computer and a mobile phone, resulting in a connection conflict.
[0098] As shown in FIG9 , the connection method 900 of the above example includes the following steps:
[0099] S100 to S104 are the process of the laptop computer discovering the device.
[0100] S100: In response to user operation 1, the smart interconnection switch of the laptop computer is switched to an on state.
[0101] The Smart Interconnection Switch can be a button on the system settings interface of a terminal device, or a button on the settings interface of an application such as PC Manager on the terminal device. The state of the Smart Interconnection Switch can control whether the terminal device can discover devices, thereby establishing connections with other terminal devices and performing services such as multi-screen collaboration, keyboard and mouse sharing, and global collections. For example, when the Smart Interconnection Switch of a laptop is turned on, the laptop can discover other terminal devices, and the Smart Interconnection Switches of other terminal devices are also turned on.
[0102] Operation 1 can be a user clicking or sliding the smart interconnection switch. In response to Operation 1, the smart interconnection switch can switch its state, for example, from off to on, or from on to off. In this embodiment of the present application, Operation 1 is an operation to switch the laptop's smart interconnection switch from off to on.
[0103] S101. The smart interconnection of the laptop computer instructs the device discovery module of the laptop computer to perform device discovery.
[0104] Optionally, the smart interconnection of the laptop computer calls a function to instruct the device discovery module of the laptop computer to perform device discovery, or the smart interconnection of the laptop computer transmits an instruction for instructing the device discovery module to perform device discovery to the device discovery module of the laptop computer.
[0105] S102 : In response to the instruction of the smart interconnection of the laptop computer in S101 , the device discovery module of the laptop computer performs device discovery and discovers online devices.
[0106] Device discovery, also known as Wi-Fi P2P discovery, involves switching between the listening and searching phases. For example, when a laptop is in the discovery phase and a mobile phone is in the broadcast phase, the laptop's device discovery module can discover the mobile phone and retrieve the device information contained in the mobile phone's broadcast message. This device information can include one or more of the following: device model, device ID, device name, logged-in account, or the device's media access control (MAC) address.
[0107] In this way, the device discovery module of the laptop can discover mobile phones and tablets and obtain their device information. Online devices can be understood as devices discovered by the terminal device. For example, for a laptop, online devices include mobile phones and tablets.
[0108] S103. The device discovery module of the laptop transmits the device information of the online device to the smart interconnection of the laptop.
[0109] For example, the device discovery module of the laptop can transmit a list of online devices to the laptop's smart interconnection. The list includes device information for each online device. For example, the device discovery module of the laptop can transmit a list of devices including the device name and model of the mobile phone and tablet to the laptop's smart interconnection.
[0110] Optionally, for a laptop, the online device can be a terminal device with the same account as the one logged in to the laptop. For example, the online device information transmitted by the laptop's device discovery module to the laptop's smart interconnection can be information about a mobile phone and a tablet computer, where the account logged in to the mobile phone is the same as the account logged in to the laptop, and the account logged in to the tablet is the same as the account logged in to the laptop.
[0111] S104. Based on the device information of the online device, the smart interconnection indicator of the laptop computer displays the online device.
[0112] Displaying the online device can be understood as displaying the device model or device name of the online device, etc. For example, the online device displayed on a laptop may be the device name or device model of a mobile phone, or the device name or device model of a tablet computer.
[0113] S200 to S204 are the process of the mobile phone discovering the device:
[0114] S200: In response to the user's operation 2, the smart interconnection switch of the mobile phone is switched to the on state.
[0115] S201. The smart interconnection of the mobile phone instructs the device discovery module of the mobile phone to perform device discovery.
[0116] S202. In response to the instruction of the smart interconnection of the mobile phone in S201, the device discovery module of the mobile phone performs device discovery and discovers the online device.
[0117] S203. The device discovery module of the mobile phone transmits the device information of the online device to the smart interconnection of the mobile phone.
[0118] S204: Based on the device information of the online device, the smart interconnection indicator of the mobile phone displays the online device.
[0119] S300 to S304 are the process of device discovery by the tablet:
[0120] S300: In response to user operation 3, the smart interconnection switch of the tablet computer is switched to an on state.
[0121] S301: The smart interconnection of the tablet computer instructs the device discovery module of the tablet computer to perform device discovery.
[0122] S302 : In response to the instruction of the smart interconnection of the tablet computer in S301 , the device discovery module of the tablet computer performs device discovery and discovers online devices.
[0123] S303: The device discovery module of the tablet computer transmits the device information of the online device to the smart interconnection of the tablet computer.
[0124] S304: Based on the device information of the online device, the smart interconnection indicator of the tablet computer displays the online device.
[0125] It should be noted that the implementation of S200 to S204 and S300 to S304 are similar to that of S100 to S104, and reference may be made to the description of S100 to S104, which will not be repeated here.
[0126] S205. In response to the user's operation 4 on the mobile phone, the smart interconnection of the mobile phone obtains a first instruction, which is used to instruct the mobile phone to perform global collection with the tablet computer and the laptop computer.
[0127] The first instruction can also be understood as an instruction for the terminal device to start global collection. Operation 4 can be the operation of the user instructing to start global collection in the first to fifth ways of starting global collection by the terminal device above. Please refer to the above description and will not be repeated here.
[0128] S206. In response to the first instruction, the smart interconnection of the mobile phone instructs the transmission module of the mobile phone to establish a transmission channel with the tablet computer.
[0129] Optionally, the smart interconnection of the mobile phone transmits information 1 to the transmission module of the mobile phone, where the information 1 is used to instruct the establishment of a transmission channel with the tablet computer, and the information 1 includes information indicating the tablet computer. The information indicating the tablet computer may be, for example, the device ID, device name, or device model of the tablet computer.
[0130] S207 . In response to the instruction of the smart interconnection of the mobile phone in S206 , the transmission module of the mobile phone instructs the WiFi connection module of the mobile phone to establish a physical link with the tablet computer.
[0131] It should be understood that establishing a physical link may also be replaced by establishing a P2P connection, establishing a P2P direct connection, or establishing a P2P link, etc. This application does not make specific limitations on this.
[0132] Optionally, the transmission module of the mobile phone may call a function and input information for indicating the tablet computer, such as the device ID of the tablet computer, to instruct the WiFi connection module of the mobile phone to establish a physical link with the tablet computer.
[0133] S208 . In response to the instruction of the transmission module of the mobile phone in S207 , the WiFi connection module of the mobile phone determines whether a physical link has been established between the mobile phone and the tablet computer.
[0134] Optionally, the mobile phone may store a first list including device information of terminal devices that have established a physical link with the mobile phone. The first list may be stored in the mobile phone's WiFi connection module, or the mobile phone's WiFi connection module may query the first list to determine whether a physical link has been established with the tablet computer by calling a function or other means.
[0135] If not, the mobile phone executes S209 to S214.
[0136] If so, the mobile phone executes S212 to S214.
[0137] S209. The WiFi connection module of the mobile phone determines that the role of the mobile phone is GO, and creates a GO role.
[0138] S210: After the GO is created, the mobile phone's WiFi connection module sends Request 1 to the tablet's WiFi connection module. Request 1 is used to request the establishment of a physical link. Request 1 may include the mobile phone's account number, password, and role information. Since the mobile phone's WiFi connection module determined the mobile phone's role as GO in S209, the mobile phone's role information indicates that the mobile phone's role is GO.
[0139] It should be understood that the mobile phone account and mobile phone password are used to establish a P2P direct connection between the tablet computer and the mobile phone. For the sake of brevity, the account and password will not be explained in the following text.
[0140] Optionally, request 1 is further used to instruct the WiFi direct connection module of the tablet computer to increase the reference count of the physical link between the mobile phone and the tablet computer by 1.
[0141] The reference count can be understood as the number of times a service between terminal devices references the established physical link between the terminal devices. For example, if a global favorites service is required between a mobile phone and a tablet, and the implementation of the global favorites service requires the physical link between the mobile phone and the tablet, the reference count of the physical link between the mobile phone and the tablet will be increased by 1. For the sake of brevity, the reference count will not be explained in detail below.
[0142] Optionally, the mobile phone's WiFi connection module can call a function to obtain information indicating whether a physical link has been established between the mobile phone and the tablet computer. For example, the mobile phone's WiFi connection module can call a function to check whether the mobile phone's list of established physical links includes information indicating the tablet computer; if so, it indicates that a physical link has been established between the mobile phone and the tablet computer; otherwise, it indicates that a physical link has not been established between the mobile phone and the tablet computer.
[0143] S305: In response to request 1, the tablet's WiFi connection module connects to the phone using the phone's account and password, establishing a physical link with the phone and incrementing the reference count of the physical link between the phone and the tablet by 1.
[0144] Optionally, the WiFi connection module of the tablet computer can call a function to connect to the mobile phone using the mobile phone's account and password.
[0145] S306: The WiFi connection module of the tablet computer sends a physical link establishment response to the WiFi connection module of the mobile phone. The physical link establishment response is used to indicate that the physical link is successfully established.
[0146] Optionally, the physical link establishment response carries the device IP address of the tablet computer. The device IP address of the tablet computer can be used by the mobile phone to send global favorite service data, such as user favorited files, to the tablet computer.
[0147] S211 . In response to the physical link establishment response, the WiFi connection module of the mobile phone increases the reference count of the physical link between the mobile phone and the tablet computer by 1.
[0148] S212 . In response to the physical link establishment response, the WiFi connection module of the mobile phone indicates to the transmission module of the mobile phone that the data link is successfully established, and indicates the device IP of the tablet computer.
[0149] Optionally, the WiFi connection module of the mobile phone transmits information 3 to the transmission module of the mobile phone, where information 3 is used to indicate that the data link is successfully established and indicates the device IP of the tablet computer.
[0150] Optionally, if a physical link is successfully established between the mobile phone and the tablet computer, the mobile phone sends a second list of the P2P group to online devices outside the P2P group established between the mobile phone and the tablet computer. The second list includes the device ID and role of each terminal device in the P2P group. Since the online device outside the P2P group established between the mobile phone and the tablet computer is a laptop computer, the mobile phone sends the second list to the laptop computer.
[0151] In this way, online devices outside the P2P group established by the mobile phone and the tablet can obtain the P2P direct connection status, the role of the mobile phone, and the role of the tablet between the mobile phone and the tablet. When online devices outside the P2P group established by the mobile phone and the tablet need to establish a P2P direct connection with a terminal device in the group, the role of each terminal device in the new P2P group to be established can be determined based on the role and information of each terminal device in the P2P group.
[0152] Optionally, when the role of the terminal device in the P2P group established by the mobile phone and the tablet computer changes or the connection relationship changes, the mobile phone can instruct the laptop computer to update the second list.
[0153] S213: The transmission module of the mobile phone sends information indicating the establishment of a transmission channel to the transmission module of the tablet computer. The information indicating the establishment of the transmission channel includes the device IP address of the mobile phone. The device IP address of the mobile phone can be used by the tablet computer to send global favorites service data to the mobile phone.
[0154] The information for indicating the establishment of a transmission channel may also be understood as a handshake packet, etc., and this application does not make any specific limitation on this.
[0155] S307: In response to the information indicating the establishment of the transmission channel, the transmission module of the tablet computer sends a transmission channel establishment response to the transmission module of the mobile phone. The transmission channel establishment response indicates that the transmission channel is agreed to be established or that the transmission channel is successfully established.
[0156] S308: The transmission module of the tablet computer indicates to the tablet computer's smart interconnection that the transmission channel is successfully established.
[0157] S309: In response to the instruction of the transmission module of the tablet computer in S308, the tablet computer's smart interconnection instruction displays a global collection interface. The global collection interface can be an area where the user can add files to the collection file of the mobile phone, such as the interface shown in FIG3.
[0158] S214, in response to the transmission channel establishment response in S307, the transmission module of the mobile phone indicates that the smart interconnection transmission channel of the mobile phone is successfully established. In this way, a global collection service is established between the smart interconnection between the mobile phone and the tablet computer, and data transmission can be realized.
[0159] S215: The smart interconnection indicator of the mobile phone displays a global collection interface. The global collection interface can be an area where the user can add files to the collection files of the mobile phone, such as the interface shown in FIG3 .
[0160] Furthermore, the smart interconnection of the mobile phone and the smart interconnection of the tablet computer can respectively instruct the transmission module of the local machine to use the transmission channel between the mobile phone and the tablet computer to transmit the data of the global collection service.
[0161] Since the global collection service initiated by the user is a global collection between the mobile phone, tablet computer and laptop computer, therefore, based on the establishment of the global collection service between the mobile phone and tablet computer, the laptop computer also needs to establish a global collection with the mobile phone.
[0162] As shown in FIG10 , the method 900 further includes:
[0163] S216. The smart interconnection of the mobile phone instructs the transmission module of the mobile phone to establish a transmission channel with the laptop computer.
[0164] S217 . The transmission module of the mobile phone instructs the WiFi connection module of the mobile phone to establish a physical link with the laptop computer.
[0165] S218. The WiFi connection module of the mobile phone sends a request 2 for requesting to establish a physical link to the WiFi connection module of the laptop. The request 2 carries information indicating that the mobile phone has established a P2P group and the role of the mobile phone is GO.
[0166] S105 : The WiFi connection module of the laptop computer determines that a connection conflict occurs based on request 2 and that the laptop computer can only function as a GO.
[0167] It should be understood that a laptop computer may be configured to function as a GO in a P2P group. Alternatively, the laptop computer's hardware configuration may restrict the laptop computer to functioning only as a GO. Hardware configuration may include, for example, a chip model. For example, if the laptop computer's chip model falls within a predetermined range, the laptop computer must function as a GO in a P2P group.
[0168] S106 : The WiFi connection module of the notebook computer sends information 1 indicating a connection conflict to the WiFi connection module of the mobile phone.
[0169] S219 , the WiFi connection module of the mobile phone indicates information 1 to the transmission module of the mobile phone, indicating a connection conflict.
[0170] S220. The transmission module of the mobile phone indicates information 1 to the smart interconnection of the mobile phone, that is, indicating a connection conflict.
[0171] Optionally, based on information 1, the smart interconnection of the mobile phone can display an interface for prompting the user that the file synchronization with the laptop has failed.
[0172] It should be understood that method 900 uses a method for establishing a global favorites service using a mobile phone, a laptop computer, and a tablet computer as an example to illustrate a connection conflict scenario between terminal devices. The mobile phone, laptop computer, or tablet computer may be replaced with other types of terminal devices, and the global favorites service may be replaced with other types of services requiring WiFi direct connections between multiple terminal devices. This application does not specifically limit this.
[0173] It should also be noted that scenarios involving WiFi direct connections other than P2P direct connections between terminal devices, such as establishing an AP-STA connection, are similar to the scenario involving establishing a P2P direct connection between terminal devices described in method 900 above. In some possible implementations, when establishing an AP-STA connection between terminal devices, the GO in method 900 can be replaced with an AP, and the GC can be replaced with a STA. For the sake of brevity, other scenarios involving establishing WiFi direct connections between terminal devices will not be further described here.
[0174] In order to solve the above-mentioned technical problems, the present application provides a data transmission method. When a first terminal device needs to establish a WiFi direct connection with multiple terminal devices, the first terminal device can determine a master device among the first terminal device and multiple terminal devices, so that all devices except the master device among the first terminal device and multiple terminal devices can establish a physical link with the master device, so that the first terminal device can establish services with multiple terminal devices, which can reduce connection conflict scenarios and improve user experience.
[0175] In order to better understand the terminal device in the embodiment of the present application, the hardware structure of the terminal device in the embodiment of the present application is described in detail below with reference to FIG11.
[0176] Figure 11 is a schematic diagram of the structure of a terminal device 1100 provided in an embodiment of the present application. As shown in Figure 11, the terminal device 1100 may include a processor 1110, an external memory interface 1120, an internal memory 1121, a universal serial bus (USB) interface 1130, a charging management module 1140, a power management module 1141, a battery 1142, an antenna 1, an antenna 2, a mobile communication module 1150, a wireless communication module 1160, an audio module 1170, a sensor module 1180, a button 1190, an indicator 1192, a camera 1193, and a display screen 1194.
[0177] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 1100. In other embodiments of the present application, the terminal device 1100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0178] The processor 1110 may include one or more processing units, for example, an application processor (AP), 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), a WiFi chip, etc. Optionally, a memory may be provided in the processor 1110 for storing instructions and data. The different processing units may be independent devices or integrated into one or more processors.
[0179] In some embodiments, the processor 1110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-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 subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0180] Among them, the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL); the I2S interface can be used for audio communication; the PCM interface can also be used for audio communication to sample, quantize and encode analog signals; the UART interface is a universal serial data bus for asynchronous communication; the MIPI interface can be used to connect the processor 1110 with peripheral devices such as the display 1194 and the camera 1193; the MIPI interface includes the camera serial interface (CSI), the display serial interface (DSI), etc.; the GPIO interface can be configured by software; the GPIO interface can be configured as a control signal or as a data signal.
[0181] USB interface 1130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. USB interface 1130 can be used to connect a charger to charge terminal device 1100, transfer data between terminal device 1100 and peripheral devices, and connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices.
[0182] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the terminal device 1100. In other embodiments of the present application, the terminal device 1100 may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.
[0183] The charging management module 1140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. While charging the battery 1142, the charging management module 1140 can also power the electronic device through the power management module 1141. The power management module 1141 is configured to connect the battery 1142, the charging management module 1140, and the processor 1110.
[0184] The wireless communication function of the terminal device 1100 can be implemented through antenna 1, antenna 2, mobile communication module 1150, wireless communication module 1160, modem processor and baseband processor.
[0185] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0186] The mobile communication module 1150 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied on the terminal device 1100.
[0187] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker, a receiver, etc.) or displays an image or video through the display screen 1194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 1110 and be set in the same device as the mobile communication module 1150 or other functional modules.
[0188] The wireless communication module 1160 can provide wireless communication solutions applied to the terminal device 1100, including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0189] The sensor module 1180 may include, for example, a pressure sensor, a gyroscope sensor, etc.
[0190] Terminal device 1100 implements display functionality through a GPU, display screen 1194, and an application processor. The GPU is a microprocessor for image processing that connects display screen 1194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 1110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0191] Display screen 1194 is used to display images, videos, and the like. Display screen 1194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, terminal device 1100 may include one or N display screens 1194, where N is a positive integer greater than one.
[0192] The terminal device 1100 can realize the shooting function through the ISP, camera 1193, video codec, GPU, display screen 1194 and application processor.
[0193] The ISP is used to process data fed back by the camera 1193. For example, when taking a photo, the shutter is opened, light is transmitted through the lens to the camera's photosensitive element, and the light signal is converted into an electrical signal. The camera's photosensitive element transmits the electrical signal to the ISP for processing and converting it into an image visible to the naked eye.
[0194] The camera 1193 is used to capture static images or videos. In some embodiments, the terminal device 1100 may include 1 or N cameras 1193, where N is a positive integer greater than 1.
[0195] The external memory interface 1120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 1100. The external memory card communicates with the processor 1110 via the external memory interface 1120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0196] The internal memory 1121 can be used to store computer executable program code, which includes instructions. The internal memory 1121 can include a program storage area and a data storage area. The processor 1110 executes various functional applications and data processing of the terminal device 1100 by running the instructions stored in the internal memory 1121 and / or the instructions stored in the memory provided in the processor.
[0197] The terminal device 1100 can implement audio functions such as music playback and recording through the audio module 1170, speakers, receivers, microphones, headphone jacks, and application processors.
[0198] Keys 1190 include a power button, a volume button, etc. Keys 1190 may be mechanical keys or touch keys. Terminal device 1100 may receive key inputs and generate key signal inputs related to user settings and function control of terminal device 1100.
[0199] Indicator 1192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0200] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Below, with reference to FIG12 and FIG13 , the process of establishing a WiFi direct connection between terminal devices 1201 and 1202, and the process of establishing a WiFi direct connection between terminal devices 1301 and 1302 are exemplified, using the layered architecture of the Android system and the Windows system as examples. WiFi direct connections may include, but are not limited to, P2P direct connections or AP-STA connections.
[0201] The hardware structures of terminal devices 1201, 1202, 1301, and 1302 can be shown in Figure 11. Terminal devices 1201, 1301, and 1302 are each installed with the Android system; terminal device 1202 is installed with the Windows system. To facilitate understanding, the layered architecture of the Android system and the associated terminology are first explained with reference to Figure 12.
[0202] As shown in Figure 12, the layered architecture divides the software system of the terminal device 1201 into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into six layers: from top to bottom, the application layer, the application framework layer, the Android runtime layer, the system library layer, the kernel layer, and the hardware layer.
[0203] 1. The application layer includes a series of application packages that users can directly access and is the window for users to interact with terminal devices. For example, the application packages may include WiFi, Bluetooth, PC Manager, etc.
[0204] Among them, PC Manager can include smart interconnection and device discovery modules.
[0205] Smart interconnection can include multiple services such as multi-screen collaboration, keyboard and mouse sharing, call sharing, and global favorites. In response to the user's selection of a service, Smart Interconnection can obtain the corresponding instruction and call the lower-level module to establish or disconnect the WiFi direct connection between the terminal devices, thereby establishing or disconnecting the service between the terminal devices. For example, in response to the user's instruction to establish a global favorite with the terminal device 1202, the Smart Interconnection of the terminal device 1201 can call the lower-level module to establish a WiFi direct connection with the terminal device 1202, thereby realizing the global favorite with the terminal device 1202.
[0206] It should be understood that in the embodiments of the present application, the business may refer to the business established between terminal devices through intelligent interconnection, such as multi-screen collaboration, keyboard and mouse sharing, call sharing or global collection, etc. The business may also be called service, device interconnection business, etc. This application does not make specific limitations on this.
[0207] The device discovery module can be used to discover other devices and can indicate the device information of discovered online devices to the smart interconnection, so that the smart interconnection can indicate and display the online devices. For example, when terminal device 1202 comes online, the device discovery module of terminal device 1201 can discover terminal device 1202 and indicate the device information of terminal device 1202, such as device ID and model, to the smart interconnection of terminal device 1201.
[0208] It should be understood that the smart interconnection and device discovery modules can be two modules in the PC manager, or they can be two independent applications that exist in the application layer. This application does not make specific limitations on this.
[0209] 2. The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 4, the application framework layer may include a transmission module, a WiFi connection module, and a security authentication module.
[0210] The transmission module may instruct the WiFi connection module to establish or disconnect the WiFi direct connection between the terminal devices during the process of the terminal device 1201 establishing or disconnecting the WiFi direct connection with the terminal device 1202. Alternatively, the transmission module may establish a transmission channel between the terminal devices 1202 based on the WiFi direct connection established by the WiFi connection module, and utilize the transmission channel to transmit data to the terminal device 1202.
[0211] The WiFi connection module may include a WiFi direct dynamic networking control module, a WiFi direct module, and a WiFi direct connection counting module.
[0212] The WiFi direct dynamic networking control module can call the WiFi direct connection counting module to add or subtract the number of references to the physical link between the terminal device 1202 based on the instruction of the transmission module to establish or disconnect the WiFi direct connection between the terminal devices; or, based on the instruction of the transmission module to establish or disconnect the WiFi direct connection between the terminal devices 1202, call the WiFi direct connection module to instruct the WiFi connection service to establish or disconnect the WiFi direct connection between the terminal devices.
[0213] The security authentication module is used to perform security authentication on the terminal device 1202 when the WiFi direct dynamic networking control module receives an instruction from the transmission module to establish or disconnect the WiFi direct connection between the terminal devices, and to indicate to the WiFi direct dynamic networking control module the key and / or secret key for signaling interaction with the terminal device 1202.
[0214] 3. The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0215] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0216] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0217] 4. The system library can include multiple functional modules, such as function libraries, graphics processing libraries (such as OpenGL ES), and WiFi connection services.
[0218] The function library provides developers with API interfaces for multiple services, making it easy for developers to quickly integrate and implement various functions.
[0219] The graphics processing library is used to implement graphics drawing, image rendering, compositing, and layer processing.
[0220] The WiFi connection service can call interfaces to control the kernel-layer driver. For example, the WiFi connection service can call WiFi manager interfaces. WiFi manager interfaces include discover peers and connect interfaces, which allow users to directly control WiFi direct connections. The WiFi connection service can call the discover peer interface to implement device discovery; calling the connect interface enables the WiFi driver to drive the WiFi chip to establish or disconnect a WiFi direct connection with the terminal device 1202.
[0221] 5. The kernel layer is a layer between hardware and software. In an exemplary embodiment, the kernel layer includes a WiFi driver, a display driver, etc.
[0222] 6. The Android system may also include a hardware layer not shown in Figure 12. The hardware layer may include a variety of hardware, such as a display screen, a GPU, a WiFi chip, and the like.
[0223] Then, combined with Figure 12, the layered architecture of the Windows system and the terms involved are explained.
[0224] As shown in Figure 12, the layered architecture divides the software system of the terminal device 1202 into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Windows system is divided into user mode and kernel mode.
[0225] The user state includes user application processes, system processes, and service processes, while the kernel state includes the kernel layer.
[0226] 1. User application processes include a series of application packages that users can directly access and serve as a window for users to interact with terminal devices. For example, application packages may include WiFi, Bluetooth, and PC Manager. PC Manager may include smart interconnection and device discovery modules.
[0227] 2. System processes and service processes provide application programming interfaces (APIs) and programming frameworks for user application processes. System processes and service processes include predefined functions. As shown in Figure 12, system processes and service processes may include a transmission module, a Wi-Fi connection module, a security authentication module, and a Wi-Fi connection service.
[0228] 3. The kernel layer is a layer between hardware and software. In an exemplary embodiment, the kernel layer includes a WiFi driver, a display driver, etc.
[0229] It should be understood that the specific functions and terminology of each software module involved in the Windows system are similar to the specific functions of each software module involved in the above-mentioned Android system. Please refer to the above description and will not be repeated here.
[0230] Figure 12 is a schematic diagram of the process of establishing a service between a terminal device 1201 installed with an Android system and a terminal device 1202 installed with a Windows system, provided by an embodiment of the present application. The device discovery module of terminal device 1201 can interact with the driver through the application framework layer, allowing the driver to drive the hardware in terminal device 1201 to send and receive signals, thereby obtaining device information of terminal device 1202; the device discovery module of terminal device 1202 can interact with the driver through system processes and service processes, allowing the driver to drive the hardware in terminal device 1202 to send and receive signals, thereby obtaining device information of terminal device 1201. In this way, terminal device 1201 and terminal device 1202 can each display the other device through smart interconnection.
[0231] Based on the user's selection operation to instruct terminal device 1201 to establish a service with terminal device 1202, the WiFi connection module of terminal device 1201 and the WiFi connection module of terminal device 1202 can perform signaling interaction, allowing the slave device in the two devices to obtain the account number and password of the master device. In this way, the WiFi connection module of the slave device can use the account number and password of the master device to call the connection interface of the WiFi module through the WiFi connection service, so that the WiFi driver WiFi chip connects to the master device, thereby establishing a WiFi direct connection between terminal device 1201 and terminal device 1202, or, in other words, establishing a physical link between terminal device 1201 and terminal device 1202.
[0232] Furthermore, the transmission modules of terminal device 1201 and terminal device 1202 can perform signaling interaction, so that terminal device 1201 and terminal device 1202 can obtain the device IP of the other terminal device, thereby establishing a transmission channel between terminal device 1201 and terminal device 1202. Terminal device 1201 and terminal device 1202 can then use the transmission channel to transmit data generated by the service between terminal device 1201 and terminal device 1202, so that the service between terminal device 1201 and terminal device 1202 can operate normally.
[0233] FIG13 is a schematic diagram of a process of establishing a service between a terminal device 1301 installed with an Android system and a terminal device 1302 installed with an Android system, provided in an embodiment of the present application.
[0234] It should be understood that the software structure of terminal device 1301 and terminal device 1302 is the same as the software structure of terminal device 1201, and reference can be made to the above description of the Android system of terminal device 1201; the process of establishing business between terminal device 1301 and terminal device 1302 is similar to the process of establishing business between the above-mentioned terminal device 1201 and terminal device 1202, and reference can be made to the above description, which will not be repeated here.
[0235] It should be noted that the embodiments of this application are described using the Android system and the Windows system as examples, but its basic principles are also applicable to terminal devices using other operating systems. This application does not limit the operating system used by the terminal device.
[0236] It should also be noted that the embodiments of the present application are described using the Android system and the Windows system as examples, but the Android system and the Windows system used by the terminal device may also include more or fewer layers, or include more or fewer software modules. In addition, the names of the software modules shown in Figures 12 and 13 are only examples, and each module may also have other names. The Android system and the Windows system shown in Figures 12 and 13 do not constitute a limitation on the embodiments of the present application.
[0237] The data transmission method of the present application is described in detail below with reference to Figures 14 to 17. The embodiments shown in this application can be executed by terminal devices, such as mobile phones, tablet computers, smart bracelets, etc. The specific forms and quantities of the devices shown therein are only examples and should not constitute any limitation on the implementation of the method provided in this application. Below, taking the first terminal device, the second terminal device and the third terminal device as the execution subjects as an example, the data transmission method of the embodiment of the present application is described in detail from the perspective of device interaction between the three terminal devices.
[0238] It should be understood that the terminal device can be the terminal device itself, or it can be a chip, chip system or processor that supports the terminal device to implement the data transmission method, or it can be a logic module or software that can implement all or part of the terminal device functions. The hardware structure of the terminal device can be as shown in Figure 11, and the software structure can be as shown in Figure 12 or Figure 13. This application does not make specific limitations on this.
[0239] First, taking the scenario shown in the above method 1000 as an example, the data transmission method 1400 of the present application is described in detail in conjunction with Figure 14. Among them, the first terminal device can be understood as the laptop computer in method 1000, the second terminal device can be understood as the mobile phone in method 1000, and the third terminal device can be understood as the tablet computer in method 1000.
[0240] It should be noted that, for ease of understanding, in method 1400, the steps starting with S1000 and numbered beginning with S1 are steps executed by the first terminal device or steps triggered by the first terminal device; the steps starting with S2000 and numbered beginning with S2 are steps executed by the second terminal device or steps triggered by the second terminal device; and the steps starting with S3000 and numbered beginning with S3 are steps executed by the third terminal device or steps triggered by the third terminal device.
[0241] As shown in FIG. 14 , method 1400 includes:
[0242] Among them, S1401 is a process of device discovery by the first terminal device, the second terminal device and the third terminal device.
[0243] It should be understood that the process of discovering the first terminal device can refer to the implementation methods of S100 to S104 in method 1000; the process of discovering the second terminal device can refer to the implementation methods of S200 to S204 in method 1000; the process of discovering the third terminal device can refer to the implementation methods of S300 to S304 in method 1000, which will not be repeated here.
[0244] S2001. In response to user operation 4 on a second terminal device, the smart interconnection of the second terminal device receives a first instruction. The first instruction is used to instruct the second terminal device to add a file to favorites, that is, to enable global favorites on the second terminal device. Global favorites require that the second terminal device establish a transmission channel with all online devices discovered by the second terminal device. The online devices discovered by the second terminal device include the first terminal device and the third terminal device.
[0245] Since the smart interconnection of the second terminal device can determine that the current online devices include the first terminal device and the third terminal device in the process of S1401, the first instruction here can also be understood as an instruction instructing the second terminal device to establish a P2P direct connection with the third terminal device and the first terminal device respectively.
[0246] It should be understood that the first instruction can also be understood as an instruction to instruct the second terminal device to start the global collection. The first instruction is obtained based on operation 4 input by the user to the second terminal device. Operation 4 can be the operation of the user instructing to start the global collection in the first to fifth terminal device starting global collection methods mentioned above. For example, operation 4 can be the operation of the user clicking the "global collection" icon in the recommended items in the start menu bar in the first possible implementation; it can also be the operation of the user clicking the global collection icon in the second possible implementation; it can also be the operation of the user dragging the document into the area 301 of the favorite files in the third possible implementation; it can also be the operation of the user dragging the picture 402 in the web page into the area 401 of the favorite files in the fourth possible implementation; it can also be the operation of the user clicking the desktop shortcut of the global collection in the fifth possible implementation. Please refer to the description above and will not be repeated here.
[0247] S2002. In response to the first instruction, the smart interconnection of the second terminal device obtains a list of online devices. The list of online devices includes information indicating online devices discovered during the device discovery process of the second terminal device, namely, information indicating the first terminal device and information indicating the third terminal device. The information indicating the third terminal device (the first terminal device) may be, for example, the device ID, device name, or device model of the third terminal device (the first terminal device).
[0248] S2003: The smart interconnection of the second terminal device instructs the WiFi module of the second terminal device to establish a global network. Global networking can be understood as the establishment of a P2P group by the currently online devices. That is, the first terminal device, the second terminal device, and the third terminal device establish a P2P group.
[0249] The smart interconnection of the second terminal device also indicates to the WiFi module of the second terminal device information indicating the currently online device, that is, information indicating the first terminal device, information indicating the second terminal device, and information indicating the third terminal device.
[0250] S2004. The WiFi connection module of the second terminal device determines that the first terminal device is a GO among the currently online devices.
[0251] It should be understood that the current online devices include a first terminal device, a second terminal device, and a third terminal device.
[0252] The WiFi connection module of the second terminal device can use one or more of the following rules to determine the GO: (1) select a device that is capable of being the master device in the group; (2) select the device with the largest media access control (MAC) address; (3) select the device with the smallest power consumption per unit time; (4) select the master device belonging to the first group, where the first group is the group established by the WiFi connection module of the second terminal device before determining the GO in the current online device. For example, when the second terminal device determines the GO, if the first terminal device is the GO of the P2P group established by the first terminal device and the third terminal device, the second terminal device can determine that the first terminal device is the GO; or, select a plug-in device.
[0253] Among them, if there is a terminal device that is equipped with the ability to act as a GO in a P2P group, the terminal device that is equipped with the ability to act as a GO in a P2P group is given priority. In this way, when selecting a device that is equipped with the ability to act as a master device in a group as a GO, it is convenient to improve the success rate of forming a new group; select the device with the lowest power consumption per unit time and / or select a plug-in device, so that the GO is less sensitive to power consumption. Because the power consumption of the GO may be large, this can reduce the situation where the group is disbanded due to insufficient power of the GO. Selecting the device with the largest MAC address allows more types of terminal devices to connect to the GO. Since the master device in the first group is the master device selected when the first group is formed, the master device of the first group may meet one or more of the above rules. Therefore, the second terminal device can directly determine the master device in the first group as the GO.
[0254] In the embodiment of the present application, the first terminal device may be a terminal device that is capable of being a GO in a P2P group, for example, a laptop computer, etc. Therefore, the WiFi connection module of the second terminal device determines that the first terminal device is a GO.
[0255] S2005. The WiFi connection module of the second terminal device sends information for instructing global networking to the WiFi connection module of the first terminal device.
[0256] Optionally, the information indicating global networking includes a list of devices requiring global networking and information indicating that the first terminal device is a GO. The list of devices requiring global networking includes information indicating each device in the devices requiring global networking, such as a device ID, device model, and device name. The devices requiring global networking may be the first terminal device, the second terminal device, and the third terminal device.
[0257] Optionally, the information for indicating global networking may also carry information for indicating that the first terminal device is a GO and information for indicating the terminal device to which the first terminal device needs to connect, i.e., information for indicating the second terminal device and information for indicating the third terminal device.
[0258] Based on the information for instructing to perform global networking, the WiFi connection module of the first terminal device can create a GO.
[0259] S1001: After the GO is created, the WiFi connection module of the first terminal device sends a request 3 to the WiFi connection module of the second terminal device, requesting to establish a physical link. Request 3 may carry the account number and password of the first terminal device.
[0260] It should be understood that the account and password of the first terminal device are the account and password used to establish a P2P direct connection between the second terminal device and the first terminal device. For the sake of brevity, the account and password will not be explained in the following text.
[0261] Optionally, request 1 is further used to instruct the WiFi direct connection module of the second terminal device to increase the reference count of the physical link between the first terminal device and the second terminal device by 1.
[0262] A reference count can be understood as the number of times a service between terminal devices references an established physical link between the terminal devices. For example, if a global favorites service is to be established between a first terminal device and a second terminal device, and the implementation of the global favorites service is based on the physical link between the first and second terminal devices, the reference count of the physical link between the first and second terminal devices is incremented by 1. For the sake of brevity, reference counts are not further explained below.
[0263] Optionally, before S1001, the first terminal device may further determine whether a physical link has been established between the first terminal device and the second terminal device. If not, S1001 is executed. If yes, S1003 may be executed.
[0264] The WiFi connection module of the first terminal device can call a function to obtain information indicating whether a physical link has been established between the first terminal device and the second terminal device. For example, the WiFi connection module of the first terminal device can call a function to check whether the list of established physical links of the first terminal device includes information indicating the second terminal device; if so, it indicates that a physical link has been established between the first terminal device and the second terminal device; otherwise, it indicates that a physical link has not been established between the first terminal device and the second terminal device.
[0265] S2006. In response to request 3, the WiFi connection module of the second terminal device connects to the first terminal device through the account of the first terminal device and the password of the mobile phone, that is, establishes a physical link with the first terminal device.
[0266] Optionally, the WiFi connection module of the second terminal device can call a function and use the account and password of the first terminal device to connect to the first terminal device, that is, establish a P2P direct connection with the first terminal device.
[0267] S2007. In response to request 3, the WiFi connection module of the second terminal device increases the reference count of the physical link between the first terminal device and the second terminal device by 1.
[0268] It should be understood that S2007 can be executed before or after S2006, and this application does not make any specific limitation on this.
[0269] S2008: The WiFi connection module of the second terminal device sends a physical link establishment response to the WiFi connection module of the first terminal device. The physical link establishment response is used to indicate that the physical link is successfully established.
[0270] S1002: In response to the physical link establishment response, the WiFi connection module of the first terminal device increases the reference count of the physical link between the first terminal device and the second terminal device by 1.
[0271] S1003: The WiFi connection module of the first terminal device sends a request 4 to the WiFi connection module of the third terminal device, where the request 4 is used to request the establishment of a physical link. The request 4 may carry the account number and password of the first terminal device.
[0272] S3000. In response to request 4, the WiFi connection module of the third terminal device connects to the first terminal device through the account of the first terminal device and the password of the mobile phone, that is, establishes a physical link with the first terminal device.
[0273] S3001. In response to request 4, the WiFi connection module of the third terminal device increases the reference count of the physical link between the first terminal device and the third terminal device by 1.
[0274] It should be understood that S3001 can be executed before or after S3000, and this application does not make any specific limitation on this.
[0275] S3002: The WiFi connection module of the third terminal device sends a physical link establishment response to the WiFi connection module of the first terminal device. The physical link establishment response is used to indicate that the physical link is successfully established.
[0276] S1004. In response to the physical link establishment response, the WiFi connection module of the first terminal device increases the reference count of the physical link between the first terminal device and the third terminal device by 1.
[0277] It should be understood that the implementation of S1003 and S1004 is similar to that of S1001 and S1002, and the implementation of S3000 to S3002 is similar to that of S2006 to S2008. Please refer to the above description and no further details will be given here.
[0278] S1005: The WiFi connection module of the first terminal device sends information indicating successful global networking to the WiFi connection module of the second terminal device. The information indicating successful global networking indicates that the first terminal device has established physical links with the second terminal device and the third terminal device respectively.
[0279] S2009. In response to the information indicating that the global networking is successful, the WiFi connection module of the second terminal device indicates to the smart interconnection of the second terminal device that the global networking is successful, and instructs to start establishing a transmission channel.
[0280] S2010: The smart interconnection of the second terminal device instructs the transmission module of the second terminal device to establish transmission channel 1 between the second terminal device and the third terminal device. For example, the smart interconnection of the second terminal device may indicate information identifying the third terminal device, such as the device ID of the third terminal device, to the transmission module of the second terminal device. Based on this information, the transmission module of the second terminal device may determine that transmission channel 1 needs to be established with the third terminal device.
[0281] S2011. The transmission module of the second terminal device instructs the WiFi connection module of the second terminal device to establish a transmission channel 1 between the second terminal device and the third terminal device.
[0282] S2012. In response to the instruction from the transmission module of the second terminal device in S2011, the WiFi connection module of the second terminal device sends information indicating the reuse of the physical link to the WiFi connection module of the third terminal device. Based on the information indicating the reuse of the physical link, the WiFi connection module of the third terminal device may determine that the second terminal device and the third terminal device need to utilize an existing physical link, and establish a transmission channel between the second terminal device and the third terminal device.
[0283] S3003. In response to the information indicating the reuse of the physical link from the WiFi connection module of the second terminal device, the WiFi connection module of the third terminal device sends a physical link reuse request to the WiFi connection module of the first terminal device.
[0284] Since the establishment of the transmission channel between the second terminal device and the third terminal device needs to rely on the physical link between the first terminal device and the second terminal device and the physical link between the first terminal device and the third terminal device, the third terminal device here needs to instruct the first terminal device, the second terminal device and the third terminal device to reuse the established physical link.
[0285] S1006. In response to the physical link reuse request, the WiFi connection module of the first terminal device increases the reference count by 1.
[0286] S3004: In response to the information indicating the reuse of the physical link from the WiFi connection module of the second terminal device, the WiFi connection module of the third terminal device increases the reference count by 1.
[0287] S3005. The WiFi connection module of the third terminal device sends a physical link multiplexing response to the WiFi connection module of the second terminal device. The physical link multiplexing response indicates that the third terminal device has determined to establish a transmission channel with the second terminal device using the existing physical link. The physical link establishment response carries the device IP address of the third terminal device.
[0288] S2013. The WiFi connection module of the second terminal device increases the reference count by 1.
[0289] It should be understood that S2013 can be executed in parallel with S2012, and S2013 can also be executed before or after S2012. This application does not make specific limitations on this.
[0290] It should be noted that the physical link multiplexing process, namely S2012 and S2013, S3003 and S3004, and S1006, is to enable a virtual physical link establishment process to be performed between the WiFi connection module of the second terminal device and the WiFi connection module of the third terminal device. That is, no physical link is actually established, but the WiFi connection module of the second terminal device, the WiFi connection module of the third terminal device and the WiFi connection module of the first terminal device all increase the reference count by 1.
[0291] S2014: The WiFi connection module of the second terminal device indicates to the transmission module of the second terminal device that the physical link multiplexing is successful, and indicates the device IP of the third terminal device.
[0292] S3006. The WiFi connection module of the third terminal device indicates to the transmission module of the third terminal device that the physical link multiplexing is successful.
[0293] S2015: The transmission module of the second terminal device sends information for instructing the transmission module of the third terminal device to establish transmission channel 1. The information for instructing the establishment of transmission channel 1 carries the device IP of the second terminal device.
[0294] S3007: In response to the information from the transmission module of the second terminal device indicating the establishment of the transmission channel, the transmission module of the third terminal device sends a transmission channel establishment response to the transmission module of the second terminal device. The transmission channel establishment response is used to indicate the agreement to establish the transmission channel or the successful establishment of the transmission channel.
[0295] S3008. The transmission module of the third terminal device indicates to the smart interconnection of the third terminal device that the transmission channel 1 is successfully established.
[0296] S3009: In response to the indication that the transmission channel 1 is successfully established, the third terminal device's smart interconnection instruction displays a global favorites interface 1. The global favorites interface 1 can display files collected by the second terminal device.
[0297] S2016. The transmission module of the second terminal device indicates to the smart interconnection of the second terminal device that transmission channel 1 is successfully established.
[0298] S2017: The smart interconnection of the second terminal device sends the files collected by the second terminal device to the smart interconnection of the third terminal device via transmission channel 1. In this way, the third terminal device can display the files collected by the second terminal device, that is, the global collection interface 1 can display the files collected by the second terminal device.
[0299] S2018. The smart interconnection of the second terminal device instructs the transmission module of the second terminal device to establish transmission channel 2 between the second terminal device and the first terminal device. For example, the smart interconnection of the second terminal device may indicate information indicating the first terminal device to the transmission module of the second terminal device. Based on this information, the transmission module of the second terminal device may determine that transmission channel 2 needs to be established with the first terminal device.
[0300] S2019. The transmission module of the second terminal device instructs the WiFi connection module of the second terminal device to establish a transmission channel 2 between the second terminal device and the first terminal device.
[0301] S2020. In response to the instruction of the transmission module of the second terminal device in S2011, the WiFi connection module of the second terminal device sends information indicating the reuse of the physical link to the WiFi connection module of the first terminal device.
[0302] The WiFi connection module of the first terminal device can determine that the second terminal device and the first terminal device need to use the existing physical link to establish a transmission channel between the second terminal device and the first terminal device based on the information used to indicate the reuse of the physical link.
[0303] S1007. The WiFi connection module of the first terminal device sends a physical link multiplexing response to the WiFi connection module of the second terminal device. The physical link multiplexing response indicates that the first terminal device has determined to establish a transmission channel with the second terminal device using an existing physical link. The physical link establishment response carries the device IP address of the first terminal device.
[0304] S1008. The WiFi connection module of the first terminal device increases the reference count by 1.
[0305] S2021. The WiFi connection module of the second terminal device increases the reference count by 1.
[0306] S2022: The WiFi connection module of the second terminal device indicates to the transmission module of the second terminal device that the physical link multiplexing is successful, and indicates the device IP of the first terminal device.
[0307] S1009. The WiFi connection module of the first terminal device indicates that the physical link multiplexing of the transmission module of the first terminal device is successful.
[0308] S2023: The transmission module of the second terminal device sends information for instructing the transmission module of the first terminal device to establish transmission channel 2. The information for instructing the establishment of transmission channel 2 carries the device IP of the second terminal device.
[0309] S1010: In response to information from the transmission module of the second terminal device indicating establishment of a transmission channel, the transmission module of the first terminal device sends a transmission channel establishment response to the transmission module of the second terminal device. The transmission channel establishment response indicates agreement to establish the transmission channel or successful establishment of the transmission channel.
[0310] S1011. The transmission module of the first terminal device indicates to the smart interconnection of the first terminal device that transmission channel 2 is successfully established.
[0311] S2024. The transmission module of the second terminal device indicates to the smart interconnection of the second terminal device that transmission channel 2 is successfully established.
[0312] S2025: The smart interconnection of the second terminal device sends the files collected by the second terminal device to the smart interconnection of the first terminal device via transmission channel 2. In this way, the first terminal device can display the files collected by the second terminal device, that is, the global collection interface 2 can display the files collected by the second terminal device.
[0313] S1012: The smart interconnection instruction of the first terminal device displays the global collection interface 2. The global collection interface 2 can display the files collected by the second terminal device.
[0314] Optionally, the process of establishing the global favorites among the second terminal device, the first terminal device and the third terminal device may be performed by the first terminal device, the second terminal device and the third terminal device in a global networking state.
[0315] Based on the above embodiment, after the second terminal device establishes a global collection with the first and third terminal devices, i.e., the first and third terminal devices can display and access files collected by the second terminal device, the first, second, and third terminal devices can exit the global networking state. The process of the first, second, and third terminal devices exiting the global networking state can be shown in Figure 15.
[0316] As shown in FIG15 , the method 1400 further includes the following steps:
[0317] S2026: The WiFi connection module of the second terminal device sends information indicating the exit from global networking to the WiFi connection module of the first terminal device. The exit from global networking can also be understood as the second terminal device having completed global networking and no longer needing to be in global networking.
[0318] S1023: The WiFi connection module of the first terminal device sends a response 1 to the WiFi connection module of the second terminal device. The response 1 is a response to the information indicating the state of exiting the global network. The response 1 may be an ACK message.
[0319] S1024: The WiFi connection module of the first terminal device sends a disconnect request to the WiFi connection module of the second terminal device. The disconnect request is used to request a physical link disconnection. That is, the first terminal device and the second terminal device execute a physical link disconnection logic.
[0320] S2027: The WiFi connection module of the second terminal device sends a disconnection response to the WiFi connection module of the first terminal device. The disconnection response indicates that the second terminal device determines to execute a physical link disconnection logic.
[0321] S2028. The WiFi connection module of the second terminal device decrements the reference count by 1.
[0322] S1025. The WiFi connection module of the first terminal device decrements the reference count by 1.
[0323] The physical link disconnection logic is executed once by the first terminal device and the second terminal device. The first terminal device and the second terminal device respectively reduce the reference count by 1, so that the extra reference count added when the first terminal device and the second terminal device establish the physical link (S1002 and S2007) is reduced.
[0324] S3010. The WiFi connection module of the third terminal device sends information indicating a state of exiting the global networking to the WiFi connection module of the first terminal device.
[0325] S1026: The WiFi connection module of the first terminal device sends a response 2 to the WiFi connection module of the third terminal device. The response 2 is a response to the information indicating the state of exiting the global network. The response 2 may be an ACK message.
[0326] S1027: The WiFi connection module of the first terminal device sends a disconnect request to the WiFi connection module of the third terminal device. The disconnect request is used to request a physical link disconnection. That is, the first terminal device and the third terminal device execute a physical link disconnection logic.
[0327] S3011: The WiFi connection module of the third terminal device sends a disconnection response to the WiFi connection module of the first terminal device. The disconnection response indicates that the third terminal device determines to execute a physical link disconnection logic.
[0328] S3012: The WiFi connection module of the third terminal device decrements the reference count by 1.
[0329] S1028. The WiFi connection module of the first terminal device decrements the reference count by 1.
[0330] The physical link disconnection logic is executed once by the first terminal device and the third terminal device. The first terminal device and the third terminal device respectively reduce the reference count by 1, so that the extra reference count added when the first terminal device and the third terminal device establish the physical link (S1004 and S3001) is reduced.
[0331] Optionally, the WiFi connection module of the second terminal device can exit the global networking state based on response 2; and / or the WiFi connection module of the third terminal device can exit the global networking state based on response 2; and / or the first terminal device can exit the global networking state by sending response 2 to all GCs connected to it. In this way, when the first terminal device, the second terminal device, or the third terminal device receives a connection request from another device, it can process the connection request from the other device.
[0332] It should also be noted that the above description of the method of the embodiment of the present application uses the example of establishing a P2P direct connection between the first terminal device, the second terminal device, and the third terminal device. In some implementations, the above-mentioned P2P direct connection can also be replaced by a WiFi AP+STA connection, the above-mentioned GO can be replaced by an AP, and the above-mentioned GC can be replaced by an STA. This application does not specifically limit this.
[0333] The data transmission method of the present application is described below from the perspective of interaction between multiple devices. The device involved below can be a terminal device, a chip, a chip system or a processor in a terminal device, or a logic module or software that can realize all or part of the functions of the terminal device. The hardware structure of the terminal device can be as shown in Figure 3, and the software structure can be as shown in Figure 4 or Figure 5. This application does not make specific restrictions on this.
[0334] The embodiment of the present application also provides a data transmission method 1600, wherein the hardware structure of the device involved may be as shown in FIG11, and the software structure may be as shown in FIG12 or FIG13. As shown in FIG16, the method 1600 includes the following steps:
[0335] S1601: Device 1 discovers online devices, including device 2 and device 3.
[0336] S1602 : In response to the user instructing device 1 to create a global favorite service, device 1 is determined as the primary device among device 1 and the online device.
[0337] S1603: Device 1 establishes a physical link with device 2.
[0338] S1604: Device 1 establishes a physical link with device 3.
[0339] It should be understood that the implementation of S1601 is similar to the implementation of S200 to S204 in method 900; the implementation of S1602 is similar to the implementation of S2001 to S2004 in method 1400, wherein device 1 can be understood as the second terminal device in method 1400, device 2 can be understood as the first terminal device in method 1400, and device 3 can be understood as the third terminal device in method 1400; the implementation of S1603 is similar to S1001 and S1002 and S2004 in method 1400. The implementation methods of S006 to S2008 are similar, wherein device 1 can be understood as the first terminal device in method 1400, and device 2 can be understood as the second terminal device in method 1400; the implementation method of S1604 is similar to the implementation methods of S1003 and S1004 and S3000 to S3002 in method 1400, wherein device 1 can be understood as the first terminal device in method 1400, and device 3 can be understood as the third terminal device in method 1400. Please refer to the above description and no further details will be given here.
[0340] Optionally, after S1604 , method 1600 may further include: S1605 , device 1 establishes a transmission channel with device 2 , and implements a global collection service with device 2 ; S1606 , device 1 establishes a transmission channel with device 3 , and implements a global collection service with device 3 .
[0341] It should be understood that the implementation of S1605 and S1606 are similar to the implementation of S2020 to S2025 and S1007 to S1012 in method 1400, respectively. Please refer to the above description and no further details will be given here.
[0342] Optionally, after device 1 establishes a global favorites service with device 2 and device 3, device 1, device 2 and device 3 may exit the global networking state.
[0343] It should be understood that the implementation methods of device 1, device 2 and device 3 to exit the global networking state are similar to the implementation methods of S2026 to S2028, S1013 to S1018, and S3010 to S3012 in method 1400, respectively. Please refer to the above description and will not be repeated here.
[0344] The embodiment of the present application also provides a data transmission method 1700, wherein the hardware structure of the device involved may be as shown in FIG11, and the software structure may be as shown in FIG12 or FIG13. As shown in FIG17, the method 1700 includes the following steps:
[0345] S1701: Device 4 discovers online devices, including device 5 and device 6.
[0346] S1702 : In response to the user instructing device 4 to create a global favorite service, device 6 is determined as the master device among device 4 and the online device.
[0347] S1703 : Device 4 sends information to device 6 indicating establishment of a physical link with device 4 and device 5 .
[0348] It should be understood that the information indicating the establishment of physical links with device 4 and device 5 may include information indicating device 6 as a master device and a global networking device list. The global networking device list may include information indicating devices requiring global networking: information indicating device 4, such as device 4's device ID; information indicating device 5, such as device 5's device ID; and information indicating device 6, such as device 6's device ID.
[0349] S1704 : In response to the information indicating the establishment of physical links with device 4 and device 5 , device 6 establishes a physical link with device 5 .
[0350] S1705 : In response to the information indicating the establishment of physical links with device 4 and device 5 , device 6 establishes a physical link with device 4 .
[0351] Optionally, after S1705 , method 1700 may further include: device 4 establishing a transmission channel with device 5 and implementing a global collection service with device 5 ; device 4 establishing a transmission channel with device 6 and implementing a global collection service with device 6 .
[0352] Optionally, after device 6 establishes a global favorite with device 4 and device 5, device 4, device 5 and device 6 may exit the global networking state.
[0353] It should be understood that in method 1700, device 4 can be understood as the second terminal device in method 1400, device 5 can be understood as the third terminal device in method 1400, and device 6 can be understood as the first terminal device in method 1400. The implementation methods of each step in method 1700 are similar to the implementation methods of each step in method 1400. Please refer to the above description and will not be repeated here.
[0354] It should also be understood that the order of execution of the above methods does not necessarily mean the order in which they are executed. The order in which the methods are executed should be determined by their functions and internal logic.
[0355] It should be noted that in the embodiments of this application, states such as the first state and the global networking state refer to states in which a terminal device enters a specific processing strategy. For example, when a terminal device enters the global networking state, global networking is performed, meaning that the master device establishes a physical link with the remaining devices. Entering one of the above states can also be understood as the terminal device entering a certain mode, etc., which is not specifically limited in this application.
[0356] It should also be noted that in the embodiments of the present application, the multiple devices that discover each other can be devices with their Bluetooth and / or WiFi switches turned on and logged into the same user account. Different from the device account used to establish a WiFi direct connection, the user account here refers to the account logged into the device by the user to identify the device as belonging to that user.
[0357] The data transmission method according to an embodiment of the present application is described in detail above in conjunction with Figures 1 to 17 . The data transmission device according to an embodiment of the present application is described in detail below in conjunction with Figure 18 .
[0358] Figure 18 is a schematic block diagram of a data transmission device 1800 provided in an embodiment of the present application. The device 1800 includes a processor 1801, a communication interface 1802 and a memory 1803. Among them, the processor 1801, the communication interface 1802 and the memory 1803 communicate with each other through an internal connection path, the memory 1803 is used to store instructions, and the processor 1801 is used to execute the instructions stored in the memory 1803. The communication interface 1802 can be used to send signals to other devices (such as the processor 1801 or the touch screen of the terminal device), and can also be used to receive signals from other devices (such as the memory 1803). Exemplarily, the communication interface 1802 reads the instructions stored in the memory 1803 and sends the instructions to the processor 1801.
[0359] It should be understood that the apparatus 1800 can be specifically a terminal device or device in the above-mentioned embodiment, and can be used to execute the various steps and / or processes corresponding to the terminal device or device in the above-mentioned method embodiment. Optionally, the memory 1803 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type. The processor 1801 can be used to execute instructions stored in the memory, and when the processor 1801 executes the instructions stored in the memory, the processor 1801 is used to execute the various steps and / or processes of the above-mentioned method embodiment.
[0360] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0361] During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
[0362] The present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to implement the method shown in the above method embodiment.
[0363] The present application also provides a computer program product, which includes a computer program (also referred to as code or instructions). When the computer program runs on a computer, the computer can execute the method shown in the above method embodiment.
[0364] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0365] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0366] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0367] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of the present embodiment according to actual needs.
[0368] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0369] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0370] The above description is merely a specific embodiment of the present application, but the scope of protection of the embodiments of the present application is not limited thereto. Any person skilled in the art can easily conceive of changes or substitutions within the technical scope disclosed in the embodiments of the present application, and such changes or substitutions should be included in the scope of protection of the embodiments of the present application. Therefore, the scope of protection of the embodiments of the present application should be based on the scope of protection of the claims.
Claims
1. A data transmission method, characterized in that, The method includes: The first device discovers the online devices, where the online devices include a second device and a third device; In response to an operation of the user to establish a first service with the online devices, the first device determines a master device from the first device and the online devices; The first device instructs the master device to establish a physical link with the remaining devices, where the remaining devices are the devices other than the master device among the online devices and the first device, and the first device is not the master device; or, the first device respectively establishes physical links with the second device and the third device, and the first device is the master device.
2. The method according to claim 1, wherein After the first device instructs the master device to establish a physical link with the remaining devices, the method further includes: Receiving first information from the master device, where the first information is used to indicate that the physical link between the master device and the remaining devices is established; In response to the first information, the first device establishes the first service with the online devices.
3. The method according to claim 2, wherein After the first device establishes the first service with the online devices, the method further includes: Sending information for instructing to exit a first state to the master device, where the first state is the state in which the master device establishes a physical link with the remaining devices; Receiving a first response from the master device and exiting the first state.
4. The method according to claim 1, wherein After the first device respectively establishes physical links with the second device and the third device, the method further includes: The first device establishes the first service with the online devices.
5. The method according to claim 4, wherein After the first device establishes the first service with the online devices, the method further includes: The first device respectively receives information for instructing to exit a first state from the second device and the third device, where the first state is the state in which the master device establishes a physical link with the remaining devices; In response to the information for instructing to exit the first state from the second device and the third device, the first device exits the first state.
6. The method according to any one of claims 2 to 5, characterized in that The first device establishing the first service with the online devices includes: The first device establishes a first transmission channel with the second device; The first device sends data of the first service to the second device by using the first transmission channel; The first device establishes a second transmission channel with the third device; The first device sends data of the first service to the third device by using the second transmission channel.
7. The method according to claim 6, characterized in that, The first device establishing the first transmission channel with the second device includes: The first device sends information for instructing to multiplex a physical link to the second device; Receiving information for indicating successful physical link multiplexing from the second device, where the information for indicating successful physical link multiplexing carries information for indicating the Internet Protocol (IP) of the second device; In response to the information for indicating successful physical link multiplexing, sending information for instructing to establish a transmission channel to the second device, where the information for instructing to establish a transmission channel carries information for indicating the IP of the first device; Receive information from the second device indicating successful establishment of a transmission channel.
8. The method according to any one of claims 1 to 7, characterized in that The master device satisfies one or more of the following conditions: The master device is set with the ability to be the master device in a group; The master device is the device with the largest Media Access Control (MAC) address among the first device and the online devices; The master device is the device with the lowest power consumption per unit time among the first device and the online devices; The master device belongs to the master device in the first group, and the first group is a group established before the first device determines the master device from the first device and the online devices; or, The master device is a plugged-in device.
9. The method according to any one of claims 1 to 8, characterized in that, The first device includes a first intelligent interconnection and a first Wireless Fidelity (WiFi) connection module; The first device determines the master device from the first device and the online devices, including: The first intelligent interconnection sends information indicating the first device and the online devices to the first WiFi connection module; The first WiFi connection module determines the master device from the first device and the online devices.
10. The method according to claim 9, wherein The master device includes a second WiFi connection module; The first device instructs the master device to establish a physical link with the remaining devices, including: The first WiFi connection module sends information indicating global networking to the second WiFi connection module. The information indicating global networking carries information indicating each device among the remaining devices. Global networking means that the master device establishes a physical link with the remaining devices.
11. The method according to claim 10, wherein The physical link between the master device and the first device is established through the first WiFi connection module and the second WiFi connection module.
12. An electronic device, characterized in that, Includes a module for executing the method according to any one of claims 1 to 11.
13. An electronic device, characterized in that, Includes: A processor coupled to a memory. The memory is used to store a computer program. When the processor calls the computer program, the electronic device executes the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, For storing a computer program, the computer program includes instructions for implementing the method according to any one of claims 1 to 11.
15. A chip system, characterized in that, Includes at least one processor and a communication interface. The communication interface and the at least one processor are interconnected by a line. The at least one processor is used to run a computer program or instructions to execute the method according to any one of claims 1 to 11.
16. A computer program product, characterized in that, The computer program product includes computer program code. When the computer program code runs on a computer, the computer implements the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
WiFi link dormancy awakening method, electronic equipment and WiFi link dormancy awakening system
CN115243398A
Method and device for establishing connection between multiple devices
CN115278611A
Wi-fi direct communication method and apparatus
WO2023035834A1