Communication method and device, computer readable storage medium and chip

By negotiating the working channels and IP addresses between terminal devices, the problem caused by improper selection of channels and IP addresses in terminal device networking is solved, thereby improving communication efficiency and quality.

CN121585645APending Publication Date: 2026-02-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512050727.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2021-09-10
Filing Date
2021-12-08
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

During the networking process of terminal devices, selecting an inappropriate working channel or IP address may lead to reduced network speed and network connection failure, affecting user experience.

Method used

By negotiating and merging the working channel and IP address through a pre-established connection, time-division switching of the channel and IP address conflicts are avoided, ensuring that the terminal devices work on the same channel and selecting the highest quality channel and conflict-free IP address.

Benefits of technology

It improves communication efficiency and quality, avoids channel and IP address related issues, and ensures stable data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121585645A_ABST
    Figure CN121585645A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and device, a computer readable storage medium and a chip. The method is used for a first terminal device in a first network. A first connection is established between the first terminal device and a second terminal device in the second network. The method includes sending a request message to a second terminal device over a first connection. The request message is used for requesting to establish the second connection with the second terminal device, and the request message comprises the first quality information of the plurality of candidate channels. The method further includes receiving a response message for the request message from the second terminal device, the response message including second quality information of the plurality of candidate channels. The method further comprises determining a channel for communication between the first terminal device and the second terminal device at least based on the response message. The working channel of the fused network is negotiated through the pre-established first connection, so that the terminal equipment in the fused network can work on the same channel, time-division switching of the channel is avoided, and the communication efficiency and the communication quality are improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202111512460.9 and the original application date is December 8, 2021. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communications, and more specifically, to communication methods, devices, computer-readable storage media, and chips. Background Technology

[0003] With the development of communication technology, the Internet of Things (IoT) has gradually become a reality. A distributed execution framework can be used to network two or more terminal devices. After the two terminal devices have completed networking, they need to select appropriate working channels and Internet Protocol (IP) addresses to deploy communication services. If the selected working channel or IP address is inappropriate, it may result in reduced network speed or network connection failure, leading to a degraded user experience. Summary of the Invention

[0004] Embodiments of this application provide communication methods, devices, computer-readable storage media, and chips.

[0005] In a first aspect, a communication method is provided. The method is used for a first terminal device in a first network, and a first connection is established between the first terminal device and a second terminal device in a second network. The method includes: sending a request message to the second terminal device through the first connection, the request message requesting the establishment of a second connection with the second terminal device, the request message including first quality information of a plurality of candidate channels; receiving a response message from the second terminal device in response to the request message, the response message including second quality information of the plurality of candidate channels; and determining a channel for communication between the first terminal device and the second terminal device, at least based on the response message. By negotiating the operating channel of the merged network through a pre-established first connection, terminal devices in the merged network can operate on the same channel, avoiding time-division switching of channels and improving communication efficiency and quality.

[0006] In some embodiments, the plurality of candidate channels includes a first channel for communication between a first terminal device and a third terminal device in a first network, and a second channel for communication between a second terminal device and a fourth terminal device in a second network. In some embodiments, the first terminal device may determine one of the first channel and the second channel as the channel. This avoids all terminal devices in the first network and the second network from performing channel switching.

[0007] In some embodiments, the first terminal device may select a third channel from a plurality of candidate channels as the channel, wherein the quality of the third channel is higher than that of the first and second channels. This can improve communication quality.

[0008] In some embodiments, the request message further includes a first Internet Protocol (IP) list information of terminal devices in a first network, and the response message further includes a second IP list information of terminal devices in a second network, and a second target IP address of the second terminal device. The method further includes: determining a first target IP address of the first terminal device, at least based on the response message, wherein the first target IP address is different from the IP addresses in the first and second IP list information and the second target IP address. Negotiating the merged IP address through a pre-established first connection can avoid IP address conflicts.

[0009] In a second aspect, a communication method is provided. This method is used for a second terminal device in a second network, wherein a first connection is established between the second terminal device and a first terminal device in a first network. The method includes: receiving a request message from the first terminal device via the first connection, the request message requesting the establishment of a second connection with the second terminal device, the request message including first quality information of a plurality of candidate channels; determining a channel for communication between the first terminal device and the second terminal device, at least based on the request message; and receiving a response message to the first terminal device in response to the request message, the response message including second quality information of the plurality of candidate channels. By negotiating the operating channel of the merged network through the pre-established first connection, terminal devices in the merged network can operate on the same channel, avoiding time-division switching of channels and improving communication efficiency and quality.

[0010] In some embodiments, the plurality of candidate channels include a first channel for communication between a first terminal device and a third terminal device in a first network, and a second channel for communication between a second terminal device and a fourth terminal device in a second network.

[0011] In some embodiments, one of the first channel and the second channel is determined as a channel for communication between the first terminal device and the second terminal device.

[0012] In some embodiments, a third channel among a plurality of candidate channels is determined as the channel for communication between a first terminal device and a second terminal device, and the quality of the third channel is higher than that of the first channel and the second channel.

[0013] In some embodiments, the request message further includes a first Internet Protocol (IP) list information of the terminal devices in the first network; and the method further includes: determining a second target IP address of the second terminal device based at least on the request message, and the response message further includes a second IP list information of the terminal devices in the second network, and a second target IP address, wherein the second target IP address is different from the IP addresses in the first and second IP list information.

[0014] In a third aspect, a communication method is provided. This method is used for a first terminal device in a first network, and a first connection is established between the first terminal device and a second terminal device in a second network. The method includes: sending a request message to the second terminal device through the first connection, the request message requesting the establishment of a second connection with the second terminal device, the request message including a first Internet Protocol (IP) list of the terminal device in the first network; receiving a response message from the second terminal device in response to the request message, the response message including a second IP list of the terminal device in the second network and a second target IP address of the second terminal device; and determining a first target IP address of the first terminal device, at least based on the response message, the first target IP address being different from the IP addresses in the first and second IP list information and the second target IP address. By negotiating and merging IP addresses through a pre-established first connection, IP address conflicts can be avoided.

[0015] In some embodiments, the request message further includes first quality information of a plurality of candidate channels, and the response message further includes second quality information of a plurality of candidate channels; and the method further includes: determining a channel for communication between the first terminal device and the second terminal device, at least based on the response message.

[0016] In some embodiments, the plurality of candidate channels include a first channel for communication between a first terminal device and a third terminal device in a first network, and a second channel for communication between a second terminal device and a fourth terminal device in a second network.

[0017] In some embodiments, the first terminal device may determine one of the first channel and the second channel as the channel.

[0018] In some embodiments, the first terminal device may determine the third channel among a plurality of candidate channels as the channel, wherein the quality of the third channel is higher than that of the first channel and the second channel.

[0019] In a fourth aspect, a communication method is provided. The method is implemented at a second terminal device in a second network, and the second terminal device establishes a first connection with a first terminal device in a first network. The method includes: receiving a request message from the first terminal device via the first connection, the request message requesting the establishment of a second connection with the second terminal device, the request message including a first Internet Protocol (IP) list of the terminal devices in the first network; determining a second target IP address of the second terminal device, at least based on the request message; and receiving a response message from the first terminal device in response to the request message, the response message including a second IP list of the terminal devices in the second network and a second target IP address, the second target IP address being different from the IP addresses in the first and second IP list information. By negotiating and merging the IP addresses through the pre-established first connection, IP address conflicts can be avoided.

[0020] In some embodiments, the request message further includes first quality information of a plurality of candidate channels, and the response message further includes second quality information of a plurality of candidate channels.

[0021] In some embodiments, the plurality of candidate channels include a first channel for communication between a first terminal device and a third terminal device in a first network, and a second channel for communication between a second terminal device and a fourth terminal device in a second network.

[0022] In a fifth aspect, a method for configuring routing is provided, applied to a first terminal device in a first network, wherein a first connection is established between the first terminal device and a second terminal device in a second network. The method includes: the first terminal device sending a request message to the second terminal device through the first connection, the request message requesting the establishment of a second connection with the second terminal device; the first terminal device receiving a response message from the second terminal device, the response message carrying the IP address of the second terminal device and a first IP list information of terminal devices in the second network; and the first terminal device configuring a first target IP address for itself based on the response message, the first target IP address being different from the IP addresses in the first IP list information and the IP address of the second terminal device.

[0023] In the embodiments of this application, during the fusion process of terminal devices located in two different networks, that is, during the establishment of a second connection, the terminal devices located in two different networks can negotiate the parameters for establishing the second connection through the already established first connection. Based on the IP list information of both fusion devices, a conflict-free IP address (e.g., a conflict-free IP network segment) is selected for configuration. This negotiation method helps to avoid IP address conflicts, thereby avoiding the interruption of communication services.

[0024] In some embodiments, the first terminal device supports communication with terminal devices in the second network through multiple IP addresses, and the method further includes: receiving a first message from the second terminal device, wherein the destination IP address in the first message is one of the multiple IP addresses.

[0025] In some embodiments, the actual physical interface of the first terminal device can correspond to multiple IP addresses, or the actual physical interface can be logically divided into multiple virtual sub-interfaces, each logical sub-interface corresponding to one IP address. Multiple IP addresses can participate in the message sending and receiving process. As long as the message receiver matches one of the multiple IP addresses of the message sender, it can receive the message normally, which helps to improve the stability of data transmission.

[0026] In some embodiments, the first terminal device sends the IP address of the second terminal device to the Address Resolution Protocol (ARP) entry. After the first terminal device and the second terminal device negotiate a conflict-free IP address, the first terminal device can send the negotiated IP address to the ARP entry, which facilitates the rapid acquisition of the physical address corresponding to the negotiated IP address.

[0027] In some embodiments, the first terminal device determines the IP address of the second terminal device based on the response message. The first terminal device determines the target MAC address of the second terminal device through the mapping relationship between the second terminal device's IP address and MAC address in the ARP table. The first terminal device sends a second message to the second terminal device, the destination IP address of which is the second terminal device's IP address, and the destination MAC address of which is the second terminal device's target MAC address. Since the first and second terminal devices can send the negotiated IP address to the ARP table, and the ARP table maps the negotiated IP address to the corresponding physical address, the learning process of dynamic ARP entries can be eliminated, which helps to save signaling overhead and speed up message transmission.

[0028] In some embodiments, the second connection is a Huawei magneto link (HML) connection.

[0029] In some embodiments, the request message includes HML information of the terminal device in the first network, which is used to establish the HML connection. The first terminal device can exchange HML information through the request message, which is beneficial for establishing the HML connection.

[0030] In some embodiments, the first connection is a Bluetooth Low Energy (BLE) connection, an asynchronous connectionless link (ACL) connection, or a Wi-Fi connection.

[0031] In some embodiments, the first target IP address is in a different communication network segment than the IP address in the first IP list information.

[0032] In a sixth aspect, a method for configuring routing is provided, applied to a second terminal device in a second network, the second terminal device having established a first connection with a first terminal device in a first network. The method includes: receiving a request message from the first terminal device through the first connection, the request message requesting the establishment of a second connection with the second terminal device, the request message carrying a second IP list information of terminal devices in the first network; configuring a second target IP address for the second terminal device based on the request message, the second target IP address being different from the IP addresses in the second IP list information and the IP address of the first terminal device; and sending a response message to the first terminal device, the response message carrying the second target IP address and the first IP list information of terminal devices in the second network.

[0033] In some embodiments, the first terminal device supports communication with terminal devices in the second network through multiple IP addresses, and the method further includes: sending a first message to the first terminal device, wherein the destination IP address in the first message is one of the multiple IP addresses.

[0034] In some embodiments, the second target IP address is sent to the ARP entry.

[0035] In some embodiments, a second message is received from the first terminal device, wherein the destination IP address in the second message is the second target IP address, and the destination MAC address in the second message is determined by the mapping relationship between the second target IP address and the MAC address in the ARP table entry.

[0036] In some embodiments, the second connection is an HML connection.

[0037] In some embodiments, the request message includes HML information of the terminal device in the first network, the HML information being used to establish the HML connection.

[0038] In some embodiments, the first connection is a BLE connection, an ACL connection, or a Wi-Fi connection.

[0039] In some embodiments, the second target IP address is in a different communication network segment than the IP address in the second IP list information.

