Device networking method, medium, product, chip system and electronic device
By adjusting the negotiation parameters based on the device information of the P2P device, the problem that Wi-Fi P2P devices are not suitable for the device as GO in GO negotiation is solved, which improves the negotiation success rate and connection stability.
Patent Information
- Application Number
- CN202311831708.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-06-27
AI Technical Summary
During the GO negotiation process, existing Wi-Fi P2P devices are prone to problems such as unsuitable devices as GOs, causing disconnection, and equipment that is expected to become GOs do not negotiate to become GOs during negotiation.
By adjusting negotiation parameters, such as intent values, based on the device information of the counter P2P device, the device role is determined to ensure that the appropriate device is a GO and avoid disconnection of the connection.
Improves the success rate of GO negotiation and the success rate of Wi-Fi P2P connections, ensuring the stability of existing connections.
Smart Images

Figure CN120223780A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a device networking method, medium, product, chip system, and electronic device. Background Art
[0002] With the popularization of smart devices and the rapid development of the Internet of Things (IoT), there are more and more devices that support Wi-Fi peer to peer (P2P) (hereinafter referred to as P2P devices). For example, a user establishes a Wi-Fi P2P connection between a mobile phone that supports Wi-Fi P2P and a smart screen that supports Wi-Fi P2P. The mobile phone and the smart TV will form a Wi-Fi P2P group (group), and the audio and video data streams of the mobile phone can be pushed to the smart screen, thereby realizing the multi-screen interaction function.
[0003] The process of establishing a P2P group between P2P devices includes a group owner negotiation (GO negotiation) process. GO negotiation is used to determine the roles of P2P devices in the P2P group. Among them, the roles of the P2P group include GO and group client (GC). GO is similar to the access point (AP) in the basic service set (BSS), and GC is similar to the terminal device (station, STA) connected to the AP. GO can connect multiple GCs.
[0004] The GO negotiation process requires both P2P devices to exchange the group owner intent (hereinafter referred to as intent). Intent is usually a value from 0 to 15. The GO negotiation stipulates that the P2P device with a larger intent will be the GO, and the other P2P device will be the GC. However, since the intent of P2P devices is usually the default value, there will be a situation where the P2P device that expects to be the GO does not become the GO after GO negotiation, resulting in the failure of GO negotiation. Or the capabilities of the P2P device are not suitable to be the GO, and it is easy for the GO to go offline due to device failures, etc., causing the termination of the P2P group session. Summary of the Invention
[0005] In view of this, this application provides a device networking method, medium, product, chip system, and electronic device.
[0006] In a first aspect, a device networking method is provided, including: based on the device information of a second device, a first device sends first negotiation parameters for group owner negotiation to the second device. And based on the device information of a third device, the first device sends second negotiation parameters for group owner negotiation to the third device, where the first negotiation parameters and the second negotiation parameters are different.
[0007] In the above solution, the first device, the second device, and the third device may be P2P devices. For different P2P devices, that is, the second device and the third device, the first device will adopt different negotiation parameters according to the device information of the peer P2P device. For example, the device information may include device type, device power, operating system version, and / or connection status, etc., and the negotiation parameter may be an intent value.
[0008] Furthermore, the negotiation parameters of the P2P device are not fixed default values. The P2P device can adjust the negotiation parameters according to device information such as device type and / or connection status, and then initiate GO negotiation. According to the device information of the peer P2P device, it can be determined in advance whether the peer P2P device is suitable to be a GO, avoiding the problem that an unsuitable P2P device as a GO causes the Wi-Fi P2P connection to be easily disconnected. And the device information can also reflect whether the P2P device expects to be a GO. For example, devices such as computers, whose device capabilities can support the functions required to provide a GO. Furthermore, devices such as computers usually expect to be GO devices. Adjusting the negotiation parameters according to the device information can also reduce the situation where a P2P device that expects to be a GO fails to negotiate to be a GO in the GO negotiation. In summary, adjusting the negotiation parameters through the device information can improve the success rate of GO negotiation and also improve the success rate of Wi-Fi P2P connection.
[0009] Combined with the first aspect, in some implementation manners, the first negotiation parameter or the second negotiation parameter includes a group owner intent value.
[0010] In the above solution, the negotiation parameter may be an intent value, and the intent value may be any integer within 0 to 15. If it is determined according to the device information of the peer P2P device that the local P2P device needs to be a GO, the local P2P device can increase the intent value, for example, adjust it to 14. If it is determined according to the device information of the peer P2P device that the local P2P device needs to be a GC, the local P2P device can decrease the intent value, for example, adjust it to 0. Furthermore, it can ensure that the adjusted intent value can be successfully negotiated according to the corresponding role during the process of establishing a P2P connection with the peer P2P device.
[0011] Combined with the first aspect, in some implementation manners, the device information includes one or more of device type, connection status, and operating system version.
[0012] In the above solution, the device types of P2P devices include computers, display devices, network infrastructures, printers, game devices, etc. The local P2P device can determine whether the peer P2P device is externally powered, whether the device location is fixed, and / or whether the service mainly carried by the device requires a relatively low network latency based on the device type of the peer P2P device, and then determine the roles of the P2P groups corresponding to the local P2P device and the peer P2P device. The connection status of the P2P device can indicate whether the P2P device is currently connected to other P2P devices. The operating system version of the P2P device can reflect the efficiency of the P2P device in business processing, etc. Through the above device information, the P2P device can determine which device is more suitable to be the GO, or which device is more eager to become the GO. Furthermore, by adjusting the negotiation parameters based on the above device information, the success rate of GO negotiation can be improved, and the success rate of Wi-Fi P2P connection can also be improved.
[0013] In combination with the first aspect, in some implementation manners, the first device and the second device perform group owner negotiation based on the first negotiation parameter and the third negotiation parameter of the second device; and the first device and the third device perform group owner negotiation based on the second negotiation parameter and the fourth negotiation parameter of the third device.
[0014] In the above solution, to establish a connection between P2P devices, the two P2P devices need to exchange negotiation parameters. For example, the first device needs to send its first negotiation parameter to the second device, and the second device also needs to send its third negotiation parameter to the first device. Furthermore, the two P2P devices can know the negotiation parameters of the peer P2P device from each other, and finally determine the P2P group roles with consistent results.
[0015] In combination with the first aspect, in some implementation manners, the device type of the second device is a device connected to a power source or a device with a fixed location, the third negotiation parameter is greater than the first negotiation parameter, and the result of the group owner negotiation is that the first device is the group client and the second device is the group owner.
[0016] In the above solution, since GO is similar to AP and GO can connect to multiple GCs, the power consumption of GO is relatively high. When the peer P2P device is a device with an external power supply, it is determined that the peer P2P device is GO, which can ensure that the Wi-Fi P2P connection between GC and GO will not be disconnected due to power failure. If the peer P2P device is a device with a fixed position, for example, in a smart home or office scenario, a device with a fixed position is used as GO, which can ensure that other P2P devices can establish a Wi-Fi P2P connection with this P2P device for a long time, and the P2P group session will not be terminated due to the position movement of the P2P device acting as GO. In addition, when a P2P device with a fixed position acts as GO, relevant information of this P2P group can also be stored on this GO. When GC moves out of the range of the GO device due to position movement, as long as GC returns to the current scenario again, that is, when GC returns to the vicinity of GO again, GO can establish a connection with GC again according to the stored information of the last established connection. In summary, using a device connected to a power supply or a device with a fixed position as GO can avoid the problem that an inappropriate P2P device acting as GO easily causes the Wi-Fi P2P connection to be disconnected.
[0017] In combination with the first aspect, in some implementation manners, the second device is any one of a computer, a display device, a network infrastructure, and a printer.
[0018] In the above solution, when the peer P2P device is a device with an external power supply such as a computer, a display device, a network infrastructure, a printer or a device with a fixed position, it is determined that the peer P2P device is GO, which can avoid the problem that an inappropriate P2P device acting as GO easily causes the Wi-Fi P2P connection to be disconnected.
[0019] In combination with the first aspect, in some implementation manners, the device type of the second device is not a device connected to a power supply or not a device with a fixed position, the third negotiation parameter is less than the first negotiation parameter, and the group owner negotiation result is that the first device is the group owner and the second device is the group client.
[0020] In the above solution, if the peer P2P device is not a device with an external power supply such as a computer, a display device, a network infrastructure, a printer or a device with a fixed position, if it becomes GO, it is very easy for the P2P group session to be terminated due to insufficient device power or position movement. Furthermore, using a device that is not an external power supply or a device with a fixed position as GC can avoid the problem that an inappropriate P2P device acting as GO easily causes the Wi-Fi P2P connection to be disconnected.
[0021] In combination with the first aspect, in some implementation manners, the second device is a mobile phone.
[0022] In the above solution, a device that is not an external power supply or a device with a fixed position, such as a mobile phone, is likely to cause the termination of the P2P group session due to insufficient device power or position movement, and is more suitable as a GC.
[0023] Combined with the first aspect, in some implementation manners, a device corresponding to the group owner negotiation result being the first device is the group owner, and the second device, as the group owner, is pre-connected to a fourth device serving as a group client. The first device will send the group owner information of the first device to the fourth device through the second device, where the group owner information of the first device can be used by the fourth device to: disconnect the connection with the second device and connect to the first device as a group client.
[0024] In the above solution, if the first device and the second device need to establish a Wi-Fi P2P connection and the negotiation result is that the first device needs to act as the GO. However, if the second device has already been connected to other fourth devices as the GO, then both the second device and the fourth device need to act as GCs to connect to the new GO device, that is, the first device. Furthermore, the second device needs to forward the GO information of the first device to the fourth device to ensure that the fourth device can reconnect to the first device as a GC. Furthermore, it can ensure that the established Wi-Fi P2P connection can be re-established and ensure that communication can still be carried out between the second device and the fourth device.
[0025] Combined with the first aspect, in some implementation manners, the connection status of the second device indicates that the second device is the group owner, the first negotiation parameter is less than the third negotiation parameter, and the group owner negotiation result is that the first device is the group client and the second device is the group owner.
[0026] In the above solution, when the first device and the second device need to negotiate, if the second device has already been connected to other P2P devices as the GO device, then the second device still acts as the GO, and the first device connects to the second device in the role of a GC. Furthermore, it can ensure that the P2P devices already connected to the second device will not be disconnected and do not need to be re-established.
[0027] Combined with the first aspect, in some implementation manners, the connection status of the second device indicates that the second device is a group client and is connected to a fifth device serving as the group owner, the first negotiation parameter is greater than the third negotiation parameter, and the group owner negotiation result is that the first device is the group owner and the second device is the group client.
[0028] In the above solution, when the first device and the second device need to negotiate, if the second device has already been connected to other GO devices as a GC device, it means that the second device is more suitable as a GC device. Then the second device still acts as a GC, and the first device connects to the second device in the role of a GO. Furthermore, it can ensure that the second device establishes a connection with another role, which may cause problems with negotiation failure.
[0029] In combination with the first aspect, in some implementations, the connection state corresponding to the second device indicates that the second device is a group client and is connected to the fifth device that is the group owner, and the negotiation result of the group owner is that the first device is the group owner and the second device is the group client, and the first device notifies the second device to disconnect from the fifth device.
[0030] In the above solution, when the first device and the second device need to negotiate, if the second device has already been connected to the fifth device as a GC device and the negotiation result is that the second device is still a GC but is connected to the first device, then the second device also needs to disconnect from the fifth device in order to establish a connection with the new GO.
[0031] In combination with the first aspect, in some implementations, the method further includes: the first device sends first negotiation parameters for group owner negotiation to the second device based on the device information of the first device and the second device; the first device sends second negotiation parameters for group owner negotiation to the third device based on the device information of the first device and the third device.
[0032] In the above solution, the first device can determine the role of the P2P group based on the device information of the local P2P device and the peer P2P device, and then initiate negotiation with the peer P2P device. Furthermore, both the capabilities of the peer P2P device and the capabilities of the local P2P device are considered, so that the determined role result can improve the success rate of Wi-Fi P2P connection.
[0033] In combination with the first aspect, in some implementations, in the case where the first device fails to establish a P2P connection with the second device based on the first negotiation parameters, the first device sends fifth negotiation parameters for group owner negotiation to the second device.
[0034] In the above solution, if the local P2P device fails to establish a connection with the peer P2P device, the connection will be initiated again with the opposite role to improve the success rate of Wi-Fi P2P connection. For example, if the GO role was used to establish a connection with the peer P2P device last time and the connection failed, then the GC role will be used to establish a connection with the peer P2P device this time.
[0035] In combination with the first aspect, in some implementations, the first negotiation parameter is less than the third negotiation parameter, and the fifth negotiation parameter is greater than the third negotiation parameter; the first negotiation parameter is greater than the third negotiation parameter, and the fifth negotiation parameter is less than the third negotiation parameter.
[0036] In the above solution, if the GO device used when the last Wi-Fi P2P connection fails establishes a connection with the peer P2P device, that is, the intent value of the local P2P device is higher than that of the peer P2P device, then when re-negotiating, the GC device used will establish a connection with the peer P2P device, that is, the intent value of the local P2P device is lower than that of the peer P2P device. Furthermore, the Wi-Fi P2P connection success rate can be improved.
[0037] In combination with the first aspect, in some implementation manners, when the first device successfully establishes a P2P connection with the second device based on the first negotiation parameter, the first negotiation parameter or the P2P group role corresponding to the first negotiation parameter is stored, and the P2P group role includes a group client and a group owner.
[0038] In the above solution, if the Wi-Fi P2P connection is successful, the first device can also store the role corresponding to the successful connection this time. Furthermore, when establishing a connection with the second device next time, it can directly use the role of the successful connection this time for negotiation, which can improve the Wi-Fi P2P connection success rate. Also, the first device does not need to determine the role according to the device type of the second device again, which can improve the efficiency of the Wi-Fi P2P connection.
[0039] In a second aspect, the present application provides an electronic device, including a processor and a memory. The memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method described in the first aspect is executed.
[0040] In a third aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions run on an electronic device, the method described in the first aspect is executed.
[0041] In a fourth aspect, the present application provides a computer program product, which includes computer instructions. When executed by a computing device, the computing device executes the method described in the first aspect.
[0042] In a fifth aspect, the present application provides a chip system, including a processor and a memory. The memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method described in the first aspect is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for description in the embodiments will be briefly introduced below.
[0044] Figure 1A It is a schematic diagram of the topological structure of a 1:1 P2P group provided by an embodiment of the present application;
[0045] Figure 1B It is a schematic structural diagram of a 1:1 P2P group in an application scenario provided by an embodiment of the present application;
[0046] Figure 2A It is a schematic topological structure diagram of a 1:n P2P group provided by an embodiment of the present application;
[0047] Figure 2B It is a schematic structural diagram of a 1:n P2P group in an application scenario provided by an embodiment of the present application;
[0048] Figure 3 It is a schematic flowchart of a GO negotiation process provided by an embodiment of the present application;
[0049] Figure 4A It is a schematic flowchart of a device networking method provided by an embodiment of the present application;
[0050] Figure 4B It is a schematic flowchart of a device discovery method provided by an embodiment of the present application;
[0051] Figure 5 It is a schematic flowchart of another device networking method provided by an embodiment of the present application;
[0052] Figure 6 It is a schematic format diagram of storing a device role after a device establishes a connection successfully provided by an embodiment of the present application;
[0053] Figure 7 It is a schematic flowchart of yet another device networking method provided by an embodiment of the present application;
[0054] Figure 8 It is a schematic diagram of a method for establishing a Wi-Fi P2P connection when the peer P2P device is a GC provided by an embodiment of the present application;
[0055] Figure 9A It is a schematic diagram of a method for establishing a Wi-Fi P2P connection when the peer P2P device is a GO provided by an embodiment of the present application;
[0056] Figure 9B It is a schematic diagram of another method for establishing a Wi-Fi P2P connection when the peer P2P device is a GO provided by an embodiment of the present application;
[0057] Figure 10 It is a schematic flowchart of a device networking method when the peer P2P device is a GO provided by an embodiment of the present application;
[0058] Figure 11A It is a schematic structural diagram of a device networking apparatus provided by an embodiment of the present application;
[0059] Figure 11B is a schematic structural diagram of another device networking apparatus provided by an embodiment of the present application;
[0060] Figure 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specific embodiments
[0061] Illustrative embodiments of the present application include, but are not limited to, device networking methods, media, products, chip systems, and electronic devices.
[0062] Next, the application scenarios applicable to the device networking method provided by the present application will be introduced with reference to the accompanying drawings.
[0063] Figure 1A shows a situation where two P2P devices form a P2P group, that is, a situation where one GO is only connected to one GC, and this P2P group can be called a 1:1 P2P group. Exemplarily, as Figure 1B shown, a Wi-Fi P2P connection is established between the smart screen 10 and the mobile phone 20. The smart screen 10 is the GO, and the mobile phone 20 is the GC. The smart screen 10 and the mobile phone 20 can perform Wi-Fi P2P communication. For example, the user can send the data on the mobile phone 20 (such as images, videos, the interface of the mobile phone 20, etc.) to the smart screen 10, or send the data of the smart screen 10 to the mobile phone 10. Furthermore, the smart screen 10 and the mobile phone 20 can realize functions such as screen sharing and file sharing without passing through an AP.
[0064] Figure 2A shows a situation where more than two P2P devices form a P2P group, that is, a situation where one GO is connected to multiple GCs (GC1 and GC2), and this P2P group can be called a 1:n P2P group, where n is a positive integer greater than 1. Exemplarily, as Figure 2B shown, after the smart screen 10, as the GO, establishes a Wi-Fi P2P connection with the mobile phone 20, it also establishes a Wi-Fi P2P connection with a personal computer (PC) 30. Among them, the smart screen 10 is the GO, and the mobile phone 20 and the PC 30 are GCs. Furthermore, the user can send the data on the mobile phone 20 and / or the PC 30 to the smart screen 10, or send the data of the smart screen 10 to the mobile phone 10 and / or the PC 30.
[0065] It should be noted that with the rapid development of communication technologies and computer technologies such as 5G networks, IoT technologies, driverless cars, and virtual reality, there will be more and more scenarios where devices need to establish Wi-Fi P2P connections. The above Figure 1B and Figure 2BThe application scenarios are only for illustration, and this application does not limit the application scenarios.
[0066] To establish a Wi-Fi P2P connection between P2P devices and form a P2P group as shown in Figure 1A or Figure 2A it needs to go through stages such as discovery, formation, and invitation. Among them, the discovery stage can include operations such as scan, listen, and search, which are used for P2P devices and peer P2P devices to discover each other on the same channel. After a P2P device discovers a peer P2P device, it will enter the formation stage. The formation stage can conduct GO negotiation to determine the P2P devices acting as the GO and the GC. The invitation stage can establish a connection between P2P devices according to the determined GO and GC roles, that is, invite the peer P2P device to join the P2P group. This process includes the P2P device sending a P2P invitation request frame to the peer P2P device, and the peer P2P device replying with a P2P invitation response frame, etc.
[0067] Among them, the GO negotiation process requires the two P2P devices to exchange intents. The intent is usually a value from 0 to 15, and the larger this value, the greater the willingness of the P2P device to become the GO. The GO negotiation stipulates that the P2P device with a larger intent value acts as the GO, and the P2P device with a smaller intent value acts as the GC. In addition, the P2P devices can also exchange tie breakers. The tie breaker is usually 0 or 1. When the intent values of the two P2P devices are the same, the P2P device with a tie breaker of 1 will act as the GO device, and the other P2P device will act as the GC device.
[0068] Taking the smart screen 10 and the mobile phone 20 as an example, the process of GO negotiation after the smart screen 10 and the mobile phone 20 discover each other is illustrated. As Figure 3 shown, this process includes:
[0069] S310: The smart screen 10 sends a GO negotiation request frame (GO negotiation request) to the mobile phone 20.
[0070] The GO negotiation request frame includes the intent and tie breaker of the smart screen 10. The tie breaker is usually randomly set after the smart screen 10 is powered on.
[0071] It should be understood that other attribute information such as the P2P capability and P2P device info of the smart screen 10 may also be included in the GO negotiation request frame, which will not be elaborated one by one here.
[0072] S320: The mobile phone 20 replies to the smart screen 10 with a GO negotiation response.
[0073] The GO negotiation response frame includes a status code. When the mobile phone 20 agrees to establish a connection with the smart screen 10 based on the attribute information in the GO negotiation request frame, the mobile phone 20 can set the status code to "success". On the contrary, if the mobile phone 20 refuses to establish a connection with the smart screen 10, the mobile phone 20 can set the status code to "fail". If the status code is "fail", the negotiation fails and the process ends. If the status code is "success", step S330 will also be executed.
[0074] For example, the mobile phone 20 expects to be a GO, and the intent of the mobile phone 20 is 15. However, the intent of the smart screen 10 in the received GO negotiation request frame of the smart screen 10 is also 15. At this time, the mobile phone 20 will send a GO negotiation response frame with a status code of "fail: both P2P device GO negotiations indicate an intent of 15".
[0075] If the mobile phone 20 agrees to the GO negotiation request frame and sets the status code to "success", the GO negotiation response frame also includes the intent and tie breaker of the mobile phone 20. The tie breaker of the mobile phone 20 can be randomly set after power-on. In some embodiments, in order to avoid the tie breaker values of the smart screen 1 and the mobile phone 20 being the same, the mobile phone 20 will also set a value opposite to the tie breaker of the smart screen 10 as its own tie breaker according to the tie breaker of the smart screen 10.
[0076] Similarly, the GO negotiation response frame also includes attributes such as the P2P capability and P2P device info of the mobile phone 20, which will not be elaborated one by one here.
[0077] S330: The smart screen 10 sends a GO negotiation confirmation to the mobile phone 20.
[0078] The GO negotiation confirmation frame also includes a status code, which is confirmed by the smart screen 10 based on the GO negotiation response frame, indicating whether the smart screen 10 agrees to establish a connection with the mobile phone 20 based on the attribute information in the GO negotiation response frame. Specifically, reference can also be made to the relevant description of the status code in the foregoing step S320. If the status code in the GO negotiation confirmation frame is "success", the GO negotiation between the smart screen 10 and the mobile phone 20 is successful. On the contrary, if the status code in the GO negotiation confirmation frame is "fail", the GO negotiation between the smart screen 10 and the mobile phone 20 fails.
[0079] In summary, in the GO negotiation process, P2P devices mainly determine the GO and GC devices through the values of intent and tie breaker. And in actual applications, the intent is usually the default value set by the manufacturer of the P2P device. If the manufacturer of the P2P device or the application (APP) that needs to perform Wi-Fi P2P communication within the P2P device expects the P2P device to be the GO, but the value of the intent of the peer P2P device is larger, or the values of their intents are equal and the tie breaker of the peer P2P device is 1, according to the GO negotiation regulations, the peer P2P device is the GO, then the P2P device will reject the GO negotiation result, resulting in the failure of the GO negotiation. Furthermore, the P2P device cannot establish a Wi-Fi P2P connection, resulting in the inability to implement functions such as screen sharing and file sharing between P2P devices based on the Wi-Fi P2P connection.
[0080] Moreover, since the intent value of the P2P device is default, and the GO and GC are determined according to the default intent values of both parties. In some cases, for example, in the smart home scenario, the user expects to establish a P2P group of smart home devices such as the smart screen 10, the mobile phone 20, the PC 30, and the speaker. If the intent value of the mobile phone 20 is higher and the mobile phone 20 is used as the GO, the mobile phone 20 connects to the smart screen 10, the PC 30, and other smart home devices. When the mobile phone 20 leaves the current environment, it will cause the termination of the session of the current P2P group. Furthermore, the smart screen 10, the PC 30, and other smart home devices in the current environment will also be unable to continue Wi-Fi P2P communication.
[0081] Or, when the smart screen 10 and the mobile phone 20 have already established a connection, the smart screen 10 is the GO and the mobile phone 20 is the GC. At this time, when the smart screen 10 also needs to connect to the PC 30, since the intent value of the PC 30 is greater than the intent value of the smart screen 10, that is, the PC 30 needs to be the GO and the smart screen 10 needs to be the GC. Furthermore, it will cause the smart screen 10 to disconnect from the mobile phone 20 in order to be the GC and connect to the PC 30.
[0082] That is to say, according to the default intent value, the P2P device cannot establish a Wi-Fi P2P connection, or the established Wi-Fi P2P connection is extremely likely to be interrupted due to newly added P2P devices, resulting in the inability of communication between P2P devices.
[0083] To solve the problem that the P2P device cannot establish a Wi-Fi P2P connection or the Wi-Fi P2P connection is easily disconnected due to the above-mentioned GO negotiation result, the present application provides a device networking method. The P2P device will determine the role of the P2P device in the P2P group to be established or joined according to device information such as device type, device power, operating system version, and / or connection status, and adjust the value of its own intent according to the determined role, and initiate GO negotiation with the peer P2P device according to the adjusted intent value. For example, if it is determined that the peer P2P device is the GO, the value of its own intent is lowered, and then GO negotiation is initiated with the peer P2P device. If it is determined that the peer P2P device is the GC, the value of its own intent is raised, and then GO negotiation is initiated with the peer P2P device. Furthermore, the success rate of GO negotiation can be improved, and in the case where the P2P device has established a Wi-Fi P2P connection, it can ensure that the previously connected Wi-Fi P2P connection is not disconnected.
[0084] In some embodiments, the P2P device can determine its own role in the P2P group according to the device type of the peer P2P device. Among them, the device type of the peer P2P device can be determined based on the probe response frame replied by the peer P2P device during the process of the P2P device discovering the peer P2P device. For example, if it is determined according to the device type of the peer P2P device that the peer P2P device is usually a device with an external power supply and / or a device with a fixed position, it is determined that the peer P2P device is the GO, and the P2P device itself is the GC.
[0085] In other embodiments, the P2P device can also determine the role of the P2P group to be established according to its own current connection status. For example, if the P2P device has already been the GO and is connected to one or more GCs, when a new P2P device needs to perform GO negotiation with the P2P device that is already the GO, the P2P device that is already the GO will raise the value of its own intent to ensure that the connection with the GC will not be disconnected. Or, the P2P device will also obtain the connection status of the peer P2P device. If the peer P2P device has already been the GO and is connected to one or more GCs, the P2P device will also lower the value of its own intent to ensure that the peer P2P device does not need to disconnect the connection with the GC.
[0086] It should be understood that the P2P device can also determine the role of the P2P group according to other factors, such as the operating system version (OS version) of the P2P device, etc., which is not specifically limited in this application.
[0087] Furthermore, the intent value of the P2P device is not a fixed default value. The P2P device can adjust the intent value according to device information such as device type and / or connection status, and then initiate GO negotiation. According to the device information of the peer P2P device, it can be determined in advance whether the peer P2P device is suitable to be a GO, avoiding the problem that an unsuitable P2P device as a GO may cause the Wi-Fi P2P connection to be easily disconnected. Moreover, the device information can also reflect whether the P2P device expects to be a GO. For example, devices such as computers, whose device capabilities can handle the functions required by the GO, usually expect to be GO devices. Adjusting the intent according to the device information can also reduce the situation where a P2P device that expects to be a GO fails to be negotiated as a GO during GO negotiation. Determining the role of the P2P device according to the connection status can ensure that the currently established P2P connection is not disconnected. In summary, adjusting the intent value through device information can improve the success rate of GO negotiation and also improve the success rate of Wi-Fi P2P connection.
[0088] It can be understood that the P2P device and the peer P2P device in the embodiments of this application can be any devices with Wi-Fi P2P function, such as mobile phones, smart TVs, wearable devices, pads, computers with wireless transceiver functions, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city, wireless terminals in smart home, etc. The type of the P2P device is not limited in this application.
[0089] Next, an example is given to illustrate the correspondence between device information and the P2P group role. Among them, the device information can include one or more of information such as device type, device power, connection status, and operating system version.
[0090] First, the correspondence between device type and the P2P group role is introduced.
[0091] The device types of P2P devices include computers, display devices, network infrastructures, printers, game devices, etc. The P2P device can determine whether the peer P2P device is externally powered, whether the device location is fixed, and / or whether the service mainly carried by the device requires a relatively low network latency based on the device type of the peer P2P device, and then determine the roles of the P2P group corresponding to the P2P device and the peer P2P device.
[0092] For example, computers, display devices, and network infrastructures are P2P devices with external power supplies, P2P devices such as printers and computers are devices with fixed locations, and telephones and game devices are devices whose mainly carried services require relatively low network latency.
[0093] Among them, since the GO is similar to the AP in the BSS, the GO can connect multiple GCs, and thus the power consumption of the GO is relatively high. When the peer P2P device is a device with an external power supply such as a computer, a display device, or a network infrastructure, it is determined that the peer P2P device is the GO, which can ensure that the Wi-Fi P2P connection between the GC and the GO will not be disconnected due to power failure.
[0094] If the peer P2P device is a device with a fixed location, it is determined that the peer P2P device is the GO. Making the device with a fixed location as the GO in the smart home or office scenario can ensure that other P2P devices can establish Wi-Fi P2P connections with this P2P device for a long time, and will not cause the termination of the P2P group session due to the location movement of the P2P device acting as the GO, resulting in the inability of other GCs to perform Wi-Fi P2P communication. In addition, when the P2P device with a fixed location acts as the GO, relevant information of this P2P group can also be stored on the GO. When the GC moves out of the range of the GO device due to location movement, as long as the GC returns to the current scenario again, that is, when the GC returns to the vicinity of the GO again, the GO can establish a connection with the GC again according to the stored information of the previous connection establishment.
[0095] If the peer P2P device is a game device, the service it mainly carries has relatively high requirements for network latency. If the game device is used as the GO, the game device may also be responsible for the communication between GCs within the P2P group, the access of the GC to the wireless local area network (WLAN), etc., which will affect the game device's own service and cause a bad experience such as game lag for users. Therefore, if it is determined according to the device type that the service mainly carried by the peer P2P device requires relatively low network latency, it is determined that the peer P2P device acts as the GC.
[0096] It should be understood that this application exemplarily proposes the corresponding relationships between various device types and P2P group roles. In actual applications, different corresponding relationships between device types and P2P roles can also be formulated according to the current scenario, and this application does not make specific limitations in this regard.
[0097] The corresponding relationship between device power and P2P role is introduced below.
[0098] The device power can be parameters such as the rated power or maximum power of the P2P device. If the power of the peer P2P device is relatively high, then the peer P2P device can act as the GO. If the power of the peer P2P device is relatively low, then the peer P2P device can act as the GC.
[0099] The corresponding relationship between device connection status and P2P group role is introduced below.
[0100] If neither the P2P device nor the peer P2P device is connected to other P2P devices, the P2P device can determine the P2P group role according to other device information. For example, determine the P2P group role according to the device type.
[0101] If the peer P2P device has already connected to other P2P devices as the GO, then the peer P2P device will still act as the GO to ensure that other P2P devices will not disconnect from the peer P2P device acting as the GO.
[0102] If the peer P2P device has already connected to other P2P devices as the GC, the peer P2P device can disconnect the currently connected Wi-Fi P2P connection and determine the P2P group role according to the connection status of the P2P device itself or other device information. If the P2P device is not connected to other P2P devices, the P2P device itself can be determined as the GO, or the P2P group role can also be determined according to other device information. If the P2P device itself has connected to other P2P devices as the GO, the P2P device itself will still act as the GO. If the P2P device itself has connected to other P2P devices as the GC, the P2P device can also disconnect the currently connected Wi-Fi P2P connection and determine the P2P group role according to other device information.
[0103] Similarly, the P2P device can also determine the P2P group role only according to the connection status of the P2P device itself, and the rules for determining the P2P group role can also refer to the above description and will not be elaborated here.
[0104] The corresponding relationship between the operating system version and the P2P group role is introduced below. Among them, the P2P device with a higher operating system version will act as the GO, while the P2P device with a lower operating system version will act as the GC.
[0105] It should be understood that this application exemplarily proposes various corresponding relationships between device information and P2P group roles. In actual applications, different corresponding relationships between device information and P2P roles can also be formulated according to the current scenario, and this application does not make specific limitations in this regard.
[0106] In some embodiments, the P2P device can determine the P2P group role only based on the device information of the peer P2P device, and then set the P2P device itself to the role opposite to that of the peer P2P device.
[0107] In some other embodiments, the P2P device can determine the P2P group role only based on the device information of its own P2P device, and then set the peer P2P device itself to the role opposite to that of its own P2P device.
[0108] In some other embodiments, the P2P device can also determine the role of Device B based on the device information of its own P2P device and the device information of the peer P2P device. At this time, Device A can determine the role of the P2P group based on only one piece of device information, or can also determine the role of the P2P group by combining multiple pieces of device information. For example, when the P2P device combines multiple pieces of device information to determine the role of the P2P group, it can also determine the priority for different device information. The P2P device first determines the role of the P2P group based on the device information with a higher priority. If the P2P device and the peer P2P device are both the same for the device information with a higher priority, that is, it is determined based on the device information with a higher priority that both the P2P device and the peer P2P device are GO or GC, the P2P device will then determine the role of the P2P group through the device information with a lower priority until it can be determined that the P2P device and the peer P2P device are respectively different roles.
[0109] In some other embodiments, if the P2P device cannot determine the role of the P2P group based on one or more pieces of device information, for example, it is determined based on the corresponding relationship that both the P2P device and the peer P2P device are GO or GC, the P2P device can also not adjust the intent value and still negotiate according to the default intent value.
[0110] The following combines Figure 4A to introduce the device networking method provided by this application in detail. Among them, Figure 4A The shown method flow takes the example that Device A and Device B need to perform GO negotiation after discovering each other's devices. Device A and Device B can be any one of the foregoing P2P devices.
[0111] S410: Device A and Device B discover each other's peer P2P devices.
[0112] Device A and Device B can discover each other's devices on the same channel based on scanning, listening, and searching operations. Taking the discovery of Device B by Device A as an example, when Device A discovers Device B, it can obtain the device information of Device B. Specifically, Device A will send a probe request frame during the discovery phase. After receiving the probe request, Device B can reply with a probe response. The probe request and probe response can carry device information such as the primary device type and OS version of the device itself. The process of Device A and Device B discovering each other's devices will be described in detail below in conjunction with Figure 4B and will not be elaborated here for the time being.
[0113] The primary device type carries a category ID and a sub-category ID indicating the device type of Device B.
[0114] The following is an example of category and subcategory in the primary device type. Among them, different categories correspond to unique identification values (ID values). Each category can be further divided into multiple subcategories, and each subcategory also has a corresponding ID value. For example, when the ID value of the category in the probe response replied by device B is 1, it means that device B is a computer. According to the subcategory, device B can be further distinguished as a personal computer (PC), a server, a media center, an ultra-mobile PC, etc. When the ID value of the category is 3 and the ID value of the subcategory is 1, it means that device B is a printer. When the ID value of the category is 6, it means that device B is a network infrastructure, and the subcategories included are AP, router, switch, gateway, and bridge. When the ID value of the category is 7, it means that device B is a display device, and the subcategories included are television, electronic picture frame, or projector, etc. When the ID value of the category is 9, it means that device B is a gaming device, and the subcategories included are game consoles (such as playstation, xbox), etc. When the ID value of the category is 10, it means that device B is a telephone, and the subcategories included are single-mode smartphones, dual-mode smartphones, etc.
[0115] In some embodiments, during the discovery phase between device A and device B, other device information such as the device power and / or connection status of each device can also be sent to the other device. Among them, device information such as device power and / or connection status can be carried through custom fields in the probe request or probe response.
[0116] In some other embodiments, during the process that Device A and Device B discover each other, if they do not send device information such as their own device power and / or connection status, Device A can also send a request to Device B to obtain device information such as device power and / or connection status, so as to obtain the device power of Device B, or device information such as whether Device B is connected to other devices and the role of Device B in the joined P2P group.
[0117] S420: Device A determines the roles of Device A and / or Device B in the P2P group according to the device information of Device A and / or Device B.
[0118] Device A can determine the roles of Device A and / or Device B according to the corresponding relationship between the device information of Device A and / or Device B and the roles in the P2P group. For example, the device information can include one or more of information such as device type, device power, connection status, operating system version, etc. Among them, the corresponding relationship between the device information and the P2P group roles can refer to the previous description and will not be elaborated here.
[0119] S430: Device A adjusts the GO negotiation request frame according to the determined roles of Device A and / or Device B.
[0120] Device A will adjust the attribute information in the GO negotiation request frame sent to Device B according to the determined roles of Device A and / or Device B, such as the intent value and / or tie breaker.
[0121] For example, if Device A determines that Device B is the GO and Device A is the GC, then Device A will lower the pre-stored intent so that the intent value of Device A is less than the intent value of Device B. For example, the intent value is adjusted to 0. Device A can also adjust the intent value to other values, which is not limited in this application. The pre-stored intent value can be the default intent value of Device A or the intent value used in the previous negotiation with other devices.
[0122] If Device A determines that Device B is the GC and Device A is the GO, then the intent value of Device A will be increased so that the intent value of Device A is greater than the intent value of Device B. For example, the intent value is adjusted to 14. Among them, Device A can also adjust the intent value to other values, which is not limited in this application.
[0123] In some embodiments, the GO negotiation stipulates that when the intents of both P2P devices are 15, the negotiation will directly fail. To avoid the failure of the GO negotiation, the maximum intent value adjusted by Device A is 14.
[0124] In some other embodiments, to prevent the adjusted intent value of Device A from being the same as that of Device B, Device A can also adjust the tie breaker. For example, if Device A determines that Device B is the GO and Device A is the GC, it adjusts its own tie breaker to 0 to ensure that Device B can also be determined as the GO according to the GO negotiation rules when the intent values are the same. If Device A determines that Device B is the GC and Device A is the GO, it adjusts its own tie breaker to 1 to ensure that Device A can also be determined as the GO according to the GO negotiation rules when the intent values are the same.
[0125] It should be understood that the current standard stipulates that the P2P device with a higher intent value is the GO and the P2P device with a lower intent value is the GC. In some embodiments, if the roles of the P2P group are determined based on other attribute information in the GO negotiation request, Device A can also correspondingly adjust the corresponding attribute information. And in some other embodiments, if the P2P device with a lower intent value is the GO and the P2P device with a higher intent value is the GC, Device A can also adjust the intent value according to this rule, and the present application does not make specific restrictions on this.
[0126] S440: Device A initiates GO negotiation based on the adjusted GO negotiation request frame.
[0127] Device A sends a GO negotiation request frame to Device B according to the adjusted GO negotiation request. The process of GO negotiation between Device A and Device B can also refer to the foregoing description of Figure 3 and will not be elaborated here.
[0128] It should be understood that in some embodiments, based on the received GO negotiation request frame from Device A, Device B can also adjust its own intent value according to the device information of Device A and reply with a GO negotiation response frame according to the adjusted intent value. Among them, Device B can determine the device information of Device A according to the probe request frame and / or the GO negotiation request sent by Device A. Device B adjusts its own intent value according to the device information of Device A, which can also refer to the foregoing steps S420 and S430 and will not be elaborated here. Furthermore, it avoids the situation where the adjusted intent value of Device A is the same as the default intent of Device B, or compared with the default intent value of Device B, the GO negotiation result does not conform to the P2P group role determined by Device A in step S420.
[0129] In summary, for the device networking method provided in this application, the P2P device can adjust the GO negotiation request frame according to the device information and then initiate the GO negotiation. According to the device information of the peer P2P device, it can be determined in advance whether the peer P2P device is suitable to become the GO, avoiding the problem that an unsuitable P2P device as the GO causes the Wi-Fi P2P connection to be easily disconnected. Moreover, the device information can also reflect whether the P2P device expects to become the GO. Adjusting the intent according to the device type can also reduce the situation where the P2P device that expects to become the GO fails to negotiate to become the GO during the GO negotiation. In summary, adjusting the GO negotiation request frame through the device information can improve the success rate of the GO negotiation, also improve the success rate of the Wi-Fi P2P connection, and ensure that the currently established P2P connection is not disconnected.
[0130] The process of device A and device B mutually discovering the peer P2P device in step S410 above will be described in detail below. As Figure 4B shown, the process of this device discovery method includes:
[0131] S401: Device A receives a request to discover other P2Ps. This request can be initiated by an application (APP) in device A, a user, or a vendor related to device A, and this request is used to trigger device A to enter the stage of discovering other P2P devices.
[0132] S402: Device A scans for other P2P devices in the full frequency band. Device A sends probe request frames one by one on all channels. The current IEEE802.11 protocol stipulates that Wi-Fi mainly uses two frequency bands, 2.4G and 5G. Among them, the frequency range of 2.4G includes 2.4 megahertz (GHz) to 2.4835 GHz, and the frequency range of 5G includes 5.150 GHz to 5.825 GHz. Therefore, for device A to scan for other P2P devices in the full frequency band, it can specifically scan in the two frequency bands of 2.4G and 5G.
[0133] If device B is in the listening state at this time, device B will receive the probe request frame, and device B will respond to the probe request frame, then device A and device B will complete mutual discovery.
[0134] The following takes the example that device A does not discover device B during the scanning process for illustration.
[0135] S403: Device A performs a listening operation. Since device A does not scan other P2P devices, device A will perform a listening operation. For example, device A listens to channel 1 and waits to receive probe request frames sent by other P2P devices.
[0136] S404: Device B receives a request to discover other P2P devices. This request can be initiated by an APP in Device B, a user, or a vendor associated with Device B. This step S404 can be executed before step S401, after step S401, or synchronously with step S401. This application does not make specific limitations on this.
[0137] S405: Device B scans for other P2P devices across all frequency bands.
[0138] S406: Device B performs a listening operation. Similarly, in the case where Device B does not scan for other P2P devices, a listening operation will be performed.
[0139] S407: Device A performs a search operation. In the case where Device A does not hear a probe request frame, a search will be initiated. For example, Device A will perform a search operation one by one on channels 1, 6, and 11, that is, send probe requests sequentially on these three channels, as shown in steps S407-1, S407-2, and S407-3.
[0140] During this process, when Device B is in the state of performing a listening operation and the channel that Device B listens to is the same as the channel on which Device A sends a probe request, Device A and Device B can discover each other, and then Device B will execute step S408.
[0141] S408: Device B replies with a probe response frame. Exemplarily, taking the case where Device B listens to channel 6 as an example, based on Device B hearing the probe request frame sent by Device A on channel 6, Device B replies with a probe response frame. The probe response frame carries attribute information such as the primary device type and OS version of Device B. Then, Device A and Device B have completed mutual discovery.
[0142] It should be understood that when a P2P device does not search for other P2P devices, it will alternately perform listening and search operations. For example, Device A first performs a listening operation. In the case where it does not hear a probe request, it then performs a search operation one by one on channels 1, 6, and 11. If it does not receive a probe response sent by other P2P devices, it then performs a listening operation again, and so on in a cycle.
[0143] It should be noted that Figure 4B Only one process of P2P devices discovering each other is shown. It should be understood that in actual applications, this process can also have other situations. For example, when Device A is in the scanning stage, Device B is already in the search stage, and then Device A can also directly scan Device B, and then complete mutual discovery. This application does not limit the process of P2P devices discovering each other.
[0144] Some alternative embodiments of the device networking method provided by the present application will be described below.
[0145] In some embodiments, after P2P devices discover each other's P2P devices, they can also determine whether a Wi-Fi P2P connection has been established with the peer P2P device before. If a Wi-Fi P2P connection has been established with the peer P2P device before, the role of the P2P group when the Wi-Fi P2P connection was established before will also be obtained, and GO negotiation will be performed again according to the role when the Wi-Fi P2P connection was established at that time, which can improve the success rate of the current Wi-Fi P2P connection.
[0146] In some other embodiments, if the P2P device initiates GO negotiation to the peer P2P device based on the adjusted intent, but receives a rejection of the current GO negotiation request from the peer P2P device, the P2P device can also readjust the intent and initiate GO negotiation again. For example, when initiating GO negotiation last time, the intent was set to 14, indicating that itself expects to be the GO and the peer P2P device is the GC. After being rejected by the peer P2P device, the P2P device will adjust the intent to 0, indicating that itself expects to be the GC and the peer P2P device is the GO, and then initiate the GO negotiation request again. Thus, the success rate of GO negotiation can be improved.
[0147] Furthermore, an embodiment of the present application also provides a device networking method. As follows Figure 5 As shown, taking device A and device B determining the role of the P2P group according to the device type after discovering each other's devices as an example, device A and device B can be any one of the foregoing P2P devices. The method includes:
[0148] S501: Device A and device B discover each other's P2P devices.
[0149] Device A and device B can discover each other's devices on the same channel based on scanning, listening, and searching operations. The process of device A and device B discovering the peer P2P device can also refer to the above description about Figure 4B and will not be elaborated here.
[0150] S502: Device A determines whether a Wi-Fi P2P connection has been successfully established with device B before. If so, step S503 is executed. If not, step S505 is executed.
[0151] During the process of Device A discovering Device B, the unique identifier of Device B can be obtained, such as the media access control address (MAC address) of Device B. Furthermore, based on the unique identifier of Device B, Device A queries whether a Wi-Fi P2P connection has been established with Device B. If a Wi-Fi P2P connection has been established between Device A and Device B, Device A can obtain the roles of Device A and Device B when the connection was established.
[0152] It should be understood that the record of the connection established between Device A and Device B can be stored by Device A and / or Device B, or can also be stored by other third-party devices. When Device A needs to read the record of the previously established Wi-Fi P2P connection, it can obtain the record of the Wi-Fi P2P connection from the memory of Device A, the memory of Device B, or a third-party device. It should be understood that in practical applications, the roles of successfully established Wi-Fi P2P connections can be recorded, and the roles of unsuccessfully established Wi-Fi P2P connections can also be recorded. This application does not make specific restrictions on this. For the record of the connection established between Device A and Device B, please refer to the following step S509 for details.
[0153] S503: Device A adjusts the intent value according to the role at the last successful connection.
[0154] When Device A obtains that its role is the GO device when successfully connected to Device B, it will adjust the pre-stored intent value. For example, the intent value is adjusted to 14. The pre-stored intent value can be the default intent value of Device A or the intent value used in the previous negotiation with other devices. Conversely, if the role of Device A is the GC device, it will lower its own intent value. For example, the intent value is adjusted to 0. Among them, Device A can also adjust the intent value to other values, and this application does not make restrictions on this.
[0155] It should be understood that Device A and Device B may have established multiple Wi-Fi P2P connections. Device A can obtain only the role of Device A at the most recent successful connection, or can also obtain the role corresponding to the most successful number of Wi-Fi P2P connections established with Device B. This application does not make specific restrictions on this.
[0156] S504: Device A initiates GO negotiation based on the adjusted intent value.
[0157] Device A sends a GO negotiation request to Device B according to the adjusted intent. The process of GO negotiation between Device A and Device B can also refer to the previous description about Figure 3 and will not be elaborated here.
[0158] S505: Device A determines the role of Device A in the P2P group according to the device type of Device B.
[0159] When Device A and Device B have not successfully established a Wi-Fi P2P connection, or when Device A establishes a Wi-Fi P2P connection with Device B for the first time, or when Device A does not store a record of having established a Wi-Fi P2P connection with Device B, Device A will determine the role of Device A according to the device type. For details, reference can also be made to the foregoing step S420, which will not be elaborated here.
[0160] S506: Device A adjusts the intent value according to the determined role of Device A.
[0161] Device A will adjust the intent value according to the determined role of Device A and / or Device B, and then initiate a GO negotiation request to Device B. For details, reference can also be made to the foregoing step S440.
[0162] S507: Device A initiates GO negotiation based on the adjusted intent value.
[0163] Device A initiates a GO negotiation request to Device B according to the adjusted intent value. The process of GO negotiation between Device A and Device B can also be referred to the foregoing description about Figure 3 which will not be elaborated here.
[0164] S508: Device A determines whether it has successfully established a Wi-Fi P2P connection with Device B. If so, execute step S509; if not, execute step S510.
[0165] Device A can determine whether the negotiation with Device B is successful according to the GO negotiation response frame sent by Device B. When the status value in the GO protocol response frame is "success" and Device A also agrees to successfully form a P2P group with Device B based on the GO negotiation response frame, that is, when the status value of the GO negotiation confirmation frame sent by Device A is also "success", Device A determines that it has successfully established a Wi-Fi P2P connection with Device B.
[0166] In some embodiments, after successful negotiation between Device A and Device B, Device A will also send an invitation request frame to Device B, and Device B will reply with an invitation response frame. Additionally, Device A will send an association request frame to Device B, and Device B will reply with an association response frame. Moreover, Device A and Device B will complete a four-way handshake, etc. Only after completing the above steps can it be determined that a Wi-Fi P2P connection has been successfully established between Device A and Device B.
[0167] S509: When Device A records the success of this connection, it records the role of Device A and / or Device B.
[0168] If a Wi-Fi P2P connection is successfully established between Device A and Device B, Device A and / or Device B will also store the record of this connection establishment, or store the connection record on a third-party device.
[0169] For example, if Device A stores the record of successful connection establishment, Device A can record the role of Device A and / or Device B when the connection is successfully established. For instance, Figure 6 It shows a format in which Device A records the roles of Device A and Device B when the connection is successfully established. This record includes the MAC address of Device A (01-D3-6S-BA-EC-FA), the MAC address of Device B (10-D8-61-BE-ES-FE), and the role of Device A (such as group owner).
[0170] S510: Device A adjusts the intent to the value corresponding to the opposite role.
[0171] If a Wi-Fi P2P connection is not successfully established between Device A and Device B, Device A will also determine its role as the opposite role of step S503 or step S506, and adjust the intent to the intent value corresponding to this opposite role. For example, in step S506, the value of the intent is adjusted to 14. In the case of unsuccessful establishment of a Wi-Fi P2P connection, Device A determines itself as a GC and will lower the intent value, for example, adjust the intent value to 0. Conversely, if Device A first acts as a GC and initiates a GO negotiation with a higher intent value to Device B, in the case of unsuccessful establishment of a Wi-Fi P2P connection, Device A determines itself as a GO and will raise the intent value, for example, adjust the intent value to 14.
[0172] S511: Device A reinitiates a GO negotiation.
[0173] Device A initiates a GO negotiation request to device B again according to the adjusted intent value. The process of GO negotiation between device A and device B can also refer to the above description. Figure 3 The description is not repeated here.
[0174] In summary, in the device networking method provided by the present application, the P2P device can adjust the GO negotiation request frame according to the device information and then initiate the GO negotiation. This avoids the problem of unsuitable P2P devices being used as GOs, which causes the Wi-Fi P2P connection to be easily disconnected, and also reduces the situation where the P2P device that expects to become the GO fails to negotiate to become the GO during the GO negotiation. In summary, adjusting the GO negotiation request frame through device information can improve the success rate of GO negotiation, improve the success rate of Wi-Fi P2P connection, and ensure that the currently established P2P connection is not disconnected.
[0175] Another device networking method provided by the embodiment of the present application is described below by way of example. Specifically, when the role of the local P2P device is determined to be GO, the value of the intent of the local P2P device is adjusted to 14, and when the role of the local P2P device is determined to be GC, the value of the intent is adjusted to 0. This method can be executed by any of the aforementioned P2P devices, such as Figure 7 As shown, the method specifically includes:
[0176] S701: P2P scanning to find the peer P2P device.
[0177] The local P2P device can discover the peer P2P device on the same channel based on operations such as scanning, monitoring, and searching. The process of the local P2P device discovering the peer P2P device can also refer to the above Figure 4B The description is not repeated here.
[0178] S702: Determine whether a P2P group record is saved. If yes, execute step S703. If no, execute step S705.
[0179] After the local P2P device discovers the peer P2P device, it can query whether a Wi-Fi P2P connection has been established with the peer P2P device based on the unique identifier of the peer P2P device. If the local P2P device has established a Wi-Fi P2P connection with the peer P2P device, the local P2P device can obtain the role when the connection was established with the peer P2P device before, that is, the record of establishing a P2P group with the peer P2P device is saved.
[0180] S703: Obtain the P2P group role.
[0181] When the local P2P device obtains a successful connection with the peer P2P device, it will also obtain the role of the local P2P device and / or the peer P2P device in the P2P group.
[0182] S704: Set the intent corresponding to the role.
[0183] When the role of the local P2P device was the GO device when it previously successfully established a connection with the peer P2P device, the local P2P device will increase the pre-stored intent value, for example, adjust the intent value to 14. Conversely, if the role of the local P2P device was the GC device when it previously successfully established a connection with the peer P2P device, the local P2P device will decrease its own intent value, for example, adjust the intent value to 0.
[0184] S705: Obtain the peer P2P device type.
[0185] If the local P2P device and the peer P2P device have not successfully established a Wi-Fi P2P connection, or if the local P2P device is establishing a Wi-Fi P2P connection with the peer P2P device for the first time, the local P2P device will determine its role based on the device type of the peer P2P device. Specifically, reference can also be made to the aforementioned step S420, which will not be elaborated here.
[0186] S706: Determine whether the local side acts as the GO. If so, execute step S708. If not, execute step S707.
[0187] If it is determined that the local P2P device acts as the GO based on the device type of the peer P2P device, the intent value can be increased. Specifically, step S708 can be executed. If it is determined that the local P2P device acts as the GC based on the device type of the peer P2P device, the intent value can be decreased. Specifically, step S707 can be executed.
[0188] S707: Set the intent to 0.
[0189] The local P2P device will adjust its own intent value to 0 to ensure that the intent value of the local P2P device is relatively low and can be determined as the GC during the GO negotiation process with the peer P2P device.
[0190] S708: Set the intent to 14.
[0191] The local P2P device will adjust its own intent value to 14 to ensure that the intent value of the local P2P device is relatively high and can be determined as the GO during the GO negotiation process with the peer P2P device.
[0192] S709: Establish a Wi-Fi P2P connection.
[0193] The local P2P device initiates a GO negotiation request to the peer P2P device according to the adjusted intent value. The process of GO negotiation between the local P2P device and the peer P2P device can also refer to the foregoing description about Figure 3 , which will not be elaborated here.
[0194] S710: Whether Wi-Fi P2P creation is successful. If so, execute step S711.
[0195] The local P2P device can determine whether the negotiation with the peer P2P device is successful according to the GO negotiation response frame sent by the peer P2P device. For example, when the status value in the GO protocol response frame is "success" and the status value of the GO negotiation confirmation frame sent by the local P2P device is also "success", the local P2P device determines that a Wi-Fi P2P connection is successfully established with the peer P2P device. Or, after the local P2P device and the peer P2P device successfully negotiate, and the local P2P device and the peer P2P device also successfully complete operations such as invitation, association, and four-way handshake, it can be determined that a Wi-Fi P2P connection is successfully established between the local P2P device and the peer P2P device.
[0196] S711: Record the P2P group role.
[0197] If a Wi-Fi P2P connection is successfully established between the local P2P device and the peer P2P device, the local P2P device and / or the peer P2P device will also store the record of this connection establishment, or store the connection record on a third-party device. The format of the role of the local P2P device and the peer P2P device that successfully establish a connection can refer to Figure 6 and its related description.
[0198] In some embodiments, if a Wi-Fi P2P connection is not successfully established between the local P2P device and the peer P2P device, the local P2P device will also determine that the role of the local P2P device is the opposite role when establishing the Wi-Fi P2P connection in step S709, and adjust the intent to the intent value corresponding to the opposite role. The local P2P device initiates a GO negotiation request to the peer P2P device again according to the adjusted intent value.
[0199] In summary, for the device networking method provided in this application, the P2P device can adjust the GO negotiation request frame according to the device information and then initiate GO negotiation. This avoids the problem that an unsuitable P2P device acts as the GO, resulting in easy disconnection of the Wi-Fi P2P connection, and also reduces the situation where a P2P device expecting to be the GO fails to be negotiated as the GO during GO negotiation. In summary, adjusting the GO negotiation request frame based on the device information can improve the success rate of GO negotiation, also improve the success rate of Wi-Fi P2P connection, and ensure that the currently established P2P connection is not disconnected.
[0200] In some embodiments, when devices A and B do not determine the roles of the P2P group based on the connection status, but only based on device information such as device type, device power, or operating system version, if device B has already joined another P2P group, when device A needs to initiate a Wi-Fi P2P connection to device B, different operations need to be performed according to the role of device B in the other P2P group. Below, still taking devices A and B as examples, different situations will be described separately.
[0201] When device B forms a P2P group with other P2P devices as the GC, since the current protocol stipulates that a P2P device cannot establish a Wi-Fi P2P connection with other devices outside the current P2P group when it acts as the GC and has already established a connection with the GO. Therefore, device B needs to disconnect from device A first before device A can establish a new P2P group.
[0202] Exemplarily, Figure 8 The upper part of shows that device C is connected to devices B and D as the GO. If device A needs to establish a Wi-Fi P2P connection with device B, device B needs to disconnect from device C first. For example, when the user operates device C or device B to disconnect the previous connection between device B and device C, device A can discover device B based on the Figure 4B device discovery method shown.
[0203] Alternatively, device B can also disconnect from device C after device A discovers device B and before device A needs to perform GO negotiation with device B. For example, after devices A and B discover each other based on the Figure 4B device discovery method shown, device B automatically disconnects from device C to ensure that device B can establish a connection with device A.
[0204] Or, device B can also disconnect from device C after receiving the GO negotiation request sent by device A to ensure that device B can successfully negotiate and establish a connection with device A.
[0205] That is to say, the present application does not specifically limit the order of steps for device B to disconnect from device C.
[0206] Moreover, the manner in which device B and device C disconnect can be that device C / device B sends a deauthentication frame or a disassociation frame to the other party. The present application does not specifically limit the manner of disconnection between P2P devices.
[0207] After device B disconnects from device C, device A and device B can then perform GO negotiation. For details, reference can be made to the foregoing Figure 4A 、 Figure 5 or Figure 7 and its related descriptions. As shown in the lower half of Figure 8 , after device A and device B successfully negotiate, a new P2P group will be formed.
[0208] When device B acts as the GO and forms a P2P group with other P2P devices, as shown in the upper half of Figure 9A , device B, as the GO, connects to device C and device D. At this time, device A and device B need to establish a Wi-Fi P2P connection. If device A and device B go through the device discovery stage as shown in Figure 4B , and Figure 4A 、 Figure 5 or Figure 7 the GO negotiation stage as shown, and the GO negotiation result still indicates that device B is the GO device, then as shown in the lower half of Figure 9A , device A joins the P2P group where device B is located as the GC.
[0209] Conversely, if the GO negotiation result indicates that device A is the GO device, after device A and device B complete the GO negotiation, and before device A and device B enter the invitation stage and establish a Wi-Fi P2P connection, device B will also forward the information of device A to device C and device D, and notify device C and device D to connect to device A as the GC. That is, as shown in Figure 9B , device B to device D all connect to device A as the GC.
[0210] The following will describe the above Figure 10 scenario in detail in conjunction with Figure 9B . As shown in Figure 10 , the method includes:
[0211] S1001: Device A and device B complete GO negotiation.
[0212] After going through the device discovery as shown in Figure 4B , and Figure 4A 、Figure 5 Or Figure 7 After the GO negotiation phase shown above, the negotiation results of Device A and Device B after GO negotiation can be determined.
[0213] S1002: Device A determines that Device A is the GO.
[0214] If the GO negotiation results of Device A and Device B indicate that the intent value of Device A is higher, or if the intent values of both are the same but the tie breaker of Device A is 1, then it is determined that Device A is the GO.
[0215] After Device A determines itself as the GO, it will also set the working channel, network identifier (service set identifier, SSID), encryption method, network password, and other P2P group information for the upcoming P2P group.
[0216] S1003: Device A sends the P2P group information of Device A to Device B through an out-of-band channel.
[0217] Since Device A and Device B have not yet established a Wi-Fi P2P connection at this time, Device A will send the working channel, SSID, encryption method, network password, and other P2P group information to Device B through other communication methods, such as Bluetooth, so that Device B can forward this information to other devices in the P2P group with Device B as the GO.
[0218] S1004: Device B forwards the GO information of Device A to Device C and Device D.
[0219] Device B can directly forward the P2P group information of Device A to Device C and Device D through Wi-Fi P2P communication and notify Device C and Device D to connect to Device A.
[0220] S1005: Device B removes the P2P group with Device B as the GO.
[0221] Device B as the GO can terminate the session of the P2P group where Device B is located, and thus Device C and Device D can disconnect from Device B. Specifically, Device B can send a disconnection request to all GCs (Device C and Device D), such as a deauthentication frame or a disassociation frame.
[0222] S1006: Device B as the GC connects to Device A.
[0223] After Device B removes the P2P group with Device B as the GO, it can join the new P2P group. According to the GO negotiation results, Device B will connect to Device A as the GC. The operations in the invitation phase for Device B to connect to Device A are not elaborated here.
[0224] S1007: Device C / Device D acts as a GC to connect to Device A.
[0225] After disconnecting from Device B, Devices C and D can also join a new P2P group. According to the GO information of Device A forwarded by Device B, Devices C and D can act as GCs to connect to Device A. The operations in the invitation phase are also required for Devices C and D to connect to Device A, which will not be elaborated here.
[0226] In some embodiments, step S1006 and step S1007 can also be performed synchronously, or step S1007 can be executed first and then step S1006. This application does not impose specific restrictions on the execution order of step S1006 and step S1007.
[0227] It should be understood that the above Figures 8 to 10 is only illustrative with Devices A to D. In actual applications, there may also be more or fewer devices.
[0228] In summary, based on the above method, it can be ensured that the current P2P device can successfully establish a connection. Moreover, to ensure that the P2Ps in the dissolved P2P group can communicate, the P2P devices in the dissolved P2P group are also allowed to join a new P2P group. Furthermore, in the embodiments of this application, while improving the success rate of Wi-Fi P2P connections, it can also ensure that other P2P devices can continue to communicate.
[0229] To solve the problem that P2P devices cannot establish Wi-Fi P2P connections or Wi-Fi P2P connections are prone to disconnection due to the above-mentioned GO negotiation results, this application provides a device networking apparatus. This apparatus can be a chip system applied to P2P devices or other combined devices, components, etc. that can implement the above-mentioned P2P device functions, such as a memory and a processor. The chip system can be a single chip, a set of a chip and its circuits, multiple chips, or a set of multiple chips and their circuits. For example, the chip system can include a WIFI chip.
[0230] As Figure 11A shown, a schematic structural diagram of a device networking apparatus 1100 is shown, including a P2P role negotiation module 1110, a storage module 1120, and a P2P group establishment module 1130.
[0231] The P2P role negotiation module 1110 can be used for a P2P device to negotiate with a peer P2P device for a GO when it needs to establish a connection with the peer P2P device. Specifically, it includes: obtaining the role used when successfully establishing a connection with the peer P2P device from the storage module 1120, adjusting the intent value based on this role, and initiating a connection to the peer P2P device. If there is no record of the role used when successfully establishing a connection with the peer P2P device in the storage module 1120, then determine the role according to device information such as device type, device power, operating system version, and / or connection status, and adjust the value of its own intent according to the determined role, and initiate a GO negotiation to the peer P2P device according to the adjusted intent value. The specific process can also refer to the aforementioned steps S410 to S440.
[0232] The storage module 1120 is used to store the roles of the local P2P device and / or the peer P2P device after the local P2P device successfully establishes a connection with other P2P devices, so that when establishing a connection with the same P2P device next time, the stored role type can be directly used to initiate negotiation. Specifically, it can also refer to Figure 6 and its related descriptions.
[0233] The P2P group building module 1130 is used to negotiate and establish a P2P group with the peer P2P device according to the role determined by the P2P role negotiation module 1110, including processes such as invitation, association, and four-way handshake.
[0234] As Figure 11B shown, a schematic structural diagram of another device networking device 1200 is shown. The device networking device 1200 is applied to the first device and includes: a sending unit 1210, a negotiation module 1220, and a storage module 1230.
[0235] The sending unit 1210 is used to send first negotiation parameters for group owner negotiation to the second device based on the device information of the second device. The sending unit 1210 is also used to send second negotiation parameters for group owner negotiation to the third device based on the device information of the third device, where the first negotiation parameters and the second negotiation parameters are different
[0236] In some embodiments, the first negotiation parameter or the second negotiation parameter includes a group owner intent value.
[0237] In other embodiments, the device information includes one or more of device type, connection status, and operating system version.
[0238] In some other embodiments, the negotiation module 1220 is configured to perform group owner negotiation with a second device based on a first negotiation parameter and a third negotiation parameter of the second device; and the negotiation module 1220 is further configured to perform group owner negotiation with a third device based on a second negotiation parameter and a fourth negotiation parameter of the third device.
[0239] In some other embodiments, the device type of the second device is a device connected to a power source or a device with a fixed location, the third negotiation parameter is greater than the first negotiation parameter, and the group owner negotiation result is that the first device is a group client and the second device is the group owner.
[0240] In some other embodiments, the second device is any one of a computer, a display device, a network infrastructure, and a printer.
[0241] In some other embodiments, the device type of the second device is not a device connected to a power source or not a device with a fixed location, the third negotiation parameter is less than the first negotiation parameter, and the group owner negotiation result is that the first device is the group owner and the second device is a group client.
[0242] In some other embodiments, the second device is a mobile phone.
[0243] In some other embodiments, corresponding to the group owner negotiation result that the first device is the group owner, and the second device is pre-connected with a fourth device as a group client as the group owner, the sending unit 1210 is further configured to send the group owner information of the first device to the fourth device through the second device, where the group owner information of the first device can be used by the fourth device to: disconnect the connection with the second device and connect to the first device as a group client.
[0244] In some other embodiments, the connection status of the second device indicates that the second device is the group owner, the first negotiation parameter is less than the third negotiation parameter, and the group owner negotiation result is that the first device is a group client and the second device is the group owner.
[0245] In some other embodiments, the connection status of the second device indicates that the second device is a group client and is connected to a fifth device as the group owner, the first negotiation parameter is greater than the third negotiation parameter, and the group owner negotiation result is that the first device is the group owner and the second device is a group client.
[0246] In some other embodiments, corresponding to the connection status of the second device indicating that the second device is a group client and is connected to a fifth device as the group owner, and the group owner negotiation result is that the first device is the group owner and the second device is a group client, the first device notifies the second device to disconnect the connection with the fifth device.
[0247] In some other embodiments, the first device sends first negotiation parameters for group owner negotiation to the second device based on the device information of the first device and the second device; the first device sends second negotiation parameters for group owner negotiation to the third device based on the device information of the first device and the third device.
[0248] In some other embodiments, when the first device fails to establish a P2P connection with the second device based on the first negotiation parameters, the sending unit 1210 is further configured to send fifth negotiation parameters for group owner negotiation to the second device.
[0249] In some other embodiments, the first negotiation parameters are less than the third negotiation parameters, and the fifth negotiation parameters are greater than the third negotiation parameters; the first negotiation parameters are greater than the third negotiation parameters, and the fifth negotiation parameters are less than the third negotiation parameters.
[0250] In some other embodiments, the storage module 1230 is configured to store the first negotiation parameters or the P2P group roles corresponding to the first negotiation parameters when the first device successfully establishes a P2P connection with the second device based on the first negotiation parameters, and the P2P group roles include a group client and a group owner.
[0251] In summary, for the device networking apparatus provided in this application, the P2P device can adjust the GO negotiation request frame according to the device information and then initiate GO negotiation. This avoids the problem that an inappropriate P2P device serves as the GO, resulting in easy disconnection of the Wi-Fi P2P connection, and also reduces the situation where a P2P device expecting to be the GO fails to be negotiated as the GO during GO negotiation. In conclusion, adjusting the GO negotiation request frame through the device information can improve the success rate of GO negotiation, also improve the success rate of Wi-Fi P2P connection, and ensure that the currently established P2P connection is not disconnected.
[0252] Next, in conjunction with Figure 12 An exemplary structural diagram of the P2P device 100 involved in the embodiments of this application is introduced. The P2P device 100 may be the aforementioned P2P device, such as device A to device D, and specifically may also be the smart screen 10, the mobile phone 20, and the PC 30.
[0253] See Figure 12, the P2P device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, etc.
[0254] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the P2P device 100. In other embodiments of the present application, the P2P device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0255] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0256] Among them, the controller may be the nerve center and command center of the P2P device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0257] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0258] In some embodiments of the present application, the processor 110 may be used to determine the role of the P2P group based on the device information of the P2P device 100 and / or the peer device. For specific reference, please refer to the foregoing Figure 4A , Figure 5 and Figure 7 related descriptions.
[0259] In some embodiments, the processor 110 may include one or more interfaces. It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the P2P device 100. In other embodiments of the present application, the P2P device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0260] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc.
[0261] The wireless communication function of the P2P device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, etc.
[0262] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the P2P device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0263] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the P2P device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves through the antenna 1 and radiate it out. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.
[0264] The modulation and demodulation processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.
[0265] The wireless communication module 160 can provide solutions for wireless communications such as UWB, wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the P2P device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves through the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be transmitted from the processor 110, frequency-modulate and amplify it, and convert it into electromagnetic waves through the antenna 2 and radiate it out.
[0266] In some embodiments of the present application, the P2P device 100 can perform GO negotiation with other devices based on the wireless communication module 160 to establish a Wi-Fi P2P connection.
[0267] In some embodiments, the antenna 1 of the P2P device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, such that the P2P device 100 can communicate with the network and other devices through wireless communication technologies. The 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 technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).
[0268] The P2P device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change the display information.
[0269] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the P2P device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0270] The P2P device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, etc. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. In some embodiments, the P2P device 100 may include one or N cameras 193, where N is a positive integer greater than 1. The video codec is used to compress or decompress digital videos.
[0271] The external memory interface 120 can be used to connect to an external memory card, such as a Micro SD card, to expand the storage capacity of the P2P device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0272] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the P2P device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area.
[0273] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.
[0274] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. The P2P device 100 can receive key inputs and generate key signal inputs related to the user settings and function controls of the P2P device 100.
[0275] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts or touch vibration feedback.
[0276] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, etc.
[0277] The SIM card interface 195 is used to connect to a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the P2P device 100.
[0278] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc.
[0279] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware with a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as read only memory (ROM) or random access memory (RAM), magnetic disks, or optical discs.
Claims
1. A device networking method, characterized in that, The method includes: Based on the device information of the second device, the first device sends a first negotiation parameter for group owner negotiation to the second device; Based on the device information of the third device, the first device sends a second negotiation parameter for group owner negotiation to the third device, where the first negotiation parameter and the second negotiation parameter are different.
2. The method according to claim 1, characterized in that, The first negotiation parameter or the second negotiation parameter includes a group owner intention value.
3. The method according to claim 1, wherein The device information includes one or more of device type, connection status, and operating system version.
4. The method according to claim 3, characterized in that, It further includes: The first device and the second device perform group owner negotiation based on the first negotiation parameter and the third negotiation parameter of the second device; And, The first device and the third device perform group owner negotiation based on the second negotiation parameter and the fourth negotiation parameter of the third device.
5. The method according to claim 4, wherein The device type of the second device is a device connected to a power source or a device with a fixed position, the third negotiation parameter is greater than the first negotiation parameter, and the group owner negotiation result is that the first device is a group client and the second device is a group owner.
6. The method according to claim 5, wherein The second device is any one of a computer, a display device, a network infrastructure, and a printer.
7. The method according to claim 4, wherein The device type of the second device is not a device connected to a power source or not a device with a fixed position, the third negotiation parameter is less than the first negotiation parameter, and the group owner negotiation result is that the first device is a group owner and the second device is a group client.
8. The method according to claim 7, wherein The second device is a mobile phone.
9. The method according to claim 7, characterized in that, It further includes: Corresponding to the group owner negotiation result that the first device is the group owner, and the second device is pre-connected to a fourth device as the group client as the group owner, the first device will send the group owner information of the first device to the fourth device through the second device, where the group owner information of the first device can be used by the fourth device to: disconnect the connection with the second device and connect to the first device as the group client.
10. The method according to claim 4, wherein The connection status of the second device indicates that the second device is the group owner, the first negotiation parameter is less than the third negotiation parameter, and the group owner negotiation result is that the first device is a group client and the second device is a group owner.
11. The method according to claim 4, wherein The connection status of the second device indicates that the second device is a group client and is connected to a fifth device as the group owner, the first negotiation parameter is greater than the third negotiation parameter, and the group owner negotiation result is that the first device is a group owner and the second device is a group client.
12. The method according to claim 11, wherein The method further includes: The connection status corresponding to the second device indicates that the second device is a group client and is connected to the fifth device that is the group owner, and the negotiation result of the group owner is that the first device is the group owner and the second device is the group client. The first device notifies the second device to disconnect from the fifth device.
13. The method according to claim 1, characterized in that Based on the device information of the second device, the first device sends a first negotiation parameter for group owner negotiation to the second device, including: Based on the device information of the first device and the second device, the first device sends a first negotiation parameter for group owner negotiation to the second device; Based on the device information of the third device, the first device sends a second negotiation parameter for group owner negotiation to the third device, including: Based on the device information of the first device and the third device, the first device sends a second negotiation parameter for group owner negotiation to the third device.
14. The method according to claim 4, wherein The method further includes: In the case where the first device fails to establish a P2P connection with the second device based on the first negotiation parameter, the first device sends a fifth negotiation parameter for group owner negotiation to the second device.
15. The method according to claim 14, wherein the first negotiation parameter is less than the third negotiation parameter, and the fifth negotiation parameter is greater than the third negotiation parameter; the first negotiation parameter is greater than the third negotiation parameter, and the fifth negotiation parameter is less than the third negotiation parameter.
16. The method according to claim 1, wherein The method further includes: In the case where the first device successfully establishes a P2P connection with the second device based on the first negotiation parameter, store the first negotiation parameter or the P2P group role corresponding to the first negotiation parameter, and the P2P group role includes a group client and a group owner.
17. An electronic device, characterized in that, Comprising a processor and a memory, the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method according to any one of claims 1 to 16 is executed.
18. A computer-readable storage medium, characterized in that, Comprising instructions, when the instructions run on an electronic device, the electronic device executes the method according to any one of claims 1 to 16.
19. A computer program product, characterized in that, The computer program product includes computer instructions, and when executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 16.
20. A chip system, characterized in that, Comprising: Comprising a processor and a memory, the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method according to any one of claims 1 to 16 is executed.