Equipment connection method and device
By displaying and scanning target information in electronic devices, the network role is automatically determined, which solves the problem of communication failure between devices in wireless direct communication and achieves smooth connection and communication between devices.
Patent Information
- Application Number
- CN202411026113.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-10-08
Smart Images

Figure CN118748849A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device connection method and apparatus. Background Art
[0002] In order to improve the convenience of interaction between two electronic devices, a direct connection can be established between the two electronic devices using direct communication technologies such as Wireless Fidelity (WiFi) Direct Connection, wherein the two devices that establish the direct connection are in a direct connection group.
[0003] After two or more electronic devices have established a direct connection group based on the direct connection communication technology, if the user wants a new electronic device to be able to communicate with the electronic devices in the direct connection group, the user needs to obtain the device information of the management end device in the direct connection group through the electronic device, so as to establish a direct communication connection with the management end device based on the device information of the management end device. However, in many cases, the user is not clear which electronic device in the direct connection group belongs to the management end device, and may not even be sure whether a certain electronic device has been added to the direct connection group. In this case, if the user wants the electronic device to establish a direct connection with another electronic device that is already in the direct connection group as a management end device, it will cause the direct connection between the electronic device and the other electronic device to fail to be established, making it impossible for the electronic device to communicate with the other electronic device based on the direct connection communication technology, resulting in high communication complexity. Summary of the invention
[0004] In one aspect, the present application provides a device connection method, applied to a first electronic device, comprising:
[0005] Obtaining a first indication, and displaying target display information, wherein the target display information includes: first information required to establish a first type of direct connection with the first electronic device, wherein the first type of direct connection is a point-to-point connection based on a first near field communication protocol;
[0006] In response to first connection information sent by a second electronic device, establishing the first type of direct connection with the second electronic device using the first electronic device as a network management end in the first type of direct connection, wherein the first connection information is generated by the second electronic device based on first information scanned from the target display information when the network device attribute of the second electronic device does not meet the target condition;
[0007] In response to second connection information sent by a second electronic device, establishing the first type of direct connection with a target electronic device using the first electronic device as a network client in the first type of direct connection, wherein the second connection information is generated by the second electronic device when its network device attribute meets the target condition;
[0008] Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
[0009] In a possible implementation, the second connection information includes: second information required to establish a first type of direct connection with the target electronic device;
[0010] Using the first electronic device as a network client in the first type of direct connection to establish the first type of direct connection with a target electronic device includes:
[0011] Based on the second information, the first electronic device is used as a network client in the first type of direct connection to establish the first type of direct connection with a target electronic device.
[0012] In another possible implementation, the target display information further includes: third information required to establish a second type of direct connection with the first electronic device, where the second type of direct connection is a point-to-point connection based on a second near field communication protocol;
[0013] The device connection method further includes:
[0014] In response to a target connection request of a second electronic device, establishing the second type of direct connection with the second electronic device, the target connection request being initiated by the second electronic device based on the third information scanned from the target display information when the network device attribute of the second electronic device meets the target condition;
[0015] Based on the second type of direct connection established with the second electronic device, second connection information sent by the second electronic device is obtained.
[0016] In another possible implementation, the second connection information further includes: identity conversion information, the identity conversion information being used to instruct the first electronic device to switch to a network client in the first type of direct connection;
[0017] Before the first electronic device is used as a network client in the first type of direct connection to establish the first type of direct connection with a target electronic device, the method further includes:
[0018] The configuration information of the first electronic device used to serve as the network management terminal in the first type of direct connection is cleared.
[0019] In yet another possible implementation, after obtaining the first indication, the method further includes:
[0020] Starting a communication function corresponding to the second near field communication protocol, and configuring the first electronic device as a network management terminal of the second near field communication protocol;
[0021] The responding to the target connection request of the second electronic device includes:
[0022] The method responds to a target connection request sent by the second electronic device as a network client of the second near field communication protocol.
[0023] In another aspect, the present application further provides a device connection method, applied to a second electronic device, comprising:
[0024] Obtaining a second indication, scanning target display information displayed by the first electronic device, the target display information including: first information required to establish a first type of direct connection with the first electronic device, the first type of direct connection being a point-to-point connection based on a first near field communication protocol;
[0025] If the network device attribute of the second electronic device meets the target condition, sending second connection information to the first electronic device, so that the first electronic device responds to the second connection information and establishes the first type of direct connection with the target electronic device using the first electronic device as a network client in the first type of direct connection;
[0026] Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
[0027] In a possible implementation, if the network device attribute of the second electronic device meets the target condition, sending the second connection information to the first electronic device includes:
[0028] If the network device attribute of the second electronic device meets the target condition, obtaining second information required to establish a first type of direct connection with the target electronic device;
[0029] Second connection information is sent to the first electronic device, where the second connection information includes the second information.
[0030] In another possible implementation, the target display information further includes: third information required to establish a second type of direct connection with the first electronic device, where the second type of direct connection is a point-to-point connection based on a second near field communication protocol;
[0031] Sending second connection information to the first electronic device includes:
[0032] Based on the third information, sending a target connection request to the first electronic device, where the target connection request is used to request to establish a second type of direct connection with the first electronic device;
[0033] Based on the second type of direct connection established with the first electronic device, second connection information is sent to the first electronic device.
[0034] In another aspect, the present application further provides a device connection apparatus, applied to a first electronic device, comprising:
[0035] an information display unit, configured to obtain a first indication and display target display information, wherein the target display information includes: first information required to establish a first type of direct connection with the first electronic device, wherein the first type of direct connection is a point-to-point connection based on a first near field communication protocol;
[0036] A first connection unit, configured to establish the first type of direct connection with the second electronic device in response to first connection information sent by the second electronic device, using the first electronic device as a network management end in the first type of direct connection, wherein the first connection information is generated by the second electronic device based on first information scanned from the target display information when the network device attribute of the second electronic device does not meet the target condition;
[0037] A second connection unit is used to establish the first type of direct connection with a target electronic device in response to second connection information sent by a second electronic device, using the first electronic device as a network client in the first type of direct connection, wherein the second connection information is generated by the second electronic device when its network device attributes meet the target conditions; wherein the network device attributes of the second electronic device meet the target conditions indicating that the first type of direct connection is established between the second electronic device and a third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
[0038] In another aspect, the present application further provides a device connection apparatus, applied to a second electronic device, comprising:
[0039] an information scanning unit, configured to obtain a second indication, scan target display information displayed by the first electronic device, the target display information comprising: first information required to establish a first type of direct connection with the first electronic device, the first type of direct connection being a point-to-point connection based on a first near field communication protocol;
[0040] a target sending unit, configured to send second connection information to the first electronic device if the network device attribute of the second electronic device meets the target condition, so that the first electronic device, as a network client in the first type of direct connection, establishes the first type of direct connection with the target electronic device;
[0041] Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0043] Figure 1 An example diagram of a process of the device connection method provided in the present application on the first electronic device side;
[0044] Figure 2 A flow chart of a device connection method provided in this application on the second electronic device side
[0045] Figure 3 A schematic diagram of a process interaction of the device connection method provided in this application;
[0046] Figure 4 This is an example diagram of an application scenario applicable to this application;
[0047] Figure 5 This is an example diagram of another application scenario applicable to this application;
[0048] Figure 6 A schematic diagram of another process interaction of the device connection method provided in this application;
[0049] Figure 7 A schematic diagram of a structure of a device connection device provided in this application;
[0050] Figure 8 A schematic diagram of a composition structure of another device connection device provided in the present application;
[0051] Fig. 9 A schematic diagram of the composition architecture of an electronic device provided in this application. DETAILED DESCRIPTION
[0052] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0053] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0054] The embodiment of the present application provides a device connection method. The device connection method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0055] Reference Figure 1 , Figure 1 This is a flow chart of a device connection method provided in an embodiment of the present application. The device connection method of this embodiment can be applied to a first electronic device, which can be a mobile phone, a tablet computer, or a laptop computer, etc., without limitation. Figure 1 As shown, a device connection method provided in an embodiment of the present application may include steps 101 to 103, and these steps are described in detail below.
[0056] S101, obtaining a first instruction and displaying target display information.
[0057] The first indication is used to request display of first information required for establishing a first type of direct connection with the first electronic device. Accordingly, the target display information displayed by the first electronic device may include: the first information required for establishing a first type of direct connection with the first electronic device.
[0058] In this application, direct connection refers to a point-to-point connection between two electronic devices without the need for other intermediate devices. Different types of direct connections are point-to-point connections based on different near field communication protocols (also known as short-range wireless communication protocols or short-range communication protocols, etc.).
[0059] For the sake of distinction, the direct connection established with the first electronic device based on the first indication or the first information in the target display information is referred to as a first type direct connection. The near field communication protocol based on which the first type direct connection is established is referred to as a first near field communication protocol.
[0060] For example, the first type of direct connection may be a WiFi direct connection established based on a wireless fidelity (WiFi) direct connection protocol. Of course, the first type of direct connection may also be a Bluetooth direct connection established based on a Bluetooth communication protocol, or other types of direct connections, which will not be described in detail here.
[0061] The first information may include one or more types of information. Depending on the specific protocol requirements for point-to-point connection in the first near-field communication protocol, the types of information required to be included in the first information may also vary, and there is no restriction on this. For example, the first information may include part or all of the device name of the first electronic device, the network name of the near-field communication network required to establish a first type of direct connection with the first electronic device, and the connection password.
[0062] In the present application, the specific form of the target display information may be in many possible forms. For example, the target display information may be a QR code or other barcode information, and there is no limitation on this.
[0063] In the present application, there may be many possible specific ways to obtain the first indication, which are not limited.
[0064] For ease of understanding, an implementation method is used as an example: selecting the "Add new device" option in the menu interface of the target application in the first electronic device, or selecting the "Add direct communication device" option in the target function interface of the first electronic device, etc., can trigger the first electronic device to obtain the first indication.
[0065] S102: In response to first connection information sent by the second electronic device, the first electronic device serves as a network management terminal in a first type of direct connection and establishes a first type of direct connection with the second electronic device.
[0066] The first connection information is generated by the second electronic device based on the first information scanned from the target display information when the network device attribute of the second electronic device does not meet the target condition.
[0067] Among them, the network device attribute of the second electronic device meets the target condition, which at least indicates that a first type of direct connection is established between the second electronic device and the third electronic device. Among them, the third electronic device is another electronic device other than the first electronic device and the second electronic device. It can be understood that before the second electronic device sends the first connection information, the first type of direct connection is not established between the first electronic device and the second electronic device. Based on this, it can be known that the network device attribute of the second electronic device does not meet the target condition, which indicates that the second electronic device has not established a first type of direct connection with other electronic devices.
[0068] The network device attribute of the second electronic device may include: the direct connection type corresponding to the direct connection established by the second electronic device, the identity attribute information of the first electronic device in the direct connection, and part or all of the information such as the network protocol supported by the second electronic device, without limitation. Based on this, it can be determined whether the second electronic device has established a first type of direct connection with other electronic devices based on the network device attribute of the second electronic device.
[0069] It is understandable that if a first type of direct connection is established between two electronic devices based on the first near field communication protocol, then the two electronic devices actually form a first type of direct connection group. In the first type of direct connection group, there is an electronic device that is a network management terminal, also known as the group manager (Group Owner, GO), and the electronic device that establishes a first type of direct connection with the network management terminal is a network client, also known as the group client (Group Client, GC). On this basis, other electronic devices can establish a first type of direct connection with the network management terminal as a network client to join the first type of direct connection group, but other electronic devices cannot directly establish a first type of direct connection with the electronic device that is a network client in the first type of direct connection group. Moreover, any electronic device in the direct connection group can no longer establish a first type of direct connection with other network management terminals outside the first type of direct connection group as a network client.
[0070] Based on this, it can be known that if the network device attribute of the second electronic device meets the target condition, it means that the second electronic device has established a first type of direct connection with other electronic devices. At this time, the second electronic device cannot establish a first type of direct connection with the first electronic device as a network client. However, if the network device attribute of the second electronic device does not meet the target condition, the second electronic device can still establish a first type of direct connection with the first electronic device as a network client. Therefore, the second electronic device can generate the first connection information based on the first information.
[0071] As can be seen from the previous introduction, the first information is the information required to establish a first type of direct connection with the first electronic device. Therefore, the second electronic device sending the first connection information based on the first information can indicate that the second electronic device needs to establish a first type of direct connection with the first electronic device. Since the first electronic device is the provider of the first information required to establish the first type of direct connection, the first electronic device can serve as the network management end of the first type of direct connection, and the second electronic device serves as the network client in the first type of direct connection established with the first electronic device.
[0072] For example, the first connection information sent by the second electronic device may specifically be a first connection request sent by the second electronic device, the first connection request being used to request to establish a first type of direct connection with the first electronic device as a network client, and the first connection request may include the first information. On this basis, the first electronic device responds to the first connection request, and upon confirming that the first information is legitimate information for establishing a first type of direct connection with the first electronic device, establishes a first type of direct connection with the second electronic device as a network management terminal.
[0073] It can be understood that when the network device attributes of the second electronic device do not meet the target conditions, the specific implementation of the process of the second electronic device sending the first connection information and the first electronic device establishing a first type of direct connection with the second electronic device can be similar to the specific implementation of establishing the first type of direct connection in the target first near-field communication protocol, and will not be repeated here.
[0074] S103: In response to the second connection information sent by the second electronic device, the first electronic device is used as a network client in the first type of direct connection to establish a first type of direct connection with the target electronic device.
[0075] The second connection information is generated by the second electronic device when the network device attribute of the second electronic device meets the target condition.
[0076] The target electronic device is an electronic device that serves as a network management end in the first type direct connection between the second electronic device and the third electronic device.
[0077] It is understandable that if the second electronic device and the third electronic device establish a first type of direct connection, then one of the second electronic device and the third electronic device must serve as a network management terminal, and the other electronic device serves as a network client. As previously described, only the electronic device that serves as a network management terminal can establish a first type of direct connection with multiple electronic devices. Based on this, when the network device of the second electronic device meets the target conditions, the first electronic device can only serve as a network client and establish a first type of direct connection with the network management terminal in the first type of direct connection group where the second electronic device is located, so that the first electronic device can also establish a first type of direct connection with the network management terminal in the first type of direct connection group to join the first type of direct connection group where the second electronic device and the third electronic device are located, and then the first electronic device can communicate with each electronic device in the first type of direct connection group with the help of the target electronic device.
[0078] From the above content, it can be seen that after the first electronic device displays the target display information including the first information required to establish a first type of direct connection with it, if the second electronic device scans and obtains the first information and the second electronic device has not established a first type of direct connection with other electronic devices, so that the second electronic device has the premise of establishing a first type of direct connection with the first electronic device as a network client, the first electronic device can respond to the first connection information sent by the second electronic device based on the first information, and establish a first type of direct connection with the second electronic device as a network management terminal; if the second electronic device has established a first type of direct connection with other electronic devices, then the first electronic device will act as a network client to establish a first type of direct connection with the network management terminal in the first type of direct connection where the second electronic device and the third electronic device are located, so that under different network device properties of the second electronic device, the first electronic device can be connected to the direct communication group where the second electronic device is located, so that the first electronic device can communicate with the second electronic device, and the user does not need to care about and understand the network device properties of the second electronic device, which greatly reduces the complexity of communication between electronic devices based on direct communication technology.
[0079] The device connection method of the present application is described below from the second electronic device side.
[0080] like Figure 2 , shows a schematic flow chart of a device connection method provided in an embodiment of the present application on the second electronic device side, and the method of this embodiment is applied to the second electronic device. The method of this embodiment may include S201 to S202.
[0081] S201, obtaining a second instruction, and scanning target display information displayed by a first electronic device.
[0082] The target display information includes: first information required to establish a first type of direct connection with the first electronic device, the first type of direct connection being a point-to-point connection based on a first near field communication protocol. The specific process of the first electronic device displaying the target display information is described above and will not be repeated here.
[0083] The second instruction is used to instruct the second electronic device to discover device information of the electronic device to which a direct connection needs to be established through scanning.
[0084] S202, if the network device attributes of the second electronic device meet the target conditions, send second connection information to the first electronic device, so that the first electronic device responds to the second connection information, uses the first electronic device as a network client in the first type of direct connection, and establishes a first type of direct connection with the target electronic device.
[0085] As mentioned above, the network device attribute of the second electronic device meets the target condition, indicating that a first type direct connection is established between the second electronic device and the third electronic device. The target electronic device is an electronic device that serves as a network management end in the first type direct connection between the second electronic device and the third electronic device.
[0086] It can be seen that after the second electronic device scans the target display information displayed by the first electronic device, if the second electronic device has established a first type of direct connection with other electronic devices, so that the second electronic device cannot establish a first type of direct connection with the first electronic device as a network client, then the second electronic device will send a second connection information to the first electronic device, so that the first electronic device can establish a first type of direct connection with the target electronic device that serves as a network management terminal among the second electronic device and the third electronic device based on the second connection information. Therefore, on the premise that the second electronic device has established a first type of direct connection with other electronic devices, the first electronic device can also be added to the first type of direct connection group where the second electronic device is located, thereby enabling the first electronic device to communicate with the second electronic device without the user caring about and understanding the network device attributes of the second electronic device, thereby reducing the complexity of communication based on direct communication technology.
[0087] It is understandable that in Figure 2 In an embodiment of the present invention, if the network device attributes of the second electronic device do not meet the target conditions, the second electronic device may also send first connection information to the first electronic device based on the first information, so that the first electronic device responds to the first connection information and establishes a first type of direct connection with the first electronic device, using the first electronic device as the network management end in the first type of direct connection.
[0088] For example, the first connection information may be a first connection request, and the first connection request is used to request to establish a first type of direct connection with the first electronic device as a network client. The first connection request may include the first information.
[0089] This part can be found in the previous Figure 1 The relevant introduction in the embodiments will not be repeated in detail.
[0090] It is understandable that there are many possible specific implementations of the first electronic device, as a network client in the first near field communication protocol, establishing the first type of direct connection with the target electronic device.
[0091] In a possible implementation, if the network device attribute of the second electronic device meets the target condition, the second electronic device may also obtain second information required to establish a first type of direct connection with the target electronic device, and send the second connection information to the first electronic device.
[0092] On this basis, the second connection information may include: second information required to establish a first type of direct connection with the target electronic device. Accordingly, the first electronic device may establish a first type of direct connection with the target electronic device based on the second information, using the first electronic device as a network client in the first type of direct connection.
[0093] The second information may include necessary information required to establish a first type of direct connection with the target electronic device, as well as some auxiliary information. The information category included in the second information may be similar to the information category included in the first information. For example, the second information may include part or all of the information such as the device name of the target electronic device, the network name of the near field communication network required to establish the first type of direct connection with the target electronic device, and the connection password.
[0094] There may be multiple possible specific implementations for the second electronic device to obtain the second information.
[0095] For example, if the second electronic device is the target electronic device, the second electronic device may directly determine the second information required to establish the first type of direct connection with itself.
[0096] For another example, if the target electronic device is a third electronic device, then on the premise that the second electronic device and the target electronic device have established a first type of direct connection, the second electronic device may cache the second information required to establish the first type of direct connection with the target electronic device.
[0097] Furthermore, considering that after the second electronic device establishes a first type of direct connection with the target electronic device, the target electronic device may also update its device name, network name or connection password and other information, therefore, in order to ensure the reliability of the first information and improve the success rate of establishing the first type of direct connection between the first electronic device and the target electronic device, the second electronic device can also obtain the second information required to establish the first type of direct connection with the target electronic device from the target electronic device based on the first type of direct connection between the second electronic device and the target electronic device.
[0098] It can be understood that in any of the above embodiments of the present application, there may be multiple possible implementations of the second electronic device sending the second connection information to the first electronic device, and the present application does not impose any limitation on this.
[0099] In a possible implementation, the target display information also includes: third information required to establish a second type of direct connection with the first electronic device. The second type of direct connection is a point-to-point connection based on a second near-field communication protocol. The second near-field communication protocol is different from the first near-field communication protocol. For example, if the first type of direct connection is a WiFi direct connection based on a wireless fidelity (WiFi) direct connection technology, then the second type of direct connection may be a Bluetooth direct connection based on a Bluetooth communication protocol.
[0100] In the present application, the third information may be information independent of the first information, or may include partial information belonging to the first information and partial information other than the first information.
[0101] For example, the third information required to establish a second type of direct connection with the first electronic device needs to include at least the device name of the first electronic device. If the first information already includes the device name of the first electronic device, the device name of the first electronic device in the first information can be determined as the third information.
[0102] For another example, in order to improve the security of communication based on the second type of direct connection, the third information needs to include not only the device name of the first electronic device, but also the direct communication key required to establish the second type of direct connection. On this basis, in order to reduce redundant information in the target display information, the device name of the first electronic device can be the device name of the first electronic device included in the first information, and the direct communication key required to establish the second type of direct connection is the newly added information in addition to the first information.
[0103] On this basis, the second electronic device can send a target connection request to the first electronic device based on the third information. It can be seen that the connection request is initiated by the second electronic device based on the third information scanned from the target display information when its network device attributes meet the target conditions. The target connection request is used to request to establish a second type of direct connection with the first electronic device.
[0104] Correspondingly, the first electronic device establishes a second type of direct connection with the second electronic device in response to the target connection request sent by the second electronic device. The second electronic device can send second connection information to the first electronic device based on the second type of direct connection established with the first electronic device, so that the first electronic device can obtain the second connection information based on the second type of direct connection.
[0105] For example, the target connection request may include third information, and the first electronic device verifies that the third information is legal information for establishing a second type of direct connection with the first electronic device, and then establishes a second type of direct connection with the second electronic device.
[0106] The following is an explanation based on a specific implementation. Figure 3 , which shows a schematic diagram of a process interaction of a device connection method provided by an embodiment of the present application, and this embodiment may include the following steps:
[0107] S301: A first electronic device obtains a first instruction and displays target display information.
[0108] The target display information includes: first information required to establish a first type of direct connection with the first electronic device and third information required to establish a second type of direct connection with the first electronic device.
[0109] The first type of direct connection is a point-to-point connection based on a first near field communication protocol, and the second type of direct connection is a point-to-point connection based on a second near field communication protocol.
[0110] S302: The second electronic device obtains a second instruction and scans target display information displayed by the first electronic device.
[0111] S303: If the network device attribute of the second electronic device does not meet the target condition, the second electronic device sends first connection information to the first electronic device based on the first information obtained from the target display information.
[0112] The fact that the network device attribute of the second electronic device does not satisfy the target condition indicates that the second electronic device has not established a first type of direct connection with the third electronic device.
[0113] In one implementation, the first connection information is a first connection request, the first connection request includes the first information, and the first connection request is used to request to establish a first type of direct connection with the first electronic device.
[0114] S304: In response to the first connection information, the first electronic device establishes a first type of direct connection with the second electronic device using the first electronic device as a network management end in a first type of direct connection.
[0115] S305: If the network device attribute of the second electronic device meets the target condition, obtain second information required to establish a first type of direct connection with the target electronic device.
[0116] The fact that the network device attribute of the second electronic device meets the target condition indicates that the second electronic device has established a first type direct connection with the third electronic device. The target electronic device is an electronic device that serves as a network management terminal in the first type direct connection between the second electronic device and the third electronic device.
[0117] It can be understood that the specific implementation method of obtaining the second information can refer to the previous related introduction, which will not be repeated here.
[0118] S306: The second electronic device sends a target connection request to the first electronic device based on the third information scanned from the target display information.
[0119] The target connection request is used to request to establish a second type of direct connection with the first electronic device.
[0120] It can be understood that the operation of the second electronic device obtaining the second information and the operation of sending the target connection request can be interchanged in sequence or performed simultaneously, and there is no limitation on this.
[0121] S307: In response to the target connection request, the first electronic device establishes a second type of direct connection with the second electronic device.
[0122] S308: The second electronic device sends second connection information to the first electronic device based on the second type of direct connection established with the first electronic device.
[0123] The second connection information includes second information required to establish a first type of direct connection with the target electronic device.
[0124] For example, the second connection information may be a second connection request, where the second connection request is used to instruct the first electronic device to establish a first type of direct connection with the target electronic device, and the second connection request includes the second information.
[0125] In one possible implementation, if the third information includes a communication key corresponding to the second type of direct connection, the present application can also use the communication key to encrypt the second connection information and send the encrypted second connection information to the first electronic device, and the first electronic device can decrypt the second connection information from the encrypted second connection information based on the communication key to obtain the second information included in the second connection information.
[0126] S309: The first electronic device establishes a first type of direct connection with the target electronic device based on the second information obtained from the second connection information, using the first electronic device as a network client in the first type of direct connection.
[0127] For ease of understanding, the first type of direct connection is a WiFi direct connection established based on the WiFi direct connection technology, and the second type of direct connection is a Bluetooth connection established based on the Bluetooth technology as an example, and two different application scenarios are introduced:
[0128] like Figure 4 , which is an example diagram of an application scenario applicable to this application.
[0129] Depend on Figure 4 The relationship between the electronic devices on the left side of the middle arrow shows that a WiFi direct connection is established between electronic device A and electronic device B. On this basis, electronic device A and electronic device B form a WiFi direct connection group. Among them, electronic device A serves as the network management end in WiFi direct connection, that is, as the GO; and electronic device B serves as the network client of WiFi direct connection, that is, as the GC.
[0130] On this basis, electronic device B can no longer establish a WiFi direct connection with other electronic devices, and although electronic device A as a network management terminal can establish a WiFi direct connection with other electronic devices, other electronic devices can only establish a WiFi direct connection with electronic device A as a network management terminal as network clients. It can be seen that if electronic device C wants to join the WiFi direct connection group, then electronic device C can only establish a WiFi direct connection with electronic device A based on the first information corresponding to electronic device A for establishing a WiFi direct connection.
[0131] However, the user may not understand the network device attributes of electronic device A and electronic device B, and cannot determine whether a WiFi direct connection is established between electronic device A and electronic device B, nor is it clear which electronic device is the GO in the WiFi direct connection group when electronic device A and electronic device B establish a WiFi direct connection. Therefore, if the user wants electronic device C to serve as the network management terminal in the WiFi direct connection and establish a WiFi direct connection with electronic device A or electronic device B, it will cause electronic device C to fail to successfully establish a WiFi direct connection with electronic device A or electronic device B, and naturally cannot effectively ensure that electronic device C communicates with electronic device A or electronic device B based on the WiFi direct connection technology.
[0132] By adopting the solution of the present application, without the user having to care about the network device properties of each electronic device, electronic device C can be placed in the same WiFi direct connection group as electronic device A and electronic device B, thereby enabling communication between electronic device A, electronic device B and electronic device C with the help of WiFi direct connection technology.
[0133] For the sake of ease of description, an example is taken in which an electronic device that serves as the network management end in WiFi direct connection displays the target display device in the form of a QR code. At the same time, it is assumed that the user wants electronic device B to scan the QR code displayed by electronic device C for establishing a WiFi direct connection, so that electronic device B and electronic device C can be in the same WiFi direct connection group.
[0134] In the present application, the QR code displayed by the electronic device C includes not only the WiFi connection information C (i.e., the first information, which may include the device name of the electronic device C, the network name and password of the WiFi direct connection network corresponding to the electronic device C, etc.) used to establish a WiFi direct connection with the electronic device C, but also the Bluetooth connection information (i.e., the third information, which may include the device name of the electronic device C and the Bluetooth key used for the Bluetooth connection, etc.) used to establish a Bluetooth connection with the electronic device C. Figure 4 As shown in the QR code information displayed in the electronic device C on the left side of the middle arrow.
[0135] On this basis, after the user uses electronic device B to scan the QR code displayed in electronic device C, electronic device B confirms that it has established a WiFi direct connection with electronic device A, then electronic device B will obtain WiFi direct connection information A (i.e., second information, such as the device name of electronic device A and the network name of the WiFi direct network corresponding to electronic device A) required for establishing a WiFi direct connection with electronic device A. In addition, electronic device B will also use the Bluetooth connection information (such as the name of electronic device C) identified from the QR code to establish a Bluetooth connection with electronic device C.
[0136] Electronic device B uses the Bluetooth key to encrypt the WiFi direct connection information A corresponding to electronic device A, and sends the encrypted WiFi direct connection information A to electronic device C through the Bluetooth connection between electronic device C. On this basis, after electronic device C uses the Bluetooth key to decrypt the WiFi direct connection information A, electronic device C will use the WiFi direct connection information A to establish a WiFi direct connection with electronic device A as a network client in the WiFi direct connection. Figure 4 As shown on the right side of the middle arrow, electronic device C finally establishes a WiFi direct connection with electronic device A, and electronic device C can communicate with electronic device B with the help of electronic device A.
[0137] It should be noted that the above Figure 4 In the introduction, the example of electronic device B scanning the target display information displayed by electronic device C is used for explanation, and on this basis, the target electronic device is electronic device A other than electronic device B. However, it can be understood that if the user uses electronic device A to scan the target display information presented by electronic device C, then the specific implementation process is similar, except that the target electronic device is electronic device A itself, and other processes are similar and will not be repeated.
[0138] Below Figure 5 The following scenario is used to illustrate this.
[0139] exist Figure 5 The relationship between the electronic devices on the left side of the middle arrow shows that electronic device B has not established a WiFi direct connection with electronic device A or any other electronic device. At this time, the QR code presented by electronic device C also includes WiFi connection information C for establishing a WiFi direct connection with electronic device C, and Bluetooth connection information for electronic device C to establish a Bluetooth connection.
[0140] On this basis, after electronic device B scans the QR code in electronic device C, electronic device B confirms that it has not established a WiFi direct connection with other electronic devices, and currently meets the conditions for establishing a WiFi direct connection with electronic device C. Then, based on the WiFi connection information C corresponding to the electronic device C obtained from the QR code, electronic device C can directly request to establish a WiFi direct connection with electronic device C as a network client in the WiFi direct connection. Figure 5 From the relationship between the electronic devices on the right side of the middle arrow, it can be seen that electronic device C can establish a WiFi direct connection with electronic device B as a network management terminal, so that electronic device B and electronic device C are in a WiFi direct connection group, and electronic device B can communicate directly with electronic device C.
[0141] It is understandable that in any of the above embodiments of the present application, after a first type of direct connection is established between two electronic devices or the two electronic devices are in the same first type of direct connection group, a business connection can also be established between the two electronic devices to achieve data transmission between the electronic devices through the business connection. On this basis, in order to improve the convenience of establishing business connections between electronic devices, the second connection information sent by the second electronic device to the first electronic device may include, in addition to the second information, the IP address of the second electronic device in the first type of direct connection group to which it is located. Among them, the first type of direct connection group to which the second electronic device is located is also the first type of direct connection group to which the second electronic device and the third electronic device belong.
[0142] On this basis, after the first electronic device establishes a first type of direct connection with the target electronic device, the first electronic device can establish a business connection between the first electronic device and the second electronic device based on the IP address of the second electronic device. For example, the first electronic device sends a business connection request to the target electronic device, and the business connection request includes the IP address of the second electronic device. For example, the business connection request is used to request the establishment of a websocket connection corresponding to the business connection. Accordingly, the target electronic device can establish a business connection between the first electronic device and the second electronic device in response to the business connection request.
[0143] For ease of understanding, combined Figure 4 Description, in Figure 4 When electronic device B sends WiFi connection information A corresponding to electronic device A to electronic device C, electronic device B can send its IP address in the WiFi direct connection group to electronic device C. On this basis, after electronic device C establishes WiFi direct connection with electronic device A, electronic device C can request electronic device A to establish a service connection for electronic device B and electronic device C based on the IP address of electronic device B. Figure 4 The dotted line between the electronic device B and the electronic device C in FIG. 1 may represent a service connection channel between the electronic device B and the electronic device C. As shown in FIG.
[0144] It is understandable that in any of the above embodiments, considering that in many cases, after the first electronic device obtains the first indication, the first electronic device will also confirm that it needs to serve as the network management terminal in the first type of direct connection, and therefore, the first electronic device will be configured with configuration information as the network management terminal in the first type of direct connection. For example, its identity in the first type of direct connection is configured as a network management terminal.
[0145] On this basis, if the network device attributes of the second electronic device meet the target conditions, after the second electronic device sends the second information corresponding to the target electronic device to the first electronic device, the first electronic device needs to convert its network device attributes so that the first electronic device can establish a first type of direct connection with the target electronic device as a network client.
[0146] In a possible implementation, the second connection information sent by the second electronic device to the first electronic device may also include: identity conversion information, the identity conversion information is used to instruct the first electronic device to switch to a network client in the first type of direct connection. Accordingly, before the first electronic device establishes a first type of direct connection with the target electronic device, the first electronic device may also clear the configuration information used in the first electronic device as a network management terminal in the first type of direct connection, so that the first electronic device can establish the first type of direct connection with the target electronic device as a network client.
[0147] It can be understood that when the second electronic device needs to establish a second type of direct connection based on the second near-field communication protocol with the first electronic device, in order to enable the first electronic device to promptly respond to the connection request of the second electronic device to establish a second type of direct connection with it, after the first electronic device obtains the first indication, the first electronic device can also start the communication function corresponding to the second near-field communication protocol and configure the first electronic device as the network management end of the second near-field communication protocol.
[0148] Correspondingly, the second electronic device will send a target connection request as a network client of the second near-field communication protocol, and the first electronic device will establish a second type of direct connection with the second electronic device in response to the target connection request sent by the second electronic device as a network client of the second near-field communication protocol.
[0149] For ease of understanding, a specific implementation is used as an example for explanation. Since the device attribute information of the second electronic device does not meet the target condition, it does not involve the second electronic device and the first electronic device to establish a second type of direct connection. The following only describes the case where the device attribute information of the second electronic device meets the target condition. Figure 6 , shows another flow chart of the device connection method provided in an embodiment of the present application. The method of this embodiment may include:
[0150] S601: The first electronic device obtains a first instruction, displays target display information, and configures the first electronic device as a network management terminal in a first type of direct connection.
[0151] The target display information includes: first information required to establish a first type of direct connection with the first electronic device and third information required to establish a second type of direct connection with the first electronic device.
[0152] The first type of direct connection is a point-to-point connection based on a first near field communication protocol, and the second type of direct connection is a point-to-point connection based on a second near field communication protocol.
[0153] S602: The first electronic device starts a communication function corresponding to the second near field communication protocol, and configures the first electronic device as a network management terminal of the second near field communication protocol.
[0154] For example, taking the second type of direct connection as a Bluetooth connection as an example, at the same time or after the first electronic device displays the target display information (including the second information establishing a Bluetooth connection with the first electronic device), the first electronic device can activate the Bluetooth function and configure itself as a Bluetooth server.
[0155] It is understandable that the order of step S602 and the operation of configuring the first electronic device as the network management end in the first type of direct connection can be interchanged or performed simultaneously, and there is no limitation on this.
[0156] S603: The second electronic device obtains a second instruction and scans target display information displayed by the first electronic device.
[0157] S604, if the second electronic device and the third electronic device have established a first type of direct connection, the second electronic device determines a target electronic device among the second electronic device and the third electronic device that serves as a network management end in the first type of direct connection, and obtains second information required to establish the first type of direct connection with the target electronic device.
[0158] It can be understood that the specific implementation method of obtaining the second information can refer to the previous related introduction, which will not be repeated here.
[0159] S605: The second electronic device sends a target connection request to the first electronic device based on the third information obtained from the target display information, with the second electronic device acting as a network client of the second near field communication protocol.
[0160] The target connection request is used to request to establish a second type direct connection with the first electronic device. For example, if the third information includes the device name of the first electronic device, the target connection request may be sent to the first electronic device based on the device name of the first electronic device.
[0161] The second electronic device as a network client of the second near field communication protocol actually acts as a network client in the second type of direct connection.
[0162] It can be understood that the operation of the second electronic device obtaining the second information and the operation of sending the target connection request can be interchanged in sequence or performed simultaneously, and there is no limitation on this.
[0163] S606: In response to the target connection request, the first electronic device establishes a second type of direct connection with the second electronic device.
[0164] In the second type of direct connection, the first electronic device is a network management terminal, and the second electronic device is a network client. For example, taking the second type of direct connection as a Bluetooth connection as an example, the first electronic device is a network service terminal, and the second electronic device is a network client.
[0165] S607: The second electronic device sends a second connection request to the first electronic device based on the second type of direct connection established with the first electronic device.
[0166] The second connection request is used to instruct the first electronic device to establish a first type direct connection with the target electronic device, and the second connection request includes the second information and identity conversion information, wherein the identity conversion information is used to instruct the first electronic device to switch to a network client in the first type direct connection.
[0167] In one possible implementation, if the third information also includes a communication key corresponding to the second type of direct connection, the present application can also use the communication key to encrypt the second information and send a second connection request, which includes the encrypted second information. Accordingly, the first electronic device needs to decrypt the encrypted second information to obtain the second information.
[0168] S608: The first electronic device clears configuration information used to serve as a network management terminal in the first type of direct connection in response to the identity conversion information based on the second information obtained from the second connection information and the identity conversion information.
[0169] S609: The first electronic device establishes a first type of direct connection with the target electronic device as a network client in the first type of direct connection based on the second information.
[0170] Corresponding to the operation of a device connection method provided in the present application on the first electronic device side, the present application also provides a device connection apparatus.
[0171] like Figure 7 , shows a schematic diagram of a structure of a device connection device provided in an embodiment of the present application, the device connection device is applied to a first electronic device, and the device connection device includes:
[0172] The information display unit 701 is used to obtain a first indication and display target display information, wherein the target display information includes: first information required to establish a first type of direct connection with the first electronic device, wherein the first type of direct connection is a point-to-point connection based on a first near field communication protocol;
[0173] A first connection unit 702 is configured to establish the first type of direct connection with the second electronic device in response to first connection information sent by the second electronic device, using the first electronic device as a network management end in the first type of direct connection, wherein the first connection information is generated by the second electronic device based on first information scanned from the target display information when its network device attribute does not meet the target condition;
[0174] The second connection unit 703 is used to establish the first type of direct connection with the target electronic device in response to the second connection information sent by the second electronic device, using the first electronic device as a network client in the first type of direct connection, and the second connection information is generated by the second electronic device when its network device attributes meet the target conditions; wherein the network device attributes of the second electronic device meet the target conditions indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
[0175] In a possible implementation, the second connection information obtained by the second connection unit includes: second information required to establish a first type of direct connection with the target electronic device;
[0176] The second connection unit is specifically used to, in response to second connection information sent by the second electronic device, establish the first type of direct connection with the target electronic device based on second information in the second connection information, using the first electronic device as a network client in the first type of direct connection.
[0177] In another possible implementation, the target display information displayed in the information display unit further includes: third information required to establish a second type of direct connection with the first electronic device, where the second type of direct connection is a point-to-point connection based on a second near field communication protocol;
[0178] The device connection device also includes:
[0179] A third connection unit, configured to establish the second type of direct connection with the second electronic device in response to a target connection request of the second electronic device, wherein the target connection request is initiated by the second electronic device based on the third information scanned from the target display information when the network device attribute of the second electronic device meets the target condition;
[0180] The information obtaining unit is configured to obtain second connection information sent by the second electronic device based on a second type of direct connection established with the second electronic device.
[0181] In another possible implementation, the second connection information obtained by the second connection unit further includes: identity conversion information, where the identity conversion information is used to instruct the first electronic device to switch to a network client in the first type of direct connection;
[0182] The device connection device also includes:
[0183] A configuration clearing unit is used to clear the configuration information of the first electronic device used as a network management terminal in the first type of direct connection before the second connection unit uses the first electronic device as a network client in the first type of direct connection to establish the first type of direct connection with the target electronic device.
[0184] In yet another possible implementation, the device connection apparatus further includes:
[0185] a function starting unit, configured to start a communication function corresponding to the second near field communication protocol and configure the first electronic device as a network management terminal of the second near field communication protocol after the information display unit obtains the first indication;
[0186] When responding to the target connection request of the second electronic device, the third connection unit is specifically used to respond to the target connection request sent by the second electronic device as a network client of the second near field communication protocol.
[0187] On the other hand, corresponding to the operation of a device connection method provided by the present application on the second electronic device side, the present application also provides another device connection apparatus.
[0188] like Figure 8 , shows a schematic diagram of the composition structure of another device connection device provided in an embodiment of the present application. The device connection device of this embodiment is applied to a second electronic device, including:
[0189] The information scanning unit 801 is used to obtain a second indication, scan the target display information displayed by the first electronic device, and the target display information includes: first information required to establish a first type of direct connection with the first electronic device, and the first type of direct connection is a point-to-point connection based on a first near field communication protocol;
[0190] The target sending unit 802 is used to send second connection information to the first electronic device if the network device attribute of the second electronic device meets the target condition, so that the first electronic device, as a network client in the first type of direct connection, establishes the first type of direct connection with the target electronic device;
[0191] Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
[0192] In yet another possible implementation, the device connection apparatus further includes:
[0193] An information sending unit is used to send first connection information to the first electronic device based on the first information if the network device attribute of the second electronic device does not meet the target condition, so that the first electronic device serves as the network management end in the first type of direct connection and establishes the first type of direct connection with the second electronic device.
[0194] In a possible implementation, the target sending unit includes:
[0195] An information obtaining subunit, configured to obtain second information required to establish a first type of direct connection with a target electronic device if the network device attribute of the second electronic device meets the target condition;
[0196] The first sending subunit is used to send second connection information to the first electronic device, where the second connection information includes the second information.
[0197] In another possible implementation, the target display information scanned and obtained by the information scanning unit further includes: third information required to establish a second type of direct connection with the first electronic device, where the second type of direct connection is a point-to-point connection based on a second near field communication protocol;
[0198] The target sending unit comprises:
[0199] a request sending subunit, configured to send a target connection request to the first electronic device based on the third information if the network device attribute of the second electronic device meets the target condition, wherein the target connection request is used to request to establish a second type of direct connection with the first electronic device;
[0200] The second sending subunit is configured to send second connection information to the first electronic device based on the second type of direct connection established with the first electronic device.
[0201] The present application also provides an electronic device. Fig. 9 , which shows a schematic diagram of a composition structure of the electronic device, and the electronic device at least includes a processor 901 and a memory 902;
[0202] The processor 901 is configured to execute the device connection method described in any one of the above embodiments;
[0203] The memory 902 is used to store the program required by the processor to perform operations
[0204] It can be understood that the electronic device may further include a display unit 903 and an input unit 904 .
[0205] Of course, the electronic device may also have Fig. 9 There may be more or fewer components, without limitation.
[0206] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any device connection method provided in the embodiment of the present application.
[0207] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any device connection method provided in the embodiment of the present application.
[0208] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0209] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0210] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0211] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A device connection method, applied to a first electronic device, comprising: Obtaining a first indication, and displaying target display information, wherein the target display information includes: first information required to establish a first type of direct connection with the first electronic device, wherein the first type of direct connection is a point-to-point connection based on a first near field communication protocol; In response to first connection information sent by a second electronic device, establishing the first type of direct connection with the second electronic device using the first electronic device as a network management end in the first type of direct connection, wherein the first connection information is generated by the second electronic device based on first information scanned from the target display information when the network device attribute of the second electronic device does not meet the target condition; In response to second connection information sent by a second electronic device, establishing the first type of direct connection with a target electronic device using the first electronic device as a network client in the first type of direct connection, wherein the second connection information is generated by the second electronic device when its network device attribute meets the target condition; Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
2. The device connection method according to claim 1, wherein the second connection information comprises: second information required to establish a first type of direct connection with a target electronic device; Using the first electronic device as a network client in the first type of direct connection to establish the first type of direct connection with a target electronic device includes: Based on the second information, the first electronic device is used as a network client in the first type of direct connection to establish the first type of direct connection with a target electronic device.
3. The device connection method according to claim 2, wherein the target display information further includes: third information required to establish a second type of direct connection with the first electronic device, where the second type of direct connection is a point-to-point connection based on a second near field communication protocol; The device connection method further includes: In response to a target connection request of a second electronic device, establishing the second type of direct connection with the second electronic device, the target connection request being initiated by the second electronic device based on the third information scanned from the target display information when the network device attribute of the second electronic device meets the target condition; Based on the second type of direct connection established with the second electronic device, second connection information sent by the second electronic device is obtained.
4. The device connection method according to claim 2 or 3, wherein the second connection information further comprises: Identity conversion information, the identity conversion information is used to instruct the first electronic device to switch to a network client in a first type of direct connection; Before the first electronic device is used as a network client in the first type of direct connection to establish the first type of direct connection with a target electronic device, the method further includes: The configuration information of the first electronic device used to serve as the network management terminal in the first type of direct connection is cleared.
5. The device connection method according to claim 3, after obtaining the first indication, further comprising: Starting a communication function corresponding to the second near field communication protocol, and configuring the first electronic device as a network management terminal of the second near field communication protocol; The responding to the target connection request of the second electronic device includes: The method responds to a target connection request sent by the second electronic device as a network client of the second near field communication protocol.
6. A device connection method, applied to a second electronic device, comprising: Obtaining a second indication, scanning target display information displayed by the first electronic device, the target display information including: first information required to establish a first type of direct connection with the first electronic device, the first type of direct connection being a point-to-point connection based on a first near field communication protocol; If the network device attribute of the second electronic device meets the target condition, sending second connection information to the first electronic device, so that the first electronic device responds to the second connection information and establishes the first type of direct connection with the target electronic device using the first electronic device as a network client in the first type of direct connection; Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
7. The device connection method according to claim 6, wherein if the network device attribute of the second electronic device meets the target condition, sending the second connection information to the first electronic device comprises: If the network device attribute of the second electronic device meets the target condition, obtaining second information required to establish a first type of direct connection with the target electronic device; Second connection information is sent to the first electronic device, where the second connection information includes the second information.
8. The device connection method according to claim 7, wherein the target display information further includes: third information required to establish a second type of direct connection with the first electronic device, where the second type of direct connection is a point-to-point connection based on a second near field communication protocol; Sending second connection information to the first electronic device includes: Based on the third information, sending a target connection request to the first electronic device, where the target connection request is used to request to establish a second type of direct connection with the first electronic device; Based on the second type of direct connection established with the first electronic device, second connection information is sent to the first electronic device.
9. A device connection apparatus, applied to a first electronic device, comprising: an information display unit, configured to obtain a first indication and display target display information, wherein the target display information includes: first information required to establish a first type of direct connection with the first electronic device, wherein the first type of direct connection is a point-to-point connection based on a first near field communication protocol; A first connection unit, configured to establish the first type of direct connection with the second electronic device in response to first connection information sent by the second electronic device, using the first electronic device as a network management end in the first type of direct connection, wherein the first connection information is generated by the second electronic device based on first information scanned from the target display information when the network device attribute of the second electronic device does not meet the target condition; A second connection unit is used to establish the first type of direct connection with a target electronic device in response to second connection information sent by a second electronic device, using the first electronic device as a network client in the first type of direct connection, wherein the second connection information is generated by the second electronic device when its network device attributes meet the target conditions; wherein the network device attributes of the second electronic device meet the target conditions indicating that the first type of direct connection is established between the second electronic device and a third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
10. A device connection apparatus, applied to a second electronic device, comprising: an information scanning unit, configured to obtain a second indication, scan target display information displayed by the first electronic device, the target display information comprising: first information required to establish a first type of direct connection with the first electronic device, the first type of direct connection being a point-to-point connection based on a first near field communication protocol; a target sending unit, configured to send second connection information to the first electronic device if the network device attribute of the second electronic device meets the target condition, so that the first electronic device, as a network client in the first type of direct connection, establishes the first type of direct connection with the target electronic device; Among them, the network device attribute of the second electronic device meets the target condition, indicating that the first type of direct connection is established between the second electronic device and the third electronic device, and the target electronic device is an electronic device that serves as a network management end in the first type of direct connection between the second electronic device and the third electronic device.