[0040] In a seventh aspect, a channel selection method is provided. The method includes: a first terminal device establishing a communication service with a second terminal device through a first channel; the first terminal device acquiring quality information of the first channel; and if the first terminal device determines that the quality of the first channel indicated by the quality information is below a threshold, then switching the communication service from the first channel to the second channel. In this manner, during the operation of a communication service, the working channel can be reselected and switched based on the quality information of the working channel, thereby improving the quality of communication services.

[0041] In some embodiments, channel quality information may include information related to at least one of the channel's Quality of Service (QoS) and channel quality. Information related to the channel's QoS can be used to determine when to switch channels. For example, information related to the channel's QoS may include, but is not limited to, packet loss rate, retransmission count, transmit / receive rate, and round-trip time. Information related to channel quality can be used to select the channel to be switched. For example, information related to channel quality may include, but is not limited to, channel load, signal-to-noise ratio (SNR), signal number (SignalNum), signal strength (SignalRSSI), round-trip time (RTT), bandwidth (BW), jitter, and noise.

[0042] In some embodiments, the first terminal device can acquire quality information of multiple candidate channels, including a second channel. Then, the first terminal device can switch communication services from the first channel to the second channel, at least based on the quality information of the multiple candidate channels. For example, the first terminal device can measure the quality of the multiple candidate channels itself to obtain their quality information. Alternatively, the first terminal device can also receive quality information of the multiple candidate channels measured by other terminal devices. In this way, even if the first terminal device is unable to measure the quality of the candidate channels due to ongoing service deployment, it can still perform channel switching based on the quality information of the multiple candidate channels received from other terminal devices.

[0043] In some embodiments, the first terminal device can receive quality information of a first subset of multiple candidate channels from the second terminal device. The first terminal device can determine the quality information of a second subset of the multiple candidate channels. Then, based on the quality information of the first subset and the second subset, the first terminal device can select a second channel from the intersection of the first and second subsets. In this way, the first terminal device and the second terminal device can select the channel to be switched through negotiation.

[0044] In some embodiments, the first terminal device can determine first quality information of multiple candidate channels and receive second quality information of multiple candidate channels from the third terminal device. Furthermore, the first terminal device can update the first quality information based on the second quality information, thereby using the updated first quality information as the quality information. In this way, when the first terminal device has weak measurement capabilities or can only measure some channel parameters, all channel parameters can be obtained by receiving channel quality information from other terminal devices.

[0045] In some embodiments, when the fourth terminal device first joins the communication network of the first terminal device, it may not have channel quality information. In this case, the first terminal device can send channel quality information to the fourth terminal device to facilitate the rapid establishment of communication services between the fourth terminal device and other terminal devices.

[0046] In some embodiments, the channel quality threshold can be associated with the type of communication service. Therefore, different thresholds can be determined based on different communication service types, thereby determining different channel switching timings.

[0047] In some embodiments, if the channel quality is below a threshold, the first terminal device can reduce the quality of the communication service. After a predetermined period of time, the first terminal device can reacquire the quality information of the first channel. If the quality of the first channel indicated by the reacquired quality information is still below the threshold, the first terminal device can switch the communication service from the first channel to the second channel. This avoids frequent channel switching.

[0048] In an eighth aspect, a communication device is provided. The communication device includes one or more processors and a memory. The memory stores one or more computer programs. The one or more computer programs include instructions. When the instructions are executed by the communication device, the communication device performs the method according to any of the preceding aspects.

[0049] In a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a communication device, they cause the communication device to perform the method according to any of the preceding aspects.

[0050] In a tenth aspect, a chip is provided. The chip includes processing circuitry. The processing circuitry is configured to perform the method according to any of the preceding aspects. Attached Figure Description

[0051] The features, advantages, and other aspects of various implementations of this application will become more apparent from the accompanying drawings and the following detailed description. Several implementations of this application are illustrated herein by way of example and not limitation, in the accompanying drawings: Figure 1 A schematic block diagram of a communication network in which embodiments of this application may be implemented is shown; Figure 2 A schematic diagram of the interface of a terminal device according to some embodiments of this application is shown; Figure 3 The diagram illustrates the signaling interaction of a channel selection process according to some embodiments of this application; Figure 4 Signaling interaction diagrams of channel selection procedures according to other embodiments of this application are shown; Figure 5 A signaling interaction diagram of a channel selection process according to further embodiments of this application is shown; Figure 6 A schematic diagram of a multi-device network according to an embodiment of this application is shown; Figure 7 A schematic diagram of channel switching according to an embodiment of this application is shown; Figure 8 The diagram illustrates the signaling interaction of a channel selection process according to some embodiments of this application; Figure 9 A signaling interaction diagram illustrating the process of determining the active end device in a converged network according to some embodiments of this application is shown. Figure 10 A signaling interaction diagram illustrating the process of configuring an IP address according to some embodiments of this application is shown; Figure 11 A schematic diagram illustrating a multi-IP address configuration according to some embodiments of this application is shown; Figure 12 A schematic diagram of a communication network according to an embodiment of this application is shown; Figure 13 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown; and Figure 14 A schematic diagram of the software architecture of an electronic device with a layered architecture of Android system according to an embodiment of this application is shown.

[0052] In the various figures, the same or similar reference numerals represent the same or similar elements. Detailed Implementation

[0053] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.

[0054] In the description of embodiments of this application, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below. Example network architecture Figure 1 A schematic block diagram of an example communication network 100 in which embodiments of the present application may be implemented is shown. As shown, the communication network 100 may include terminal devices 110, 120, and 130, and a router 140.

[0056] Understandable, Figure 1 In the examples, terminal devices 110, 120, and 130 are shown as a personal computer, a mobile phone (also referred to as a cell phone), and a tablet computer, respectively. However, in other examples, each of terminal devices 110, 120, and 130 can be other electronic devices. Examples of other electronic devices may include, but are not limited to, televisions (also referred to as smart screens or large-screen devices), ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), in-vehicle devices (also referred to as vehicle infotainment systems), wearable electronic devices, virtual reality devices, etc. The embodiments of this application do not impose any limitations on this.

[0057] also, Figure 1 The number of terminal devices and routers shown is merely illustrative; the communication network 100 may include more or fewer terminal devices and routers, and the embodiments of this application do not impose any limitations on this.

[0058] Terminal devices 110, 120, and 130, along with router 140, can form a network using wired, wireless, or a combination of both methods. Networking refers to terminal devices 110, 120, and 130 discovering devices based on heartbeat messages; an actual connection is not necessarily established. Wireless methods can include, but are not limited to, Bluetooth (BT), Wireless Fidelity (Wi-Fi), Near Field Communication (NFC), Frequency Modulation (FM), Zigbee, and infrared (IR) technologies. Bluetooth can be either traditional Bluetooth or Bluetooth Low Energy (BLE).

[0059] Terminal devices 110, 120, and 130, as well as router 140, periodically send heartbeat messages to indicate their online status. Any one of these devices can discover other devices based on heartbeat messages received from them. Furthermore, terminal devices 110, 120, 130, and router 140 can perform trusted authentication with each other using the same username, QR code scanning, or PIN code input. After successful authentication, terminal devices 110, 120, 130, and router 140 can form a network. However, there may not be an actual physical connection between the networked terminal devices 110, 120, and 130.

[0060] In some embodiments, terminal devices 110, 120, and 130 can form a local area network via router 140. In such embodiments, router 140 can be configured as an access point (AP), and terminal devices 110, 120, and 130 can access router 140 as stations (STAs).

[0061] In the embodiment where terminal devices 110, 120, and 130 form a local area network (LAN) via router 140, router 140 may not participate in the network formation and therefore does not need to send or receive heartbeat messages; router 140 only needs to forward heartbeat messages. Alternatively, router 140 may also participate in the network formation, in which case router 140 will send and receive heartbeat messages.

[0062] In other embodiments, terminal devices 110, 120, and 130 may network without going through router 140.

[0063] Figure 2 It shows Figure 1This diagram illustrates the interface 200 of one of the terminal devices (e.g., terminal device 120) after the various terminal devices in the network have been networked. As an example, interface 200 can be the main interface, background interface, or negative one screen of the terminal device. From interface 200, it can be seen that the icons 110-1 of terminal device 110 and 130-1 of terminal device 130 are floating around the icon 120-1 of terminal device 120, indicating that terminal devices 110, 120, and 130 have completed their network formation.

[0064] After terminal devices 110, 120, and 130 complete the network formation, in response to the initiation of a communication service, any two of the terminal devices 110, 120, and 130 can establish a connection. This connection can be a wired connection or a wireless connection. Examples of this communication service may include, but are not limited to: distributed multi-screen collaboration, file transfer, distributed file system, distributed data management, etc.

[0065] In some embodiments, any two of the terminal devices 110, 120 and 130 can be connected via router 140.

[0066] In other embodiments, any two of terminal devices 110, 120, and 130 can connect directly via a peer-to-peer (P2P) connection. P2P connections allow terminal devices to communicate one-to-one or one-to-many without the need for a local area network or access point (AP). In the following text, devices supporting P2P technology are also referred to as P2P devices.

[0067] The P2P architecture defines three components, which can be referred to as one device and two roles. The device refers to the P2P device itself, which is the entity of the roles in the P2P architecture and can be considered as a Wi-Fi device. The two roles are the Group Owner (GO) and the Group Client (GC). The GO's role is similar to the Access Point (AP) in the Infrastructure Basic Service Set (IBS), allowing multiple GCs to connect. The GC's role is similar to the STA in the IBS, and it can only connect to one GO, not multiple GOs.

[0068] During the establishment of a P2P connection, the two terminal devices can negotiate P2P-related parameters. For example, the two terminal devices can negotiate which terminal device will act as the GO, the P2P connection key, etc.

[0069] In some other embodiments, any two of the terminal devices 110, 120, and 130 can also be directly connected via a sharing mechanism. In such an example, one of the two terminal devices is virtualized as an AP (also known as a SoftAP) to enable the connection.

[0070] In the following description, the example of terminal devices 110 and 120 establishing a P2P connection to run a screen mirroring service (i.e., projecting the content displayed on the screen of terminal device 110 onto terminal device 120) will be used. However, it should be understood that, depending on the type of service initiated, connections other than P2P connections can be established between terminal devices 110 and 120. The embodiments of this application do not impose any limitations on this. The embodiments of this application can be applied to scenarios with other channel selections, and are not limited to scenarios where terminal devices connect via P2P, SoftAP, or AP-Station.

[0071] In the example of running the screen mirroring service, terminal device 110 can act as GO and terminal device 120 can act as GC.

[0072] After terminal devices 110 and 120 establish a connection, one of them will select an appropriate candidate channel from a plurality of candidate channels as the working channel between them to establish a communication service. In the following text, the working channel selected when establishing the communication service is also referred to as channel CH1.

[0073] In the embodiment where terminal devices 110 and 120 establish a P2P connection, the working channel can be selected by the terminal device acting as the GO in terminal devices 110 and 120. Alternatively, the working channel can also be selected by the terminal device acting as the GC in terminal devices 110 and 120, and the embodiments of this application do not impose any limitations on this.

[0074] To select a working channel, after terminal devices 110 and 120 have completed networking and before establishing a connection for carrying service data, the terminal device acting as the GO can measure the channel quality of multiple candidate channels to obtain a first measurement result of the channel. The terminal device acting as the GO can determine the evaluation score of the multiple candidate channels based at least on the first measurement result. Each evaluation score indicates the channel quality of the corresponding candidate channel. Similarly, after networking and before establishing a connection for carrying service data, the terminal device acting as the GC can also measure the channel quality of multiple candidate channels to obtain a second measurement result of the channel. The terminal device acting as the GC can determine the evaluation score of the multiple candidate channels based at least on the second measurement result. Details regarding the determination of the evaluation scores of multiple candidate channels will be described in detail in the "Channel Measurement, Measurement Result Synchronization, and Channel Scoring Matrix Construction" section below.

[0075] Furthermore, in some embodiments, the terminal device acting as GO in terminal devices 110 and 120 can select one candidate channel as the working channel from multiple candidate channels based on the evaluation scores of multiple candidate channels determined by itself.

[0076] In other embodiments, terminal devices 110 and 120 may determine the operating channel through negotiation. Reference will be made below. Figure 3 To describe such an embodiment.

[0077] Selection of working channel Figure 3 A signaling interaction diagram of a channel selection process 300 according to some embodiments of this application is shown. For purposes of discussion, reference will be made to... Figure 1 The various elements shown describe the channel selection process 300. However, it should be understood that the channel selection process 300 can also be executed in any other communication scenario. Furthermore, in process 300, terminal device 110 acts as GO and terminal device 120 acts as GC, with the working channel selected by terminal device 110 acting as GO.

[0078] like Figure 3 As shown, the terminal device 120 can select (310) a subset (also called subset A) of multiple candidate channels based on the evaluation scores of multiple candidate channels determined by itself.

[0079] In some embodiments, the plurality of candidate channels may be a set of channels supported by terminal devices 110 and 120. In some embodiments, subset A may include candidate channels supported by terminal device 120.

[0080] Furthermore, terminal device 120 can send (320) information of a subset A of multiple candidate channels to terminal device 110. Correspondingly, terminal device 110 can receive (330) information of a subset A of multiple candidate channels from terminal device 120.

[0081] In some embodiments, terminal device 120 may send information about a subset A of multiple candidate channels to terminal device 110 in the form of a channel list (also referred to as channel list A). The candidate channels in channel list A may be arranged in order of evaluation scores. For example, the candidate channels in channel list A may be arranged in order of evaluation scores from high to low or from low to high.

[0082] In some embodiments, terminal device 120 may operate in multiple frequency bands. In such embodiments, terminal device 120 may determine a channel sub-table for each of the multiple frequency bands, and channel list A includes information about the channels in the multiple channel sub-tables. For example, in an example where terminal device 120 may operate at 2.4 GHz and 5 GHz, terminal device 120 may determine channel sub-tables A1 and A2 for the 2.4 GHz and 5 GHz frequency bands respectively, and channel list A may include information about candidate channels in channel sub-tables A1 and A2. The candidate channels in channel sub-tables A1 and A2 may be arranged in descending or ascending order of evaluation scores. For example, subset A1 may include candidate channels associated with the 2.4 GHz frequency band with indices 1, 2, and 3 (also referred to as candidate channels 1, 2, and 3), and subset A2 may include candidate channels associated with the 5 GHz frequency band with indices 36, 38, and 40 (also referred to as candidate channels 36, 38, and 40).

[0083] Terminal device 110 may select (340) a subset (also referred to as subset B) of multiple candidate channels based on the evaluation scores of multiple candidate channels determined by itself. In some embodiments, subset B may include candidate channels supported by terminal device 110.

[0084] In some embodiments, terminal device 110 may arrange the channels of subset B in order of evaluation scores to generate a channel list (also referred to as channel list B). Similarly, candidate channels in channel list B may also be arranged in order of evaluation scores from high to low or from low to high.

[0085] In some embodiments, terminal device 110 may also operate in multiple frequency bands. In such embodiments, terminal device 110 may generate a channel sub-table for each of the multiple frequency bands, and channel list B includes information about the channels in the multiple channel sub-tables. For example, in an example where terminal device 110 can operate in the 2.4 GHz and 5 GHz frequency bands, terminal device 110 may determine channel sub-tables B1 and B2 for the 2.4 GHz and 5 GHz frequency bands respectively, and channel list B may include information about candidate channels in channel sub-tables B1 and B2. The candidate channels in channel sub-tables B1 and B2 may be arranged in descending or ascending order of evaluation scores. For example, subset B1 may include candidate channels associated with the 2.4 GHz frequency band with indices 2, 3, and 4 (also referred to as candidate channels 2, 3, and 4), and subset B2 may include candidate channels associated with the 5 GHz frequency band with indices 38, 40, and 42 (also referred to as candidate channels 38, 40, and 42).

[0086] Furthermore, the terminal device 110 can select (350) a candidate channel from the intersection of subset A and subset B as the working channel.

[0087] For example, in an example where subset A includes channel sub-tables A1 and A2 and subset B includes channel sub-tables B1 and B2, if terminal device 110 wants to switch to a channel in the 2.4 GHz band, terminal device 110 can select a candidate channel as the working channel from the intersection of channel sub-tables A1 and B1, that is, select a candidate channel from candidate channels 2 and 3. As another example, if terminal device 110 wants to switch to a channel in the 5 GHz band, terminal device 110 can select a candidate channel as the working channel from the intersection of channel sub-tables A2 and B2, that is, select a candidate channel from candidate channels 38 and 40.

[0088] Understandable, although Figure 3 The diagram shows that action 340 is executed after action 330; however, this is merely an example. In other examples, action 340 may be executed between action 310 and action 330, or before action 310, or action 340 may be executed in parallel with action 310.

[0089] Furthermore, it is understandable. Figure 3 The process of selecting a working channel by terminal device 110 acting as GO is illustrated. However, in other embodiments, terminal device 120 acting as GC may also perform a similar process to process 300 to select a working channel. In such an embodiment, terminal device 120 acting as GC may receive information from terminal device 110 about a subset of candidate channels with better channel quality determined by terminal device 110, select another subset of candidate channels with better channel quality based on the evaluation scores of the candidate channels it has determined, and then select a candidate channel as the working channel from the intersection of these two subsets.

[0090] According to the embodiments of this application, a channel with better channel quality is selected when initiating a communication service, thereby improving the quality of communication services.

[0091] After selecting a working channel, both terminal devices 110 and 120 can create a working channel between themselves to run communication services. For example, in a screen mirroring service example, terminal device 120 can send a video stream to terminal device 110, thereby projecting the video stream onto the display screen of terminal device 110.

[0092] Switching of working channels During the operation of communication services, the channels selected when deploying communication services may be subject to interference. Specifically, Wi-Fi devices can operate in the 2.4GHz and 5GHz bands. The 2.4GHz band is a shared band for IST (Internet Protocol System), and multiple devices sharing this band will interfere with each other. The 5GHz band has higher data transmission efficiency than the 2.4GHz band. However, while the 5GHz frequency is high, its penetration is poor, especially in home applications, where its wall-penetrating ability is even worse than that of 2.4GHz. Furthermore, because Wi-Fi's bandwidth mechanism achieves frequency domain reuse of 40MHz, 80MHz, 120MHz, and 160MHz through 20MHz superposition, channel overlap is easily generated. Mutual interference from multiple devices and channel overlap can lead to fluctuating communication rates, severe network retransmissions, and a low quality of communication service for the user experience.

[0093] To improve the quality of communication services, it is necessary to switch the working channel during the operation of communication services. To perform this switching, during the operation of communication services, terminal equipment 110 or 120 can measure the quality of service of the working channel. Measuring the quality of service of the working channel may include measuring at least one of the following: packet loss rate, retransmission count, transmit / receive rate, and round-trip time.

[0094] If the measured quality of service is below the threshold, one of the terminal devices 110 and 120 can switch the working channel from channel CH1 to channel CH2.

[0095] In some embodiments, terminal device 110 or 120 may select channel CH2 from multiple candidate channels based on the evaluation scores of multiple candidate channels.

[0096] In other embodiments, terminal devices 110 and 120 may determine channel CH2 through negotiation. Reference will be made below. Figure 4 To describe such an embodiment.

[0097] Figure 4 A signaling interaction diagram of a channel selection process 400 according to some embodiments of this application is shown. For purposes of discussion, reference will be made to... Figure 1 The various elements shown describe the channel selection process 400. However, it should be understood that the channel selection process 400 can also be executed in any other communication scenario. Furthermore, in process 400, terminal device 110 acts as GO and terminal device 120 acts as GC, with terminal device 110 acting as GO selecting the second working channel to switch to.

[0098] like Figure 4As shown, terminal device 120 measures the quality of service (QoS) of the current working channel (i.e., channel CH1) (410). If the QoS of channel CH1 is lower than a threshold, terminal device 120 selects (420) a subset (also called subset C) of the multiple candidate channels based on the evaluation scores of the multiple candidate channels it has determined.

[0099] In some embodiments, this threshold is associated with the type of communication service. In other words, different communication services may have different tolerances for the quality of service of the channel. Therefore, the appropriate threshold can be determined based on the type of communication service.

[0100] In some embodiments, subset C may include candidate channels supported by terminal device 120.

[0101] Furthermore, terminal device 120 can send (430) information of a subset C of multiple candidate channels to terminal device 110. Correspondingly, terminal device 110 can receive (440) information of a subset C of multiple candidate channels from terminal device 120.

[0102] Similar to subset A, terminal device 120 can send information about a subset C of multiple candidate channels to terminal device 110 in the form of a channel list (also referred to as channel list C). The candidate channels in channel list C can be arranged in descending or ascending order of evaluation scores.

[0103] Furthermore, similar to subset A, in embodiments where terminal device 120 can operate in multiple frequency bands, terminal device 120 can determine a channel sub-table for each of the multiple frequency bands, and channel list C includes information about the channels in the multiple channel sub-tables.

[0104] Terminal device 110 may select (450) a subset (also referred to as subset D) of multiple candidate channels based on the evaluation scores of multiple candidate channels determined by itself. In some embodiments, subset D may include candidate channels supported by terminal device 110.

[0105] Similar to subset B, terminal device 110 can arrange the channels of subset D in order of evaluation scores to generate a channel list (also called channel list D). Similarly, candidate channels in channel list D can also be arranged in order of evaluation scores from high to low or from low to high.

[0106] In embodiments where the terminal device 110 can operate in multiple frequency bands, the terminal device 110 can generate a channel sub-table for each of the multiple frequency bands, and the channel list D includes information about the channels in the multiple channel sub-tables.

[0107] Furthermore, terminal device 110 can select (460) a candidate channel as channel CH2 from the intersection of subset C and subset D.

[0108] For example, in an example where subset C includes a channel sub-table C1 associated with the 2.4 GHz band and a channel sub-table C2 associated with the 5 GHz band, and subset D includes a channel sub-table D1 associated with the 2.4 GHz band and a channel sub-table D2 associated with the 5 GHz band, if terminal device 110 wants to switch to a channel in the 2.4 GHz band, terminal device 110 can select a candidate channel as the working channel from the intersection of channel sub-tables C1 and D1. As another example, if terminal device 110 wants to switch to a channel in the 5 GHz band, terminal device 110 can select a candidate channel as the working channel from the intersection of channel sub-tables C2 and D2.

[0109] In some embodiments, optionally, after selecting the channel CH2 to which it wants to switch, terminal device 110 may send a handover notification to terminal device 120. This handover notification may indicate information about channel CH2. Furthermore, optionally, the handover notification may also indicate the channel handover time. Then, terminal devices 110 and 120 may switch the operating channel to channel CH2 at the notified handover time.

[0110] Understandable, although Figure 4 The diagram shows that action 450 is executed after action 440; however, this is merely an example. In other examples, action 450 may be executed between action 410 and action 440, or before action 410, or action 450 may be executed in parallel with action 410.

[0111] Furthermore, it is understandable. Figure 4 The process of selecting the channel to switch to is illustrated by terminal device 110 acting as GO. However, in other embodiments, terminal device 120 acting as GC may also perform a similar process to process 400 to select the channel to switch to.

[0112] According to embodiments of this application, if the service quality of a channel is detected to be lower than a threshold during communication services, the working channel can be reselected and switched based on the channel measurement results, thereby further improving the quality of communication services.

[0113] In some embodiments, if the measured quality of service is below a threshold, the terminal device 120 may reduce the quality of the communication service before switching the working channel from channel CH1 to channel CH2. For example, the terminal device 120 may reduce the bit rate, resolution, compressed image quality, etc., thereby reducing bandwidth utilization.

[0114] Furthermore, the terminal device 120 can remeasure the service quality of channel CH1 after a predetermined time period. For example, the terminal device 120 can start a timer. If the timer expires and the remeasured service quality is still below a threshold, the terminal device 120 can switch the communication service from channel CH1 to channel CH2. On the other hand, if the timer expires and the remeasured service quality is above the threshold, the terminal device 120 can keep the communication service on channel CH1. Thus, communication services can be avoided due to channel switching.

[0115] The following text will describe the details regarding channel measurement, synchronization, and the construction of the channel scoring matrix. Channel measurement, measurement result synchronization, and channel scoring matrix construction 1. Channel Measurement As previously described, terminal devices 110 and 120 can measure the channel quality of multiple candidate channels in an idle state to obtain a first measurement result and a second measurement result of the channel, respectively. It should be noted that terminal devices 110 and 120 can measure the channel quality of candidate channels both before and during communication services, and the scope of this application is not limited in this respect. Furthermore, terminal device 130 in the communication network 100 can also measure the channel quality of multiple candidate channels in an idle state to obtain a third measurement result of the channel.

[0117] In some embodiments, any one of terminal devices 110, 120, and 130 can periodically measure the channel quality of multiple candidate channels in an idle state. In such an embodiment, if any one of terminal devices 110, 120, and 130 detects that a measurement period has ended, the terminal device can determine whether it is capable of performing the measurement. For example, if terminal device 110 does not have measurement capabilities or is deploying a service, it can determine that it is unable to perform the measurement.

[0118] If any of terminal devices 110, 120, and 130 can measure, the terminal device can further determine whether it is in an idle state. In some embodiments, if the terminal device is not currently connected to any AP or has not established any P2P or other services, the terminal device is in an idle state. In other embodiments, if the terminal device has Wi-Fi enabled but there is no Wi-Fi connection with other devices, or although there is a Wi-Fi connection with other devices, the current traffic is less than a predetermined threshold, the terminal device is in an idle state.

[0119] It is understood that the above is merely an example of determining whether a terminal device is in an idle state, and the scope of this application is not limited in this respect.

[0120] Alternatively, during communication, the two terminal devices can negotiate to switch together from the working channel to a candidate channel for measurement at a certain period, and then switch back to the working channel after the measurement is completed. This can prevent packet loss due to the two terminal devices not being on the same channel or inconsistent transmission and reception.

[0121] In some embodiments, terminal devices not participating in the network can also measure the channel quality of multiple candidate channels. In such embodiments, a longer measurement period can be set. Furthermore, terminal devices not participating in the network may retain only one measurement result when stationary. After a terminal device participates in the network, the measurement period can be shortened. Optionally, a measurement is triggered when the terminal device senses a switch from a mobile state to a stationary state.

[0122] Furthermore, the embodiments of this application can also be used in other scenarios. For example, two terminal devices can form a network at one time to temporarily share files.

[0123] In some embodiments, the terminal device may measure the evaluation parameters of the channel as shown in Table 1 below.

[0124] Table 1

[0125] It is understood that Table 1 is merely illustrative, and the terminal device may measure more or fewer evaluation parameters; the scope of this application is not limited in this respect.

[0126] In some embodiments, the terminal device may determine whether it is in an idle state after measuring each candidate channel. If it determines that it is in an idle state, the terminal device may further measure other candidate channels.

[0127] 2. Measurement results are synchronized. In some embodiments, when terminal device 130 first joins the communication network composed of terminal devices 110 and 120, terminal device 110 or 120 can synchronize its own channel measurement results (first measurement result or second measurement result) to terminal device 130. It should be understood that "joining" here means that terminal device 130 joins the communication network composed of terminal devices 110 and 120 but does not initiate any communication services; terminal device 130 only discovers terminal devices 110 and 120 through a discovery mechanism. In this way, if terminal device 130 immediately initiates communication with other terminal devices (…) after accessing the network… Figure 1 If a communication service (not shown) is used, terminal device 130 can select an appropriate channel to establish the communication service based on channel measurement results obtained from terminal devices 110 or 120. This improves communication efficiency. The following will refer to... Figure 5 To describe such an embodiment.

[0128] Figure 5 A signaling interaction diagram of a channel measurement result synchronization process 500 according to some embodiments of this application is shown. For illustrative purposes, reference will be made to... Figure 1 The various elements shown are used to describe process 500. However, it should be understood that process 500 can also be executed in any other communication scenario. In process 500, terminal device 130 first accesses the communication network composed of terminal devices 110 and 120, and terminal device 110 synchronizes its own channel measurement results (first measurement results) to terminal device 130. However, it should be understood that a process similar to process 500 can be performed between terminal device 120 and terminal device 130 to achieve synchronization of channel measurement results.

[0129] like Figure 5 As shown, after terminal device 130 first accesses the communication network composed of terminal devices 110 and 120, it sends a measurement result synchronization request (510) to terminal device 110. After receiving the measurement result synchronization request (520), terminal device 110 can synchronize (530) the first measurement result of the channel to terminal device 130. Accordingly, terminal device 130 receives (540) the first measurement result of the channel from terminal device 110.

[0130] In some embodiments, the terminal device 110 can synchronize channel measurement results via a local area network. Alternatively, the terminal device 110 can synchronize channel measurement results via BLE broadcast or Bluetooth BLE connection.

[0131] In some embodiments, the terminal device 130 may optionally determine the evaluation scores of multiple candidate channels based on the first measurement result.

[0132] In some embodiments, optionally, after the terminal device 130 accesses the communication network composed of the terminal device 110 and the terminal device 120, the terminal device 130 itself may also measure the channel quality of multiple candidate channels (550) to obtain a third measurement result of the channel.

[0133] In some embodiments, the terminal device 130 may optionally use its own channel measurement results (i.e., third measurement results) to update the evaluation scores of multiple candidate channels.

[0134] In some embodiments, certain terminal devices in the communication network 100 may be inconvenient to measure due to the current deployment of services. For example, as described above, terminal devices 110 and 120 are deploying screen projection services, making it inconvenient to measure channel quality. In such embodiments, terminal devices in the communication network 100 that are convenient to measure can synchronize their measurement results to terminal devices that are inconvenient to measure. For example, in process 500, optionally, terminal device 130 can synchronize its own channel measurement results (i.e., the third measurement result) to (560) terminal device 110. For example, terminal device 130 can synchronize the channel measurement results via a local area network. Alternatively, terminal device 130 can synchronize the channel measurement results via BLE broadcast or Bluetooth BLE connection.

[0135] Accordingly, terminal device 110 receives (570) a third measurement result from terminal device 130. Optionally, after receiving (570) the third measurement result, terminal device 110 may use the third measurement result to update (580) the local evaluation scores of multiple candidate channels.

[0136] In other embodiments, some terminal devices in the communication network 100 may lack measurement capabilities, have weak measurement capabilities, or be able to measure only some evaluation parameters. For example, the terminal devices in the communication network 100 may include rich devices and lightweight devices. Rich devices typically have measurement capabilities and abundant hardware resources, thus having idle resources for channel measurement. For example, rich devices may have abundant computing resources for scheduling. Alternatively, rich devices may have additional radio frequency resources, such as supporting dual radio frequencies like 2.4 GHz and 5 GHz or tri-radio frequencies like 2.4 GHz, 5 GHz, and 6 GHz. Alternatively, rich devices may have additional device resources, such as a separate antenna or separate additional wireless chip resources, thus having idle resources for channel measurement. Lightweight devices, on the other hand, may lack measurement capabilities or abundant CPU resources, thus making channel measurement severely impact service; or they may be able to measure only some evaluation parameters. In such embodiments, terminal devices with measurement capabilities or capable of measuring all evaluation parameters can synchronize their measurement results to terminal devices lacking measurement capabilities, having weak measurement capabilities, or being able to measure only some evaluation parameters.

[0137] Therefore, each terminal device in the communication network 100 can obtain or update the channel measurement results, thereby determining or updating the channel evaluation score. Furthermore, each terminal device can select an appropriate operating channel based on the channel evaluation score when initiating a communication service.

[0138] In some embodiments, certain terminal devices in the communication network 100 may be non-electrical devices, which consume significant power if they frequently synchronize channel measurement results. To reduce the need for synchronization of channel measurement results, multiple thresholds can be defined for each measured parameter, each threshold associated with a corresponding level. For example, consider the signal strength shown in Table 1. A first threshold, a second threshold, a third threshold, and a fourth threshold can be defined for the signal strength, arranged in descending order. The first, second, third, and fourth thresholds are associated with strong, medium, weak, and unacceptable levels, respectively. If the measured signal strength fluctuates within the four threshold ranges, synchronization can be delayed. If the measured signal strength fluctuates across thresholds, synchronization is initiated. For example, if the measured signal strength is below the fourth threshold, indicating an unacceptable level, synchronization can be initiated.

[0139] To further reduce the synchronization of channel measurement results, terminal devices in the communication network 100 can dynamically exchange their measurement capability information at any time during the initial networking phase. If all terminal devices support measurement, synchronization is unnecessary. If a terminal device is unable to perform measurement due to the busy distributed service phase, which may affect service, then only that terminal device can notify one or more nearby devices to synchronize their channel measurement results to itself.

[0140] In addition, in some embodiments, the measurement cycle of the terminal device (e.g., a constant power device) can be shortened in order to improve the accuracy of the measurement results.

[0141] 3. Validity determination of synchronous measurement results In some embodiments, if the measurement can be performed locally on the terminal device, its own measurement result is used preferentially. If there is no measurement result locally on the terminal device, and only one measurement result exists, that measurement result is used. If the terminal device has measurement results synchronized by multiple neighbors, the measurement result synchronized by the nearest neighbor is used preferentially. If the terminal device has measurement results synchronized by multiple nearby neighbors, the measurement result that is most recent is used preferentially.

[0142] 4. Data decay In some embodiments, terminal device 110 can determine the distance and angle between itself and terminal device 130 based on a heartbeat message received from terminal device 130. Therefore, after receiving a third measurement result from terminal device 130, terminal device 110 can reduce (also referred to as attenuation) the received third measurement result based on at least one of the distance and angle between them. As an example, terminal device 110 can reduce the received third measurement result by a predetermined value based on at least one of the distance and angle between them.

[0143] For example, taking signal strength as an example, terminal device 110 can attenuate the signal strength in the third measurement result based on the following Table 2.

[0144] Table 2

[0145] As shown in Table 2, if the distance between terminal device 110 and terminal device 130 is less than 5 meters, terminal device 110 may not attenuate the signal strength in the third measurement result. If the distance between terminal device 110 and terminal device 130 is 5 meters, terminal device 110 may attenuate the signal strength in the third measurement result by 2 dB. If the distance between terminal device 110 and terminal device 130 is 10 meters, terminal device 110 may attenuate the signal strength in the third measurement result by 4 dB. And so on.

[0146] It is understood that the above is merely an example of a terminal device attenuating channel measurement results received from other terminal devices. The terminal device can select an appropriate attenuation strategy based on the specific application scenario, and the scope of this application is not limited in this respect.

[0147] In some embodiments, if a terminal device receives channel measurement results from other terminal devices that have attenuated to below a predetermined threshold, the measurement results can be considered to have no effect on the terminal device. For example, a terminal device may be able to perceive the signal boundary on a channel based on measurement results received from other terminal devices, but if the measurement results of that channel have been attenuated to below a predetermined threshold, the signal will not affect the transmission and reception of the terminal device.

[0148] 5. Channel scoring matrix construction In some embodiments, after obtaining the channel measurement results, any one of the terminal devices 110, 120, and 130 can determine the evaluation scores of multiple candidate channels based on the channel measurement results. Any one of the terminal devices 110, 120, and 130 can maintain the evaluation scores of the multiple candidate channels in any suitable manner. As an example, any one of the terminal devices 110, 120, and 130 can use a channel scoring matrix to maintain the evaluation scores of the multiple candidate channels. Of course, methods other than a channel scoring matrix can also be used to maintain the evaluation scores of the multiple candidate channels, and the scope of this application is not limited in this respect. Hereinafter, for illustrative purposes, a channel scoring matrix will be used as an example for description.

[0149] In some embodiments, any one of the terminal devices 110, 120, and 130 may determine the evaluation score of each of the plurality of candidate channels based on the following: Evaluation score of candidate channel = (1) in This represents the measured value of the i-th evaluation parameter of the candidate channel. This represents the score associated with the i-th evaluation parameter. This represents the weight associated with the i-th evaluation parameter.

[0150] In some embodiments, This can be determined through simulation evaluation and / or actual testing. For example, it can be determined through multiple measurements. =25, =25, =40, =40.

[0151] As an example, the evaluation parameters for candidate channels may include, for example, the evaluation parameters shown in Table 1 above. It can represent the amount of interference in a candidate channel. It can represent the signal strength of the candidate channel. This can represent the channel load of a candidate channel. It can represent the noise floor of a candidate channel.

[0152] In some embodiments, the measured values ​​of each evaluation parameter can be input into a neural network model, and after effective calculation, an evaluation score can be output.

[0153] Selection of working channels during network convergence In some embodiments, either terminal device 110 or 120 in communication network 100 can establish distributed services with terminal devices in another communication network. In such embodiments, communication network 100 needs to be merged (also referred to as "merging") with another communication network. Reference will be made below. Figure 6 To elaborate further.

[0154] Figure 6 A schematic diagram of a multi-device network according to an embodiment of this application is shown. As shown in the figure, with Figure 1Similarly, communication network 100 may include terminal devices 110 and 120. Communication network 600 may include terminal devices 610 and 620. Terminal devices 610 and 620 can each be any suitable electronic device. Examples of such electronic devices may include, but are not limited to: personal computers, mobile phones, tablets, televisions (also known as smart screens or large-screen devices), ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), in-vehicle devices (also known as vehicle infotainment systems), wearable electronic devices, virtual reality devices, etc. Embodiments of this application do not impose any limitations on this. Figure 6 The number of terminal devices in the communication network 600 shown is merely illustrative; the communication network 600 may include more or fewer terminal devices, and the embodiments of this application do not impose any limitations on this. Furthermore, for the sake of brevity, in... Figure 6 Not shown in the middle Figure 1 The terminal device 130 and router 140 are shown.

[0155] In some embodiments, any one of terminal devices 110 and 120 in communication network 100 can establish a distributed service with any one of terminal devices 610 and 620 in communication network 600. Hereinafter, the establishment of a distributed service (e.g., file-sharing service) between terminal device 120 and terminal device 620 will be described as an example. In such an embodiment, communication network 100 needs to be integrated with communication network 600.

[0156] As previously described, in some embodiments, a P2P connection can be established between terminal devices 110 and 120. For example, during the establishment of a P2P connection between terminal devices 110 and 120, they can negotiate to determine that terminal device 110 will act as the GO (Go), and then terminal device 120 will act as the GC (GC). Similarly, in some embodiments, a P2P connection can also be established between terminal devices 610 and 620, and they can negotiate to determine that terminal device 610 will act as the GO, and then terminal device 620 will act as the GC.

[0157] In a P2P connection scheme, once the role of a P2P device is determined, it cannot modify its role when creating new connections with other P2P devices. This results in a situation where a GC (GC Controller) cannot establish distributed services with other terminal devices if it is already connected to a GO (Goal Controller). In other words, if a GO's network is already established, a new terminal device can only join the network as a GC. Furthermore, GOs belonging to different networks cannot communicate with each other, and GCs connected to different GOs also cannot communicate with each other; therefore, two communication networks using P2P connections cannot be merged. Consequently, in embodiments where P2P connections are established between terminal devices 110 and 120, and between terminal devices 610 and 620, terminal devices 120 and 620, acting as GCs, cannot establish connections to create distributed services.

[0158] To achieve the convergence of two communication networks, in some embodiments, terminal devices 110 and 120, and terminal devices 610 and 620, can communicate using either the Huawei Magneto Link (HML) direct connection scheme or any other protocol that breaks the GO and GC role restrictions. In the following text, devices supporting HML technology are also referred to as HML devices. The HML direct connection scheme allows multiple HML devices to interconnect arbitrarily. In the HML connection scheme, since GOs in different communication networks can interconnect with each other, GOs and GCs can interconnect with each other, and GCs can interconnect with each other, the HML direct connection scheme can be seen as breaking the GO and GC role restrictions in the P2P connection scheme, enabling terminal devices to achieve distributed service merging in multi-service scenarios. Because the HML direct connection scheme can overcome the GO and GC role restrictions, terminal devices are no longer limited to GO or GC roles. In the HML direct connection scheme, the device responsible for the allocation and management of communication resources can be called the active terminal device. The active device needs to remain within its group and send beacon frames to broadcast its presence, making it easy for other devices to discover and connect to it through scanning.

[0159] Furthermore, in the HML connectivity scheme, the terminal device acting as the GO can enter a sleep state when there is no data transmission, thereby reducing power consumption. Additionally, the HML direct connection scheme can optimize transmission strategies for different services, which helps reduce data transmission latency and improve data transmission stability.

[0160] Before the convergence of communication networks 100 and 600, the channels operated by terminal devices 110 and 120 could be different from those operated by terminal devices 610 and 620. For example, terminal devices 110 and 120 could operate on channel CH2, while terminal devices 610 and 620 could operate on channel CH3. During the convergence of communication networks 100 and 600, the operating channels need to be adjusted. That is, in the converged network, terminal devices 110, 120, 610, and 620 need to operate on the same channel because the underlying hardware of terminal devices 110, 120, 610, and 620 can only operate on one channel. For example, terminal devices typically have dual radio frequencies, supporting 2.4 GHz and 5 GHz respectively. Due to the high interference in the 2.4 GHz band and for power consumption considerations, terminal devices will not enable dual radio frequencies. If a terminal device operates on different interfaces and supports different channels, the terminal device needs to constantly switch back and forth between the two channels to schedule message transmission and reception on both channels. This will be discussed in more detail below. Figure 7 To elaborate further.

[0161] Figure 7 A schematic diagram of channel switching according to an embodiment of this application is shown. Figure 7 In the example, after communication network 100 and communication network 600 are integrated, terminal device 120 supports sending and receiving messages with terminal device 110 via channel CH2 on interface #1, and terminal device 120 supports sending and receiving messages with terminal device 620 via channel CH3 on interface #2. During time periods 710 and 720, terminal device 120 performs both channel switching and message sending and receiving. Even though there is no message sending or receiving during time period 730, terminal device 120 still needs to switch to channel CH3 during this time period to schedule message sending and receiving on this channel. As a result, terminal device 120 will lose a significant amount of bandwidth. According to empirical statistics, even if a channel is idle, the efficiency loss caused by switching accounts for a large proportion. In addition, time-division switching of channels can also cause screen flickering, stuttering, and other phenomena in screen projection services. Therefore, during the integration of the two communication networks, it is necessary to adjust the working channels so that the terminal devices in the integrated network operate on the same channels.

[0162] In some embodiments, in order for terminal devices in the merged network to operate on the same channel, terminal devices in the two communication networks can negotiate to determine the operating channel in the merged network. Reference will be made below. Figure 8 To elaborate further.

[0163] Figure 8 A signaling interaction diagram of a channel selection process 800 according to some embodiments of this application is shown. For purposes of discussion, reference will be made to... Figure 6The various elements shown herein describe the channel selection process 800. As an example, the process will be described using the establishment of a distributed service between terminal device 120 and terminal device 620. However, it should be understood that process 800 can also be executed between terminal devices 110 and 610, between terminal devices 110 and 620, or between terminal devices 120 and 610. Furthermore, process 800 can be executed in any other communication scenario.

[0164] like Figure 8 As shown, terminal device 120 sends a second request message (830) to terminal device 620 via the first connection. Correspondingly, terminal device 620 receives the second request message (835) from terminal device 120 via the first connection. The second request message is used to request the establishment of a second connection with terminal device 620.

[0165] In some embodiments, the second connection can be used to carry service data between terminal device 120 and terminal device 620. Examples of the second connection may include, but are not limited to, HML connections and P2P connections. In embodiments where the second connection includes an HML connection, the second request message may include at least one of HML information, compatibility information, or local information.

[0166] The second request message also includes first quality information for multiple candidate channels. As described in the “Example Network Architecture” section, the terminal device may also measure the channel quality of multiple candidate channels to obtain channel measurement results. In such an example, the first quality information for multiple candidate channels may include measurement results obtained by the terminal device 120 by measuring the channel quality of multiple candidate channels.

[0167] In some embodiments, the first quality information of the plurality of candidate channels may include channels for communication between terminal device 120 and other terminal devices in the communication network 100. For example, the first quality information of the plurality of candidate channels may include channel CH2 for communication between terminal device 120 and terminal device 110.

[0168] The first connection is pre-established between terminal device 120 and terminal device 620. In some embodiments, the first connection may be used to carry control information associated with communication between terminal device 120 and terminal device 620. Examples of the first connection may include, but are not limited to, Bluetooth BLE connection, Wi-Fi connection, and Bluetooth Basic Rate (BR) connection.

[0169] In some embodiments, in order to establish a first connection with terminal device 620, terminal device 120 may send (810) a first request message to terminal device 620. Accordingly, terminal device 620 receives (815) the first request message from terminal device 120. In some embodiments, the first request message may include a discovery request message for requesting the discovery of terminal device 620. Examples of the discovery request message include, but are not limited to, BLE discovery request messages and Constrained Application Protocol (CoAP) discovery request messages. As an example, terminal device 120 may send the discovery request message periodically. As another example, terminal device 120 may send the discovery request message in response to the initiation of a communication service. In such an example, terminal device 120 acts as the service initiator, and terminal device 620 acts as the service responder.

[0170] Upon receiving the first request message, terminal device 620 may send (820) a first response message in response to the first request message to terminal device 120. Accordingly, terminal device 120 receives (825) the first response message from terminal device 620. Upon receiving the first response message, terminal device 620 establishes a first connection with terminal device 120.

[0171] In some embodiments, terminal device 620 may authenticate terminal device 120. If authentication is successful, terminal device 620 sends the first response message to terminal device 120. In embodiments where the first request message includes a discovery request message, the first response message may include a discovery response message. For example, in an example where the discovery request message includes a BLE discovery request message, the first response message may include a BLE discovery response message.

[0172] Upon receiving the second request message, terminal device 620 causes (840) the common operating channel of communication networks 100 and 600 to be determined based on first quality information of multiple candidate channels and second quality information of multiple candidate channels stored locally. In other words, the operating channel of the merged communication networks 100 and 600 is determined based on the first and second quality information of multiple candidate channels.

[0173] As mentioned earlier, in the HML direct connection scheme, the device responsible for the allocation and management of communication resources can be referred to as the active end device. In the embodiment where the terminal device 620 acts as the active end device in the converged network, the terminal device 620 itself can determine the common working channel of communication networks 100 and 600 based on the first quality information and the second quality information of multiple candidate channels.

[0174] In some embodiments, if the quality of at least one of the channels CH2 used for communication between terminal device 120 and terminal device 110 and CH3 used for communication between terminal device 620 and terminal device 610 is higher than a threshold, then terminal device 620 preferentially selects one channel from channels CH2 and CH3 as the working channel of the merged communication networks 100 and 600. In some embodiments, if the quality of both channels CH2 and CH3 is lower than the threshold, then terminal device 620 can select one channel other than channels CH2 and CH3 from a plurality of candidate channels as the working channel.

[0175] In embodiments where other terminal devices (e.g., terminal device 610) in the communication network 600 act as the active terminal device, terminal device 620 can provide the active terminal device with first quality information of multiple candidate channels. Furthermore, the active terminal device can determine the operating channels of the fused communication networks 100 and 600 based on the first quality information of the multiple candidate channels and the quality information of the multiple candidate channels stored locally.

[0176] Terminal device 620 sends (850) a second response message to terminal device 120 in response to the second request message via the first connection. Correspondingly, terminal device 120 receives (855) the second response message. The second response message includes second quality information for multiple candidate channels. Similar to the first quality information for the multiple candidate channels, the second quality information for the multiple candidate channels may include measurement results obtained by terminal device 620 by measuring the channel quality of the multiple candidate channels.

[0177] In some embodiments, the second quality information of the plurality of candidate channels may include channels for communication between terminal device 620 and other terminal devices in communication network 600. For example, the second quality information of the plurality of candidate channels may include channel CH3 for communication between terminal device 620 and terminal device 610.

[0178] In embodiments where the second connection includes an HML connection, the second response message may further include indication information for creating an HML connection. After obtaining the indication information, the terminal device 120 may start creating an HML link based on the HML information of the terminal devices 120 and 620, thus completing the four-way handshake connection establishment.

[0179] Upon receiving the second response message, terminal device 120 causes (860) the common working channel of communication networks 100 and 600 to be determined based on the second request message and the second response message.

[0180] The solution proposed in this application negotiates the working channel of the merged network through a pre-established first connection, enabling terminal devices in the merged network to work on the same channel, avoiding time-division switching of the channel, and improving communication efficiency and quality.

[0181] In an embodiment where terminal device 120 acts as an active terminal device in the converged network, terminal device 120 can determine the working channel of the converged communication networks 100 and 600 based on first quality information of multiple candidate channels stored locally and second quality information of multiple candidate channels obtained from a second response message. Similarly, if the quality of at least one of channels CH2 and CH3 is higher than a threshold, terminal device 120 can preferentially select one channel from channels CH2 and CH3 as the working channel of the converged communication networks 100 and 600. If the quality of both channels CH2 and CH3 is lower than the threshold, terminal device 120 can select one channel other than channels CH2 and CH3 from multiple candidate channels as the working channel.

[0182] After the operating channels of the merged communication networks 100 and 600 are determined, terminal devices in either network 100 or 600 need to switch to that operating channel. For example, in the example where channel CH2 is selected as the operating channel, terminal devices in network 100 do not need to switch channels, while terminal devices 610 and 620 in network 600 need to switch from channel CH3 to channel CH2. In such an example, terminal device 620 can send a switching notification to terminal device 610. This switching notification can indicate information about channel CH2. Alternatively, the switching notification can also indicate the channel switching time. Then, terminal devices 610 and 620 can switch their operating channels to channel CH2 at the notified switching time. Since terminal devices 610 and 620 switch simultaneously, and the hard switch time is generally on the order of milliseconds, there is almost no impact on services.

[0183] As mentioned earlier, in the HML direct connection scheme, the device responsible for the allocation and management of communication resources can be called the active end device. After the convergence of communication networks 100 and 600, a new active end device needs to be determined to be responsible for the allocation and management of resources in the converged network. The following will refer to... Figure 9 This describes the process of identifying the active end devices in the merged network.

[0184] Figure 9 A signaling interaction diagram illustrating the process of determining the active end device in a converged network according to some embodiments of this application is shown. For purposes of discussion, reference will be made to... Figure 6The various elements shown describe the channel selection process 900. As an example, the description will focus on establishing a distributed service between terminal device 120 and terminal device 620. However, it should be understood that process 900 can also be executed between terminal device 110 and terminal device 610, between terminal device 110 and terminal device 620, or between terminal device 120 and terminal device 610. Furthermore, process 900 can be executed in any other communication scenario. Figure 9 In the embodiment shown, one of the original active devices in communication networks 100 and 600 will be identified as the active device in the merged network (hereinafter also referred to as the new active device).

[0185] like Figure 9 As shown, terminal device 120 sends (910) information about the original active terminal device in communication network 100 to terminal device 620. Correspondingly, terminal device 620 receives (915) information about the original active terminal device in communication network 100.

[0186] In some embodiments, the terminal device 120 can refer to the above references Figure 8 The first connection described herein sends information about the original active device in the communication network 100 to the terminal device 620. To reduce message exchange, the terminal device 120 may include the information about the original active device in the above reference. Figure 8 The second request message described is sent to terminal device 620.

[0187] Furthermore, based on information about the original active terminal device in the communication network 100 and information about the original active terminal device in the communication network 600, the terminal device 620 determines (920) a new active terminal device.

[0188] In some embodiments, the information about the original active device in communication network 100 or 600 may include at least the physical address and resource capability information of the original active device. Resource capability information may include, for example, information about continuous power supply capability and storage capacity of memory (e.g., ROM, RAM). In such embodiments, the continuous power supply capability and storage capacity of the original active device can be assigned corresponding weights, and the terminal device 620 can determine two original active devices as new active devices based on the weighted average of their respective continuous power supply capability and storage capacity in communication networks 100 and 600. For example, the terminal device 620 may determine the original active device with the higher weighted average as the new active device. If the weighted average of the continuous power supply capability and storage capacity of the two original active devices is the same, the terminal device 620 may determine the original active device with the larger physical address as the new active device.

[0189] Terminal device 620 sends (930) information about the original active terminal device in communication network 600 to terminal device 120. Correspondingly, terminal device 120 receives (935) information about the original active terminal device in communication network 600.

[0190] In some embodiments, the terminal device 620 can refer to the above references. Figure 8 The first connection described herein sends information about the original active device in the communication network 600 to the terminal device 120. To reduce message exchange, the terminal device 620 may include the information about the original active device in the above reference. Figure 8 The second response message described is sent to terminal device 120.

[0191] Then, based on information about the original active device in the communication network 100 and information about the original active device in the communication network 600, terminal device 120 determines (940) a new active device. In some embodiments, terminal device 120 may use a process similar to that of terminal device 620 to determine the new active device. Network address selection during network convergence In some embodiments, before the communication network 100 and the communication network 600 are integrated, the IP addresses of the terminal devices in the communication network 100 may be the same as those of the terminal devices in the communication network 600. For example, the IP addresses of terminal devices 110 and 120 in the communication network 100 may be 172.240.1.22 / 24 and 172.240.1.23 / 24, respectively, and the IP addresses of terminal devices 610 and 620 in the communication network 600 may be 172.240.1.15 / 24 and 172.240.1.23 / 24, respectively, where " / 24" represents a 24-bit subnet mask.

[0193] Because terminal device 120 and terminal device 620 have the same IP address, an IP address conflict will occur after network convergence, which will lead to service interruption for other terminal devices communicating with terminal devices 120 and 620. For example, Figure 6 Services between terminal devices 110 and 120 may be interrupted, or connections may fail to be established or services may be interrupted for other terminal devices (not shown) that are forwarded by terminal device 120 and / or terminal device 620. For example, if services between terminal device 110 and the other terminal device need to be forwarded by terminal device 120, and since terminal device 120 and terminal device 620 have the same IP address, services between terminal device 110 and the other terminal device that are forwarded by terminal device 120 will be interrupted.

[0194] To address the aforementioned IP address conflict issue, embodiments of this application propose a scheme for configuring IP addresses. According to this scheme, two terminal devices can pre-detect IP address conflicts during the establishment of a connection for carrying service data, and negotiate conflict-free network segments for routing configuration, thereby improving communication stability. References will be made below. Figure 10 To elaborate further.

[0195] Figure 10 A signaling interaction diagram of a process 1000 for configuring an IP address according to some embodiments of this application is shown. For purposes of discussion, reference will be made to... Figure 6 The various elements shown herein describe process 1000. As an example, the description will focus on establishing a distributed service between terminal device 120 and terminal device 620. However, it should be understood that process 1000 can also be executed between terminal devices 110 and 610, between terminal devices 110 and 620, or between terminal devices 120 and 610. Furthermore, process 1000 can be executed in any other communication scenario.

[0196] like Figure 10 As shown, terminal device 120 sends (1010) the first IP list information of terminal devices in communication network 100 to terminal device 620. In other words, terminal device 120 sends the IP address information already assigned in communication network 100 to terminal device 620. Correspondingly, terminal device 620 receives (1015) the first IP list information.

[0197] In some embodiments, during the establishment of communication network 100, terminal devices 110 and 120 can obtain topology information of other terminal devices within the network, including the IP address used by each terminal device. For example, terminal device 110 in communication network 100 can obtain the IP address of terminal device 120, and terminal device 120 can obtain the IP address of terminal device 110. Thus, terminal device 120 can determine the allocated IP addresses in communication network 100. Similarly, during the establishment of communication network 600, terminal device 620 can also obtain the IP address used by each terminal device from the topology information of other terminal devices within the network, thereby determining the allocated IP addresses in communication network 600 (hereinafter also referred to as the second IP list information of terminal devices in communication network 600).

[0198] In some embodiments, the terminal device 120 can refer to the above references Figure 8 The first connection described herein sends a first IP list information to terminal device 620. To reduce message exchange, terminal device 120 may include the first IP list information in the above reference. Figure 8The second request message described is sent to terminal device 620. Negotiating IP address information through a pre-established first connection facilitates the rapid establishment of the second connection.

[0199] Furthermore, terminal device 620 determines (1020) its second target IP address based at least on the first IP list information. The second target IP address differs from the IP addresses in the first IP list information of the terminal devices in communication network 100 and the IP addresses in the second IP list information of the terminal devices in communication network 600. In other words, the second target IP address differs from the IP addresses already assigned in communication networks 100 and 600.

[0200] For example, as mentioned above, the IP addresses of terminal devices 110 and 120 in communication network 100 can be 172.240.1.22 / 24 and 172.240.1.23 / 24, respectively, and the IP addresses of terminal devices 610 and 620 in communication network 600 can be 172.240.1.15 / 24 and 172.240.1.23 / 24, respectively. The IP addresses in the first IP list information include 172.240.1.22 / 24 and 172.240.1.23 / 24. The IP addresses in the second IP list information include 172.240.1.15 / 24 and 172.240.1.23 / 24. Based on the first and second IP list information, terminal device 620 can determine that the 172.240.1.X network segment has been used. To avoid IP address conflicts with terminal devices in the communication network 100, terminal device 620 can select an IP address from a different network segment than the 172.240.1.X network segment as its second target IP address. For example, terminal device 620 can select IP address 172.240.2.1 from the 172.240.2.X network segment as its second target IP address.

[0201] It is understandable that if the IP addresses of the terminal devices in communication network 100 and communication network 600 do not conflict, then terminal device 620 can still use the IP address of the original network segment.

[0202] After determining the second target IP address, terminal device 620 sends (1030) the second IP list information and the second target IP address to terminal device 120. In some embodiments, terminal device 620 can refer to the above... Figure 8 The first connection described herein sends a second IP list information and a second destination IP address to the terminal device 120. To reduce message exchange, the terminal device 620 may include the second IP list information and the second destination IP address in the above reference. Figure 8The second response message described is sent to terminal device 120. Accordingly, terminal device 120 receives (1035) the second IP list information and the second target IP address.

[0203] Furthermore, terminal device 120 determines (1040) a first target IP address based at least on the second IP list information and the second target IP address. The first target IP address is different from the IP addresses in the first IP list information and the second IP list information, as well as the second target IP address. In other words, the first target IP address is different from both the IP addresses already allocated in communication networks 100 and 600 and the second IP address determined by terminal device 620.

[0204] For example, as mentioned above, the IP addresses in the first IP list information include 172.240.1.22 and 172.240.1.23, and the IP addresses in the second IP list information include 172.240.1.15 and 172.240.1.23. Based on the first and second IP list information, terminal device 120 can determine that the 172.240.1.X network segment has already been used. To avoid IP address conflicts with terminal devices in the communication network 600, terminal device 620 can select an IP address from a network segment different from the 172.240.1.X network segment as its first target IP address. For example, based on the IP address of terminal device 620 (172.240.2.1), terminal device 120 can select an IP address in the 172.240.2.X network segment that is different from its own IP address (e.g., 172.240.2.2) as its second target IP address. Of course, terminal device 120 can also choose an IP address from a network segment other than 172.240.2.X as its second target IP address.

[0205] Although the above describes both the working channel selection process and the network address selection process when communication networks 100 and 600 are integrated, it should be understood that in some embodiments only the working channel selection process or only the network address selection process may be implemented; of course, both the working channel selection process and the network address selection process may also be implemented, and the scope of this application is not limited in this respect.

[0206] Currently, the number of interfaces and IP addresses for underlying Wi-Fi / P2P services is limited—one interface can only correspond to one IP address. Therefore, to facilitate the negotiation of new IP addresses and avoid IP address conflicts, Wi-Fi / P2P service applications can be extended to support multiple interfaces and multiple IP addresses, allowing multiple IP addresses to exist on a single physical interface. Multiple IP addresses enable fast network connections without waiting for a Dynamic Host Configuration Protocol (DHCP) server to assign IP addresses to connected terminal devices. Connected terminal devices can negotiate IP addresses with the GO (Go) or SoftAP (Soft App) to communicate. This fast connection is not limited to network type; it can be a connection between GO and GC (Garbage Collection), or between SoftAP and STA (Single-Target Device). References will follow below. Figure 11 To elaborate further.

[0207] Figure 11 A schematic diagram of a multi-IP address configuration according to some embodiments of this application is shown. For purposes of discussion, reference will be made to... Figure 6 The various elements shown are used for description. As an example, the description will focus on communication between terminal device 120 and terminal devices 110 and 620 after the convergence of communication networks 100 and 600. Figure 11 In the example, terminal device 120 supports communication with terminal devices 110 and 620 via multiple IP addresses. Terminal device 120 can receive messages from terminal device 620, where the destination IP address in the message is one of multiple IP addresses.

[0208] like Figure 11 As shown, terminal device 120 has one physical interface and two virtual logical sub-interfaces, namely sub-interface 1 and sub-interface 2. Sub-interface 1 corresponds to the IP address 192.168.10.1, and sub-interface 2 corresponds to the IP address 192.168.20.1. Terminal device 110 has one physical interface and one sub-interface, corresponding to the IP address 192.168.10.2. Terminal device 620 has one physical interface and one sub-interface, corresponding to the IP address 192.168.20.2. Terminal devices 120 and 110 communicate using the 192.168.10.x network segment, while terminal devices 120 and 620 communicate using the 192.168.20.x network segment. Using different network segments helps avoid address conflicts. Furthermore, the two sub-interfaces of terminal device 120 can achieve load balancing of traffic, or the two sub-interfaces can carry different service data.

[0209] although Figure 11Terminal device 120 has two logical sub-interfaces, but it only has one actual physical interface. During the process of terminal devices 110 and 620 sending messages to terminal device 120, the destination IP addresses in the messages sent by the two devices are different, but the destination physical addresses are the same. Examples of physical addresses include, but are not limited to, Media Access Control (MAC) addresses.

[0210] When terminal device 110 sends a message to terminal device 120, after encapsulating the message, terminal device 110 can query the routing table to find that the outgoing interface corresponding to the IP address (e.g., 192.168.10.1) assigned to terminal device 120 by the GO (e.g., terminal device 110) in communication network 100 is a physical interface. It should be understood that this physical interface is a virtual physical interface; the sending end of the message cannot use the MAC address corresponding to this physical interface as the destination MAC address for encapsulation, otherwise, message transmission errors will occur. After the message reaches the IP layer, terminal device 110 encapsulates the IP header. After the message reaches the link layer, terminal device 110 can query the Address Resolution Protocol (ARP) table entry, which includes the real MAC address of terminal device 120 (e.g., 60-d7-55-fb-46-0c). Terminal device 110 encapsulates the MAC header with the real MAC address of terminal device 120 as the destination MAC address.

[0211] Similarly, the process of terminal device 620 sending messages to terminal device 120 is similar to that of terminal device 110 sending messages to terminal device 120. The difference is that the destination IP address in the message sent by terminal device 620 is 192.168.20.1, and the destination MAC address is 60-d7-55-fb-46-0c.

[0212] After receiving a message from terminal device 110 or terminal device 620 at the link layer, if terminal device 120 determines that the destination MAC address is its own MAC address, it decapsulates the MAC header of the message and then sends the message to the IP layer. If the IP layer determines that the destination IP address is the IP address of terminal device 120, it decapsulates the IP header and then sends the message to the transport layer for message reception processing.

[0213] As can be seen from the above message transmission process, the two logical sub-interfaces of terminal device 120 correspond to two different network segments of IP addresses. One network segment is used to communicate with terminal device 110, and the other network segment is used to communicate with terminal device 620. Therefore, there will be no address conflict.

[0214] Furthermore, communication typically requires both parties to first obtain the other's IP address before proceeding with the dynamic ARP entry learning process. ARP entries are used to map IP addresses to actual MAC addresses. During dynamic ARP learning, if the sending end knows the receiving end's IP address but not its MAC address, communication between them is impossible. Therefore, the sending end can broadcast an ARP request message containing the receiving end's IP address. Upon receiving this message, if the receiving end determines that the IP address in the message matches its own, it can unicast its own MAC address back to the sending end. This dynamic ARP entry learning process incurs signaling overhead.

[0215] To reduce the signaling overhead caused by the dynamic learning process of ARP entries, in some embodiments, the terminal device 620 can use the above references. Figure 8 The first connection described herein sends the MAC address of terminal device 620 to terminal device 120. To reduce message exchange, terminal device 620 may include its own MAC address in the above reference. Figure 8 The second response message described is sent to terminal device 120. As previously mentioned, the second response message may also include a second target IP address of terminal device 620. Therefore, upon receiving the second response message, terminal device 120 can provide the MAC address and second target IP address of terminal device 620 contained therein to the ARP table entry, thereby establishing a mapping between the MAC address of terminal device 620 and its second target IP address.

[0216] In some embodiments, when sending a message to terminal device 620, terminal device 120 can determine the target MAC address of terminal device 620 through the mapping relationship between the MAC address of terminal device 620 and its second target IP address in the ARP entry. The destination IP address in the message sent to terminal device 620 is the second target IP address of terminal device 620, and the destination MAC address in the message is the MAC address of terminal device 620. Therefore, the dynamic learning process of ARP entries can be omitted, thereby reducing signaling overhead and facilitating faster message transmission.

[0217] The above describes in detail the process by which merging devices avoid IP address conflicts through negotiation during the convergence of different HML networks. Furthermore, for P2P or HML networks with DHCP servers, the above negotiation method can still be used to establish P2P or HML connections to avoid IP address conflicts. It should be understood that the GO in the P2P network or the active end device in the HML network can act as the DHCP server. This will be referenced below. Figure 12To elaborate further.

[0218] Figure 12 A schematic diagram of a communication network 1200 according to an embodiment of this application is shown. Network 1200 includes a DHCP server 1210, terminal devices 1220 and 1230. Terminal devices 1220 and 1230 have a P2P interface or an HML interface. Figure 1 In the embodiment where terminal device 110 acts as the GO and terminal devices 120 and 130 act as the GC in the communication network 100 shown, terminal device 110 can act as a DHCP server 1210 to assign IP addresses to terminal devices 120 and 130, where terminal devices 120 and 130 correspond to terminal devices 1220 and 1230, respectively. Similarly, for the GO in the P2P network, the DHCP server 1210 can also assign IP addresses to the GC connected to it, which will not be elaborated here.

[0219] DHCP server 1210 can assign IP addresses to terminal devices 1220 and 1230 through interfaces; generally, one interface corresponds to one IP address. Terminal devices 1220 and 1230 can each connect to DHCP server 1210 through WLAN 0 interface. Terminal devices 1220 and 1230 can connect via a P2P interface or an HML interface, and their IP addresses can be configured through this interface.

[0220] The IP address assigned by DHCP server 1210 may conflict with the default IP addresses configured for terminal devices 1220 and 1230. For example, the IP address configured in the address pool of DHCP server 1210 is 192.168.43.100, while the IP address configured for communication with terminal device 1230 via P2P or HML interface is also 192.168.43.100, resulting in an address conflict. In this case, DHCP server 1210 can assign a new IP address to terminal device 1220, or the IP address of terminal device 1220 can be manually changed.

[0221] DHCP server 1210 typically assigns new IP addresses sequentially within a fixed network segment. For example, if DHCP server 1210 previously assigned an IP address of 192.168.43.8, then the IP address currently being reassigned to terminal device 1220 in sequence will be 192.168.43.9. This method of IP address allocation lacks flexibility and resolves address conflicts manually only after they have already occurred, which is detrimental to the stability of business data transmission.

[0222] In some embodiments, the DHCP server 1210 may first assign IP addresses to terminal devices 1220 and 1230, after which terminal devices 1220 and 1230 may establish a P2P connection or an HML connection. In this case, terminal devices 1220 and 1230 may use an address negotiation mechanism to negotiate the parameters for establishing the HML link through the first connection, avoiding all addresses in the already used network segments in the DHCP server 1210 address pool (e.g., the 254 IP addresses in the 192.168.43.x network segment), and assigning IP addresses in non-conflicting network segments for communication.

[0223] In other embodiments, terminal devices 1220 and 1230 may first establish a P2P connection or an HML connection, after which DHCP server 1210 may assign IP addresses to terminal devices 1220 and 1230. Taking terminal device 1220 as an example, if terminal device 1220 detects that the IP address assigned to it by DHCP server 1210 conflicts with the IP address negotiated between terminal devices 1220 and 1230, then terminal device 1220 may send a decline message to DHCP server 1210 to reject the address offer from DHCP server 1210, and submit a DHCP request message to DHCP server 1210 to propose a DHCP option, placing an IP address it considers to be conflict-free in the DHCP option field for DHCP server 1210 to select.

[0224] Optionally, the method for negotiating IP addresses provided in the embodiments of this application can also be implemented when IP address conflicts have already occurred. For example, if terminal device 120 and terminal device 620 do not negotiate IP addresses during the establishment of an HML connection, then after the HML connection is established, i.e., after the communication networks 100 and 600 are merged, service interruption may occur between the terminal devices in the two networks. In the event of a service interruption, terminal device 120 and terminal device 620 can exchange their respective IP list information through the established first connection, reconfigure conflict-free IP addresses according to their respective IP list information, and establish an HML connection for communication.

[0225] Figure 13 A schematic diagram of the structure of an electronic device 1300 according to an embodiment of this application is shown. Figure 13 As shown, the electronic device 1300 may include a processor 210, an external memory interface 292, an internal memory 296, a Subscriber Identification Module (SIM) card interface 294, a display screen 220, a camera 222, an indicator 224, a motor 226, buttons 228, a Universal Serial Bus (USB) interface 230, a mobile communication module 250, an antenna 252, a wireless communication module 260, an antenna 262, an audio module 270, a speaker 272, a receiver 274, a microphone 276, a headphone jack 278, and a sensor module 280, etc.

[0226] Understandably, Figure 13 This is merely illustrative; electronic device 1300 may include more or fewer components, or multiple components may be combined into one component, or one component may be split into multiple components, or a combination thereof. It is also understood that... Figure 13 The components shown can be implemented in hardware, software, or a combination of both.

[0227] The processor 210 may include one or more processing units, such as a central processing unit (CPU), 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), etc. The different processing units may be independent devices or integrated into one or more processors.

[0228] The processor 210 may also include a memory for storing instructions and data. For example, the memory in the processor 210 may be a cache memory. This memory can store instructions or data that the processor 210 has just used or that are being used repeatedly. If the processor 210 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the processor 210's waiting time, and thus improves system efficiency.

[0229] Processor 210 may include one or more interfaces. 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) interface, a General-Purpose Input / Output (GPIO) interface, a SIM card interface 294, and / or a USB interface 230, etc.

[0230] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some scenarios, the processor 210 can contain multiple I2C buses. The processor 210 can couple to the touch sensor 2820, charger, flash, camera 222, etc., through different I2C bus interfaces. For example, the processor 210 can couple to the touch sensor 2820 through the I2C interface, enabling the processor 210 and the touch sensor 2820 to communicate through the I2C bus interface, thus realizing the touch function of the electronic device 1300.

[0231] The I2S interface can be used for audio communication. In some scenarios, the processor 210 can contain multiple I2S buses. The processor 210 can be coupled to the audio module 270 via the I2S bus to enable communication between the processor 210 and the audio module 270. In some scenarios, the audio module 270 can transmit audio signals to the wireless communication module 260 via the I2S interface to enable the function of answering phone calls through Bluetooth headsets, etc.

[0232] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some scenarios, the audio module 270 and the wireless communication module 260 can be coupled via the PCM bus interface. In some scenarios, the audio module 270 can also transmit audio signals to the wireless communication module 260 via the PCM interface, enabling the function of answering phone calls through Bluetooth headsets, etc. It can be understood that both the I2S interface and the PCM interface can be used for audio communication.

[0233] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be bidirectional, converting the data to be transmitted between serial and parallel communication. In some scenarios, the UART interface is typically used to connect the processor 210 and the wireless communication module 260. For example, the processor 220 communicates with the Bluetooth module in the wireless communication module 260 via the UART interface to implement Bluetooth functionality. In some scenarios, the audio module 270 can transmit audio signals to the wireless communication module 260 via the UART interface, enabling music playback via Bluetooth headphones, etc.

[0234] The MIPI interface can be used to connect the processor 210 to peripheral devices such as the display screen 220 and camera 222. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some scenarios, the processor 210 and camera 222 communicate via the CSI interface to enable the electronic device 1300 to capture images. The processor 220 and display screen 220 communicate via the DSI interface to enable the electronic device 1300 to display images.

[0235] The GPIO interface is configurable via software. It can be configured as a control signal or a data signal. In some scenarios, the GPIO interface can be used to connect the processor 210 to the camera 222, display 220, wireless communication module 260, audio module 270, sensor module 280, etc. The GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.

[0236] USB port 230 is a USB standard compliant interface, which can be a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 230 can be used to connect a charger to charge electronic device 1300, and can also be used for data transfer between electronic device 1300 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0237] It is understood that the interface connection relationships between the modules are only illustratively illustrated in this application, but these illustrations should not be construed as limiting the structure of the electronic device 1300. The electronic device 1300 may also adopt different interface connection methods than those described above, or may adopt a combination of multiple interface connection methods.

[0238] The wireless communication function of electronic device 1300 can be implemented through mobile communication module 250, antenna 252, wireless communication module 260, antenna 262, modem processor, and baseband processor.

[0239] Antennas 252 and 262 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 1300 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 252 can be multiplexed as a diversity antenna for a wireless local area network. For example, the antenna can be used in conjunction with a tuning switch.

[0240] The mobile communication module 250 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 1300. The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 252. In some scenarios, at least some functional modules of the mobile communication module 250 may be housed in the processor 210. In some scenarios, at least some functional modules of the mobile communication module 250 and at least some modules of the processor 210 may be housed in the same device.

[0241] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal, and the demodulator demodulates 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 processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 272, receiver 274, etc.) or displays images or videos through display screen 220. In some scenarios, the modem processor may be a standalone device. In other scenarios, the modem processor may be independent of the processor 210 and housed within the same device as the mobile communication module 250 or other functional modules.

[0242] The wireless communication module 260 can provide wireless communication solutions for use on the electronic device 1300, including Wireless Local Area Network (WLAN), such as Wi-Fi networks, BitTorrent, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), NFC, and infrared (IR) technologies. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via antenna 262, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 210. The wireless communication module 260 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 262.

[0243] In some scenarios, the antenna 252 of the electronic device 1300 is coupled to the mobile communication module 250, and the antenna 262 is coupled to the wireless communication module 260, enabling the electronic device 1300 to communicate with networks and / or other devices via wireless communication technologies. These wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc.

[0244] GNSS can include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).

[0245] Electronic device 1300 implements display functions through a GPU, display screen 220, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 220 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0246] Display screen 220 is used to display text, images, videos, etc. Display screen 220 includes a display panel, which 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), Mini-LED, Micro-LED, Micro-OLED, Quantum Dot Light-Emitting Diodes (QLED), etc. In some scenarios, electronic device 1300 may include one or more display screens 220.

[0247] Electronic device 1300 can perform shooting functions through ISP, camera 222, video codec, GPU, display screen 220 and application processor.

[0248] The ISP (Image Signal Processor) is used to process data fed back from the camera 222. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some scenarios, the ISP can be set within the camera 222 itself.

[0249] Camera 222 is used to capture still images or videos. An object is projected onto a photosensitive element through a lens, generating an optical image. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP (Internet Service Provider) for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP (Digital Signal Processor) for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some scenarios, electronic device 1300 may include one or more cameras 222.

[0250] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 1300 is selecting a frequency point, the DSP is used to perform Fourier transforms on the frequency energy.

[0251] Video codecs are used to compress or decompress digital video. Electronic device 1300 may support one or more video codecs. Thus, electronic device 1300 can play or record video in various encoded formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0252] NPU stands for Neural Network (NN) computing processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0253] Indicator 224 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0254] Motor 226 can generate vibration alerts. Motor 226 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 226 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 20. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0255] Buttons 228 include a power button, volume buttons, etc. Buttons 228 can be mechanical buttons or touch buttons. Electronic device 1300 can receive button input and generate key signal inputs related to user settings and function control of electronic device 1300.

[0256] The SIM card interface 294 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 294 to make contact with and detach from the electronic device 1300. The electronic device 1300 can support one or more SIM card interfaces 294. The SIM card interface 294 supports Nano SIM cards, Micro SIM cards, mini SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 294 simultaneously; the types of cards can be the same or different. The SIM card interface 294 is also compatible with different types of SIM cards. The SIM card interface 294 is also compatible with external memory cards. The electronic device 1300 interacts with the network through the SIM card to achieve functions such as calls and data communication. In some scenarios, the electronic device 1300 uses an embedded SIM (eSIM) card; the eSIM card can be embedded in the electronic device 1300 and cannot be separated from it.

[0257] The external storage interface 292 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the electronic device 1300. The external storage card communicates with the processor 210 through the external storage interface 292 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0258] Internal memory 296 can be used to store computer executable program code, which includes instructions. Internal memory 296 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.). The data storage area may store data created during the use of electronic device 1300 (such as audio data, phone book, etc.). Furthermore, internal memory 296 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, Universal Flash Storage (UFS), etc. Processor 210 executes various functional applications and data processing of electronic device 1300 by running instructions stored in internal memory 296 and / or instructions stored in memory disposed in the processor.

[0259] Electronic device 1300 can implement audio functions, such as music playback and recording, through audio module 270, speaker 272, receiver 274, microphone 276, headphone jack 278, and application processor.

[0260] The audio module 270 is used to convert digital audio signals into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 270 can also be used for encoding and decoding audio signals. In some scenarios, the audio module 270 can be located within the processor 210, or some functional modules of the audio module 270 can be located within the processor 210.

[0261] The receiver 274, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 1300 answers a telephone call or voice message, the receiver 274 can be brought close to the ear to listen to the voice.

[0262] Microphone 276, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 276, inputting the sound signal into microphone 276. Electronic device 1300 can be equipped with at least one microphone 276. For example, electronic device 1300 can be equipped with two microphones 276, which, in addition to collecting sound signals, can also perform noise reduction. For example, electronic device 1300 can also be equipped with three, four, or more microphones 276, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0263] The headphone jack 278 is used to connect wired headphones. The headphone jack 278 can be a USB interface 230, or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, or a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface, etc.

[0264] It should be understood that, Figure 13 The electronic device 1300 shown is merely illustrative; when implemented as different types of devices, it may include more or fewer components. For example, when the electronic device 1300 is implemented as a desktop computer, it may not have a SIM card interface 294.

[0265] The software system of the electronic device 1300 can adopt a layered architecture, Harmony OS architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc.

[0266] Figure 14 A software architecture block diagram of an electronic device 1300 with a layered Android system according to an embodiment of this application is shown.

[0267] Layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. For example... Figure 14 As shown, the Android system can be divided into four layers, from top to bottom: application layer 1410, application framework layer 1420, kernel layer 1430, and network transport layer 1440.

[0268] Application layer 1410 may include a series of application packages, including but not limited to applications (APPs) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0269] Application framework layer 1420 provides an application programming interface (API) and programming framework for the applications of application layer 1410. Application framework layer 1420 may include some predefined functions, including but not limited to window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0270] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0271] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.

[0272] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0273] The phone manager is used to provide communication functions for electronic devices 1300. For example, it manages call status (including connection and disconnection).

[0274] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0275] The notification manager allows applications to display notifications in the status bar. It can be used to convey informational messages and disappears automatically after a short pause, requiring no user interaction. Notification managers are used to announce download completion, message alerts, etc. Notification managers can also appear as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating electronic devices, and flashing indicator lights.

[0276] Kernel layer 1430 includes at least a display driver, a camera driver, an audio driver, and a transmission driver. Different drivers in kernel layer 1430 are used to invoke the hardware devices of electronic device 1300 and perform corresponding operations. For example, the display driver supports the interface display of electronic device 1300, the audio driver supports the playback of audio by electronic device 1300, and the transmission driver supports content sharing between electronic device 1300 and another electronic device.

[0277] The network transport layer 1440 can be used for communication and data transmission between electronic device 1300 and another electronic device. It may include: a Bluetooth module, a Wi-Fi module, an NFC module, a discovery and connection module, a pairing module, and a connection transmission module. The discovery and connection module can be used to discover other electronic devices with whom a communication connection can be established. The pairing module can be used to authenticate the other electronic device requesting to establish a connection during the connection establishment process. The connection transmission module can be used to transmit data, messages, or commands with another electronic device with which a connection has already been established.

[0278] It should be understood that the electronic device 1300 described above is merely illustrative and should not be construed as a limitation on the embodiments described above in this application.

Claims

1. A communication method, characterized in that, The method is used for a first terminal device in a first network, wherein a first connection is established between the first terminal device and a second terminal device in a second network, and the method includes: A request message is sent to the second terminal device through the first connection. The request message is used to request the establishment of a second connection with the second terminal device. The request message includes first quality information of multiple candidate channels. Receive a response message from the second terminal device in response to the request message, the response message including second quality information of the plurality of candidate channels; and Based at least on the response message, a channel for communication between the first terminal device and the second terminal device is determined; The plurality of candidate channels includes a first channel for communication between the first terminal device and a third terminal device in the first network, and a second channel for communication between the second terminal device and a fourth terminal device in the second network; and The determination of the channel for communication between the first terminal device and the second terminal device includes: determining one of the first channel and the second channel as the channel for communication between the first terminal device and the second terminal device.

2. The method according to claim 1, characterized in that, The request message also includes an Internet Protocol (IP) address already assigned in the first network, and the response message also includes an IP address already assigned in the second network and a second target IP address of the second terminal device; and The method further includes: Based at least on the response message, a first target IP address of the first terminal device is determined, wherein the first target IP address is different from the IP address already allocated in the first network, the IP address already allocated in the second network, and the second target IP address.

3. A communication method, characterized in that, The method is used for a second terminal device in a second network, wherein a first connection is established between the second terminal device and a first terminal device in a first network, and the method includes: A request message is received from the first terminal device through the first connection. The request message is used to request the establishment of a second connection with the second terminal device. The request message includes first quality information of multiple candidate channels. Based at least on the request message, a channel for communication between the first terminal device and the second terminal device is determined; The first terminal device receives a response message in response to the request message, the response message including second quality information of the plurality of candidate channels; The plurality of candidate channels includes a first channel for communication between the first terminal device and a third terminal device in the first network, and a second channel for communication between the second terminal device and a fourth terminal device in the second network; and One of the first channel and the second channel is determined as the channel for communication between the first terminal device and the second terminal device.

4. The method according to claim 3, characterized in that, The request message also includes an Internet Protocol (IP) address already assigned in the first network; and The method further includes: Based at least on the request message, a second target IP address of the second terminal device is determined. The response message also includes an IP address already allocated in the second network and the second target IP address, wherein the second target IP address is different from the IP address already allocated in the first network and the IP address already allocated in the second network.

5. A communication method, characterized in that, The method is used for a first terminal device in a first network, wherein a first connection is established between the first terminal device and a second terminal device in a second network, and the method includes: A request message is sent to the second terminal device through the first connection. The request message is used to request the establishment of a second connection with the second terminal device. The request message includes an Internet Protocol IP address that has been allocated in the first network. The second terminal device receives a response message in response to the request message, the response message including an IP address already assigned in the second network and a second target IP address of the second terminal device; and Based at least on the response message, a first target IP address of the first terminal device is determined, wherein the first target IP address is different from the IP address already allocated in the first network, the IP address already allocated in the second network, and the second target IP address.

6. The method according to claim 5, characterized in that, The request message also includes first quality information of multiple candidate channels, and the response message also includes second quality information of the multiple candidate channels; and The method further includes: Based at least on the response message, a channel for communication between the first terminal device and the second terminal device is determined.

7. The method according to claim 6, characterized in that, The plurality of candidate channels include a first channel for communication between the first terminal device and a third terminal device in the first network, and a second channel for communication between the second terminal device and a fourth terminal device in the second network. and The channel used for communication between the first terminal device and the second terminal device includes: One of the first channel and the second channel is determined as the channel for communication between the first terminal device and the second terminal device; or The third channel among the plurality of candidate channels is determined as the channel for communication between the first terminal device and the second terminal device, and the quality of the third channel is higher than that of the first channel and the second channel.

8. A communication method, characterized in that, The method is used for a second terminal device in a second network, wherein a first connection is established between the second terminal device and a first terminal device in a first network, and the method includes: A request message is received from the first terminal device through the first connection. The request message is used to request the establishment of a second connection with the second terminal device. The request message includes an Internet Protocol (IP) address that has been allocated in the first network. Based at least on the request message, determine the second target IP address of the second terminal device; The system receives a response message to the request message from the first terminal device. The response message includes an IP address already allocated in the second network and a second target IP address, wherein the second target IP address is different from the IP address already allocated in the first network and the IP address already allocated in the second network.

9. The method according to claim 8, characterized in that, The request message also includes first quality information of multiple candidate channels, and the response message also includes second quality information of the multiple candidate channels.

10. The method according to claim 9, characterized in that, The plurality of candidate channels include a first channel for communication between the first terminal device and a third terminal device in the first network, and a second channel for communication between the second terminal device and a fourth terminal device in the second network.

11. A communication device, characterized in that, The communication device includes: One or more processors; and Memory; The memory stores one or more computer programs, the one or more computer programs including instructions that, when executed by the communication device, cause the communication device to perform the method according to any one of claims 1-10.

12. A computer-readable storage medium storing instructions, characterized in that, When the instructions are executed on the communication device, the communication device performs the method according to any one of claims 1-10.

13. A chip including processing circuitry configured to perform the method according to any one of claims 1-10.