Network connection method and device, electronic equipment and readable storage medium
By searching and connecting to mutual aid devices in electronic devices, the connection problem caused by insufficient network signal strength of the routing device is solved, and the stable connection and improved user experience of the device are achieved.
Patent Information
- Application Number
- CN202311788104.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
The network signal strength of the electronic device received by the routing device is low, resulting in the inability to connect to the wireless network stably or frequently disconnected, affecting the network connection experience.
By implementing the function of searching for mutual aid devices in the device to be connected, when the device does not meet the connection conditions, it is searched and connected to the mutual aid device connected to the network through the routing device to achieve a stable connection.
Improve the networking experience of the devices to be connected, ensure that the devices can be continuously and stably connected to the wireless network, and improve the user experience.
Smart Images

Figure CN120201583A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things technology, and in particular, to a method for connecting a network, a connection device, an electronic device, and a readable storage medium. Background Art
[0002] In the related art, an electronic device is connected to a wireless network through a routing device, so that the electronic device can access the wireless network. However, in the actual use process, due to the location of the electronic device or the configuration problem of the electronic device itself, the network signal sent by the routing device received by the electronic device may be weak, resulting in the situation that the electronic device cannot effectively connect to the wireless network of the routing device or frequently drops the line. Furthermore, the networking experience of the electronic device is poor. Summary of the Invention
[0003] This application aims to solve at least one of the technical problems existing in the prior art.
[0004] To this end, a first aspect of this application provides a method for connecting a network.
[0005] A second aspect of this application provides a method for connecting a network.
[0006] A third aspect of this application provides a connection device for a network.
[0007] A fourth aspect of this application provides a connection device for a network.
[0008] A fifth aspect of this application provides an electronic device.
[0009] A sixth aspect of this application provides a computer-readable storage medium.
[0010] A seventh aspect of this application provides a computer program product.
[0011] A first aspect of this application provides a method for connecting a network, which is executed by a device to be connected. The connection method includes: sending a first connection request for a first network to a routing device; receiving first response information corresponding to the first connection request sent by the routing device; determining connection conditions for the first network according to the first response information; in the case that the device to be connected does not meet the connection conditions for the first network, searching for at least one mutual assistance device, where the mutual assistance device is connected to the first network through the routing device; connecting to the first network through at least one mutual assistance device.
[0012] The network connection method provided by this application can be used to connect a device to be connected to a first network, so as to enable the device to be connected to implement an Internet access function through the first network.
[0013] Specifically, first, control the device to be connected to send a first connection request for the first network to the routing device. Herein, the first network may be the network to which the routing device is connected. Controlling the device to be connected to send a first connection request for the first network means sending a first connection request to the routing device to request the device to be connected to the routing device, so as to enable the device to be connected to the first network through the routing device, thereby realizing that the device to be connected accesses the first network through the routing device.
[0014] Further, after receiving the first connection request from the device to be connected, the routing device may send a first response message to the device to be connected. Further, the device to be connected receives the first response message sent by the routing device and determines whether the device to be connected meets the connection condition of the first network according to the first response message sent by the routing device. Specifically, the connection condition of the first network may be whether the intensity of the network signal of the routing device received by the device to be connected is greater than a preset intensity. It can be understood that if the intensity of the network signal of the routing device that the device to be connected can receive is relatively high, it means that the device to be connected can stably connect to the routing device, so that it can stably and continuously access the first network. If the intensity of the network signal of the routing device that the device to be connected can receive is relatively low, it will cause the device to be connected unable to connect to the routing device or frequently disconnect. The preset intensity of the network signal may be set to -55 dBm.
[0015] Further, when the device to be connected does not meet the connection condition of the first network, search for at least one mutual assistance device. Herein, the mutual assistance device is connected to the first network, that is, the mutual assistance device is connected to the routing device of the first network, so as to realize connecting to the first network through the routing device. Specifically, the mutual assistance device may be household appliances that can realize the Internet access function, such as a television, an air conditioner, a refrigerator, etc.
[0016] Further, after searching for the mutual assistance device, the device to be connected may be connected to the mutual assistance device, so as to realize connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network.
[0017] The network connection method provided by this application, when the device to be connected does not meet the connection condition of the first network, searches for at least one mutual assistance device connected to the first network, so that the device to be connected can be connected to the mutual assistance device, so as to realize connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. Thus, it solves the problem that when the intensity of the network signal of the routing device received by the device to be connected is relatively low and it is impossible to ensure continuous and stable connection to the first network through the routing device, realizes continuous and stable connection to the first network through the mutual assistance device, improves the network connection experience of the device to be connected, and further improves the user experience of using the device to be connected.
[0018] According to a second aspect of the present application, a method for connecting a network is provided, which is executed by a mutual assistance device. The mutual assistance device is connected to a first network through a routing device. The connection method includes: in the case of receiving a connection request from a device to be connected, generating and sending response information according to the connection request, where the response information is used for the device to be connected to determine the mutual assistance device that needs to be connected; in the case of receiving a key negotiation request from the device to be connected, performing key negotiation with the device to be connected to generate a key; and establishing a network connection with the device to be connected according to the key.
[0019] In the method for connecting a network provided by the present application, in the case where the mutual assistance device receives a connection request from the device to be connected, the mutual assistance device can generate and send response information according to the connection request. The response information is sent to the device to be connected for the device to be connected to determine the mutual assistance device that needs to be connected according to the response information.
[0020] It can be understood that the connection request sent by the device to be connected may be sent to multiple mutual assistance devices simultaneously. Each mutual assistance device will send response information for the connection request of the device to be connected. The device to be connected can determine the mutual assistance device that needs to be connected according to the response information received from multiple mutual assistance devices.
[0021] Further, after the device to be connected determines the mutual assistance device that needs to be connected, it will send a key negotiation request to the mutual assistance device. After the mutual assistance device and the device to be connected perform key negotiation, a key can be generated. Finally, the mutual assistance device can establish a network connection with the device to be connected according to the generated key.
[0022] In the method for connecting a network provided by the present application, in the case where the device to be connected does not meet the connection conditions of the first network, the device to be connected can be connected to the mutual assistance device, so as to realize connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low and it is impossible to ensure a continuous and stable connection to the first network through the routing device. Through the mutual assistance device, a continuous and stable connection to the first network is realized, improving the networking experience of the device to be connected, and further improving the user experience of using the device to be connected.
[0023] According to the third aspect of the present application, a connection device for a network is provided for a device to be connected. The connection device includes: a sending unit configured to send a first connection request for a first network to a routing device; a receiving unit configured to receive first response information corresponding to the first connection request sent by the routing device; a determining unit configured to determine connection conditions for the first network according to the first response information; a searching unit configured to search for at least one mutual assistance device when the device to be connected does not meet the connection conditions for the first network, wherein the mutual assistance device is connected to the first network through the routing device; and a connecting unit configured to connect to the first network through the at least one mutual assistance device.
[0024] The connection device for a network provided by the present application, when the device to be connected does not meet the connection conditions for the first network, searches for at least one mutual assistance device connected to the first network, so that the device to be connected can be connected to the mutual assistance device, thereby realizing connecting the device to be connected to the first network through the mutual assistance device, enabling the device to be connected to implement an Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low and it is impossible to ensure a continuous and stable connection to the first network through the routing device. By using the mutual assistance device, a continuous and stable connection to the first network is achieved, improving the networking experience of the device to be connected, and further improving the user experience of using the device to be connected.
[0025] According to the fourth aspect of the present application, a connection device for a network is provided for a mutual assistance device. The mutual assistance device is connected to the first network through a routing device. The connection device includes: a response unit configured to generate and send response information according to a connection request when receiving the connection request from the device to be connected, wherein the response information is used for the device to be connected to determine the mutual assistance device to be connected; a negotiation unit configured to perform key negotiation with the device to be connected and generate a key when receiving a key negotiation request from the device to be connected; and a connecting unit configured to establish a network connection with the device to be connected according to the key.
[0026] The connection device for a network provided by the present application, when the device to be connected does not meet the connection conditions for the first network, can connect the device to be connected to the mutual assistance device, thereby realizing connecting the device to be connected to the first network through the mutual assistance device, enabling the device to be connected to implement an Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low and it is impossible to ensure a continuous and stable connection to the first network through the routing device. By using the mutual assistance device, a continuous and stable connection to the first network is achieved, improving the networking experience of the device to be connected, and further improving the user experience of using the device to be connected.
[0027] According to a fifth aspect of the present application, an electronic device is provided, including: a processor and a memory, where the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, the steps of the network connection method provided in the first aspect and / or the second aspect are implemented.
[0028] The electronic device provided in the present application includes a memory and a processor, and also includes a program or instructions stored on the memory. When the program or instructions are executed by the processor, the steps of the network connection method in the above-mentioned first aspect and / or the second aspect can be implemented. Therefore, the electronic device has all the beneficial effects of the above-mentioned network connection method, which will not be elaborated here.
[0029] According to a sixth aspect of the present application, a computer-readable storage medium is provided, on which a program or instructions are stored, and when the program or instructions are executed by the processor, the steps of the network connection method provided in the first aspect and / or the second aspect are implemented.
[0030] The computer-readable storage medium provided in the present application stores a program or instructions. Since the program or instructions can implement the steps of the network connection method provided in the first aspect and / or the second aspect when executed by the processor, the computer-readable storage medium has all the beneficial effects of the above-mentioned network connection method, which will not be elaborated here.
[0031] According to a seventh aspect of the present application, a computer program product is provided, including a computer program or instructions, and when the computer program or instructions are executed by the processor, the steps of the network connection method provided in the first aspect and / or the second aspect are implemented.
[0032] The computer program product provided in the present application includes a computer program or instructions. When the computer program or instructions are executed by the processor, the steps of the network connection method provided in the first aspect and / or the second aspect are implemented. Therefore, the computer program product has all the beneficial effects of the above-mentioned network connection method, which will not be elaborated here.
[0033] The additional aspects and advantages of the present application will become apparent in the following description section or be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The above-mentioned and / or additional aspects and advantages of the present application will become apparent and be easily understood from the description of the embodiments in conjunction with the following drawings, where:
[0035] Figure 1 FIG. 1 shows one of the schematic flowcharts of the network connection method provided according to an embodiment of the present application;
[0036] Figure 2 FIG. 2 shows another schematic flowchart of the network connection method provided according to an embodiment of the present application;
[0037] Figure 3 Shows one of the structural block diagrams of a connection device of a network provided according to an embodiment of the present application;
[0038] Figure 4 Shows another structural block diagram of a connection device of a network provided according to an embodiment of the present application;
[0039] Figure 5 Shows a topology diagram of a network connection provided according to an embodiment of the present application;
[0040] Figure 6 Shows a schematic diagram of an address mode during a data transmission process of a network connection method provided according to an embodiment of the present application;
[0041] Figure 7 Shows one of the schematic diagrams of an address link of a network connection method provided according to an embodiment of the present application;
[0042] Figure 8 Shows another schematic diagram of an address link of a network connection method provided according to an embodiment of the present application.
[0043] Among them, Figures 3 to 5 The corresponding relationship between the reference numerals and the component names in
[0044] 300 is a connection device of a network, 302 is a sending unit, 304 is a receiving unit, 306 is a determining unit, 308 is a searching unit, 310 is a connecting unit, 400 is a connection device of a network, 402 is a response unit, 404 is a negotiation unit, 406 is a connecting unit, 502 is a device to be connected, 504 is a routing device, 506 is a mutual assistance device, 508 is a target mutual assistance device. Detailed implementation manners
[0045] In order to be able to more clearly understand the above objects, features and advantages of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific implementation manners. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
[0046] In the following description, many specific details are set forth in order to fully understand the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below.
[0047] Next, refer to Figures 1 to 8 to describe a network connection method, a connection device, an electronic device, and a readable storage medium provided according to some embodiments of the present application.
[0048] Such as Figure 1As shown, according to an embodiment of the present application, a method for connecting a network is proposed, which is executed by a device to be connected. The connection method includes:
[0049] S102, sending a first connection request for a first network to a routing device;
[0050] S104, receiving first response information corresponding to the first connection request sent by the routing device;
[0051] S106, determining the connection condition of the first network according to the first response information;
[0052] S108, searching for at least one mutual assistance device when the device to be connected does not meet the connection condition of the first network;
[0053] Wherein, the mutual assistance device is connected to the first network through the routing device;
[0054] S110, connecting to the first network through at least one mutual assistance device.
[0055] The network connection method provided by the present application can be used to connect a device to be connected to a first network, so that the device to be connected can access the Internet through the first network.
[0056] Specifically, first, control the device to be connected to send a connection request for the first network to the routing device. Wherein, the first network may be the network connected by the routing device. Controlling the device to be connected to send a connection request for the first network means sending a connection request to the routing device to request the device to be connected to the routing device, so as to realize that the device to be connected is connected to the first network through the routing device.
[0057] Further, after receiving the connection request of the device to be connected, the routing device may send feedback information to the device to be connected. Further, the device to be connected receives the first response information sent by the routing device and determines whether the device to be connected meets the connection condition of the first network according to the first response information sent by the routing device. Specifically, the connection condition of the first network may be whether the intensity of the network signal of the routing device received by the device to be connected is greater than a preset intensity. It can be understood that if the intensity of the network signal of the routing device that the device to be connected can receive is high, it means that the device to be connected can stably connect to the routing device, so as to stably and continuously access the first network. If the intensity of the network signal of the routing device that the device to be connected can receive is low, it will cause the device to be connected unable to connect to the routing device or frequent disconnection. The preset intensity of the network signal can be set to -55dBm.
[0058] Further, in the case where the device to be connected does not meet the connection conditions of the first network, at least one mutual assistance device is searched for. Among them, the mutual assistance device is connected to the first network, that is, the mutual assistance device is connected to the routing device of the first network, so as to realize the connection to the first network through the routing device. Specifically, the mutual assistance device can be household appliances that can realize the Internet access function, such as televisions, air conditioners, refrigerators, etc.
[0059] Further, after the mutual assistance device is searched for, the device to be connected can be connected to the mutual assistance device, so as to realize the connection of the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network.
[0060] The network connection method provided by this application, in the case where the device to be connected does not meet the connection conditions of the first network, by searching for at least one mutual assistance device connected to the first network, the device to be connected can be connected to the mutual assistance device, so as to realize the connection of the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low, and it is impossible to ensure a continuous and stable connection to the first network through the routing device. In this case, a continuous and stable connection to the first network is realized through the mutual assistance device, improving the network connection experience of the device to be connected, and further improving the user experience of using the device to be connected.
[0061] In some embodiments, optionally, connecting to the first network through at least one mutual assistance device includes: sending a second connection request for the first network to at least one of the mutual assistance devices; receiving second response information corresponding to the second connection request sent by at least one mutual assistance device; determining a target mutual assistance device among at least one mutual assistance device according to at least one piece of second response information; establishing a network connection with the target mutual assistance device.
[0062] In this embodiment, when the device to be connected cannot be connected to the first network through the routing device, a second connection request can be sent to at least one mutual assistance device and wait for the second response information sent by the mutual assistance device.
[0063] Further, after receiving the second response information sent by at least one mutual assistance device, a target mutual assistance device to be connected is determined among at least one mutual assistance device according to the second response information of each mutual assistance device.
[0064] It can be understood that when there is only one mutual assistance device, after receiving the second response information of this mutual assistance device, it can be determined that this device is the target mutual assistance device to be connected. At this time, the device to be connected can be controlled to be connected to this mutual assistance device, so as to realize the connection to the first network through this mutual assistance device.
[0065] When there are two or more mutual assistance devices, the device to be connected can receive multiple second response messages. At this time, the target mutual assistance device to be connected can be determined among the multiple mutual assistance devices according to the multiple second response messages. That is, according to the second response messages of the multiple mutual assistance devices, the target mutual assistance device that is most suitable for the current device to be connected is determined among the multiple mutual assistance devices, and further the device to be connected is controlled to be connected to the target mutual assistance device, so as to ensure the stability after the device to be connected is connected to the first network.
[0066] In some embodiments, optionally, establishing a network connection with the target mutual assistance device includes: performing key negotiation with the target mutual assistance device; and establishing a network connection with the target mutual assistance device according to the key generated by the mutual assistance device. In this embodiment, during the process of connecting the device to be connected to the target mutual assistance device, first, the device to be connected can be controlled to perform key negotiation with the mutual assistance device, so that the mutual assistance device generates a key, and further the device to be connected and the mutual assistance device can be connected based on the generated key.
[0067] Through the key negotiation between the device to be connected and the mutual assistance device, a key between the device to be connected and the mutual assistance device can be generated. During the data transmission process between the device to be connected and the mutual assistance device, the data can be encrypted with the key generated by the key negotiation to ensure the security of the data transmission between the device to be connected and the mutual assistance device.
[0068] In some embodiments, optionally, performing key negotiation with the target mutual assistance device includes: sending a first ciphertext to the mutual assistance device, where the first ciphertext is obtained by encrypting a first text based on the public key of the mutual assistance device; receiving a second ciphertext sent by the mutual assistance device, where the second ciphertext is obtained by the mutual assistance device encrypting the first text and a second text, and the second text is a text for key negotiation between the mutual assistance device and the device to be connected; decrypting the second ciphertext to generate a third text; determining the negotiation result of the key negotiation according to the third text; and sending the negotiation result to the mutual assistance device.
[0069] In this embodiment, the device to be connected first sends a first ciphertext to the target mutual assistance device, and the first ciphertext is obtained by encrypting a first text according to the public key of the target mutual assistance device. Further, the mutual assistance device receives the first ciphertext sent by the device to be connected and then decrypts the first ciphertext to generate a first text.
[0070] Further, after decrypting the first text, the mutual assistance device can encrypt the first text and the second text based on the public key of the mutual assistance device to generate a second ciphertext. The second text is a preset text for key negotiation between the mutual assistance device and the device to be connected. Then the second ciphertext is sent to the device to be connected.
[0071] Further, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. Then, based on the third text, the device to be connected determines the negotiation result of the key negotiation with the mutual assistance device.
[0072] Further, when it is determined that the negotiation result of the key negotiation is successful, the mutual assistance device can generate a target key based on the first text and the second text.
[0073] During the key negotiation process, the device to be connected and the mutual assistance device respectively generate the first ciphertext and the second ciphertext based on the public key of the other party. Then, after decrypting the first ciphertext and the second ciphertext, based on the generated third text, the negotiation result of the key negotiation is determined, thereby realizing the key negotiation between the device to be connected and the mutual assistance device and ensuring the accuracy of the negotiation result.
[0074] In some embodiments, optionally, determining the negotiation result of the key negotiation based on the third text includes: obtaining the text content of the third text; when the text content of the third text includes the first text, determining that the negotiation result is successful.
[0075] In this embodiment, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. Then, based on the third text, the device to be connected determines the negotiation result of the key negotiation with the mutual assistance device.
[0076] Specifically, first, the text content of the third text can be obtained to determine whether the first text sent by the device to be connected exists in the third text. If the first text exists in the third text, it indicates that the mutual assistance device generates the third text based on the first text sent by the device to be connected. Then, it can be determined that the negotiation result of the key negotiation between the mutual assistance device and the device to be connected is successful. Further, the mutual assistance device can generate a target key based on the first text and the second text.
[0077] As Figure 2 shown, according to an embodiment of the present application, a method for connecting a network is provided, which is executed by a mutual assistance device. The mutual assistance device is connected to a first network through a routing device. The connection method includes:
[0078] S202, when receiving a connection request from a device to be connected, generating and sending response information according to the connection request;
[0079] wherein the response information is used for the device to be connected to determine the mutual assistance device to be connected;
[0080] S204, when receiving a key negotiation request from a device to be connected, performing key negotiation with the device to be connected to generate a key;
[0081] S206. Establish a network connection with the device to be connected according to the secret key.
[0082] For the network connection method provided in this application, when the mutual assistance device receives a connection request from the device to be connected, the mutual assistance device can generate and send a response message according to the connection request. This response message is sent to the device to be connected for the device to be connected to determine the mutual assistance device to be connected according to this response message.
[0083] It can be understood that the connection request sent by the device to be connected may be sent to multiple mutual assistance devices simultaneously. Each mutual assistance device will send a response message for the connection request of the device to be connected. The device to be connected can determine the mutual assistance device to be connected according to the response messages received from multiple mutual assistance devices.
[0084] Furthermore, after the device to be connected determines the mutual assistance device to be connected, it will send a secret key negotiation request to the mutual assistance device. After the mutual assistance device and the device to be connected perform secret key negotiation, a secret key can be generated. Finally, the mutual assistance device can establish a network connection with the device to be connected according to the generated secret key.
[0085] For the network connection method provided in this application, when the device to be connected does not meet the connection conditions of the first network, the device to be connected can be connected to the mutual assistance device to realize connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low and it is impossible to ensure a continuous and stable connection to the first network through the routing device. Through the mutual assistance device, a continuous and stable connection to the first network is realized, improving the networking experience of the device to be connected and further improving the user experience of using the device to be connected.
[0086] In some embodiments, optionally, when receiving the secret key negotiation request from the device to be connected and performing secret key negotiation with the device to be connected to generate a secret key, it includes: when receiving the first ciphertext of the device to be connected, decrypting the first ciphertext to generate a first text; encrypting the first text and a second text to generate and send a second ciphertext; where the second text is a preset text for the mutual assistance device and the device to be connected to perform secret key negotiation; receiving the secret key negotiation result sent by the device to be connected, and when the secret key negotiation result is successful, generating a secret key according to the first text and the second text; where the secret key negotiation result is determined by the device to be connected according to the third text obtained by decrypting the second ciphertext.
[0087] In this embodiment, the device to be connected first sends a first ciphertext to the target mutual assistance device, and the first ciphertext is obtained by encrypting a first text with the public key of the target mutual assistance device. Further, the mutual assistance device receives the first ciphertext from the device to be connected, and then decrypts the first ciphertext to generate the first text.
[0088] Further, after decrypting the first text, the mutual assistance device may encrypt the first text and a second text based on the public key of the mutual assistance device to generate a second ciphertext. The second text is a preset text for key negotiation between the mutual assistance device and the device to be connected. Then the second ciphertext is sent to the device to be connected.
[0089] Further, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. Then the device to be connected determines the negotiation result of the key negotiation with the mutual assistance device according to the third text.
[0090] Further, when it is determined that the negotiation result of the key negotiation is successful, the mutual assistance device can generate a target key according to the first text and the second text.
[0091] During the key negotiation process, the device to be connected and the mutual assistance device respectively generate the first ciphertext and the second ciphertext according to the public key of the other party. Thus, after decrypting the first ciphertext and the second ciphertext, the negotiation result of the key negotiation is determined according to the generated third text, thereby realizing the key negotiation between the device to be connected and the mutual assistance device and ensuring the accuracy of the negotiation result.
[0092] In some embodiments, optionally, after establishing a network connection with the device to be connected according to the key, the network connection method further includes: updating the device node link of the device connected to the first network.
[0093] In this embodiment, after the device to be connected is connected to the target mutual assistance device, it is also necessary to update the device node link of the first network. Thereby ensuring the accuracy of the device node link of the device connected to the first network, and further ensuring that during the data transmission in the first network, the data can be transmitted according to the correct device node link, ensuring the accuracy of the data transmission.
[0094] Further, updating the device node link of the device connected to the first network includes:
[0095] Obtaining the original link of the first network, where the original link is the device node link of the first network before the device to be connected is connected to the target mutual assistance device;
[0096] In the case where there is no device node downstream of the device node of the mutual assistance device in the original link, adding the device node of the device to be connected to the downstream of the device node of the target mutual assistance device;
[0097] In the original link, when there is a device node downstream of the device node of the target mutual assistance device in the original link, copy the original link to generate a copied link;
[0098] Replace the downstream device node of the target mutual assistance device in the copied link with the device node of the device to be connected.
[0099] Specifically, after the device to be connected is connected to the target mutual assistance device, first obtain the original link of the first network, that is, the device node link of the first network before the device to be connected is connected to the target mutual assistance device. Then, in the original link of the first network, determine whether there is a device node connected downstream of the target mutual assistance device.
[0100] In the original link of the first network, if there is no device node downstream of the target mutual assistance device, the device node of the device to be connected can be directly added downstream of the target mutual assistance device in the original link to update the device node link of the first network.
[0101] If the downstream node of the target mutual assistance device is occupied, that is, there is a device node downstream of the target mutual assistance device, at this time, assist the original link of the first network to generate a copied link, and at this time, the copied link is the same as the original link of the first network. Then replace the downstream device node of the target mutual assistance device in the copied link with the device node of the device to be connected, so as to generate a new device node link and complete the update of the device node link of the first network.
[0102] Further, after updating the device node link of the first network, a device routing table of the first network can be established and the new routing table can be sent to each device of the first network, so that each device has a complete routing table of the first network, so that in the process of data transmission, each device can locate the next device node to be transmitted according to the routing table.
[0103] In a specific embodiment, as Figure 5 shown, when the device to be connected 502 needs to be connected to the first network, first, control the device to be connected 502 to send a connection request for the first network to discover connectable Internet devices. Specifically, the device to be connected 502 can send a connection request every 0.5 s. If no response from other devices is received for a long time, the device to be connected 502 can send requests at random intervals of 0.1 s within 5 s. At the same time, the device to be connected 502 also listens to the beacon sent by the routing device 504 and makes a comprehensive judgment based on the scanned wireless access point and the device information of the mutual assistance device 506 to determine whether to connect to the routing device 504 or the mutual assistance device 506.
[0104] Specifically, during the information interaction process between the device to be connected 502, the routing device 504, and the mutual assistance device 506, the information sent includes multiple fields. Among them, the key fields include ability display, frame type, message ID, CMD, level, etc. In one embodiment, the key fields are described as follows: Ability display: 8 bits, b0:1 supports mutual assistance; b0:0 does not support mutual assistance; other bits are reserved; Frame type: 01: probe request; 02: probe response; 03: action; Message ID: global ID, set by the initiator and the responder returns the same ID. CMD: 01: key negotiation; 02: password update; 03: routing table update; Level: the network layer where the mutual assistance device 506 is located. The mutual assistance device 506 directly connected to the routing device 504 is layer 0, the mutual assistance device 506 connected to the mutual assistance device 506 directly connected to the routing device 504 is 1, the leaf connected to 1 is 2... The level range can be less than or equal to 4 layers.
[0105] Specifically, the connection request sent by the device to be connected 502 may include the following fields: protocol version, ability display, frame type, message ID, CMD, negotiation step, Pubkey, Sha, R1. In one embodiment, the protocol version is used to indicate the version of the communication protocol of the sent connection request; the ability display is used to show whether the device to be connected 502 supports the connection of the mutual assistance device 506; the frame type is used to indicate the message type of the sent connection request; the message ID is used to show the sent ID information, set by the initiator and the responder returns the same ID; CMD, 01 represents key negotiation, 02 represents password update, 03 represents routing table update; the negotiation step is used to show the process in the current connection process; Pub key, the public key generated by the device to be connected 502; Sha, ciphertext encryption method; R1, ciphertext encrypted based on the public key.
[0106] Further, after receiving the response information of the routing device 504, the strength of the network signal of the routing device 504 that the device to be connected 502 can receive is determined according to the response information of the routing device 504. If the strength of the network signal of the routing device 504 that the device to be connected 502 can receive is lower than -55 dBm, it will cause the device to be connected 502 to be unable to connect to the routing device 504 or experience frequent disconnections. At this time, it can be determined whether the response information of the mutual assistance device 506 is received.
[0107] When the mutual assistance device 506 receives a connection request, it sends a response message after rule judgment. The judgment rules are as follows: 1. It allows the device to be connected to access itself; 2. The device that the device 502 to be connected requests to access is the mutual assistance device 506; 3. The name of the routing device 504 requesting access is the same as the network it accesses itself. The response message includes other information such as business private information, the number of connected terminals, and the floor where it is located.
[0108] Specifically, the response message sent by the mutual assistance device 506 may include the following fields in addition to the fields in the connection request sent by the device 502 to be connected: level, which is used to indicate the level of the mutual assistance device 506 in the first network; the number of access points, which is used to indicate the number of devices accessed by the mutual assistance device 506; the strength of the network signal; R2, which is the ciphertext encrypted based on the public key of the mutual assistance device 506; R1.
[0109] Further, according to the response messages sent by multiple mutual assistance devices 506, a target mutual assistance device 508 is determined among the multiple mutual assistance devices 506. First, a preliminary selection can be made according to the signal strength of the mutual assistance device 506, the floor of the mutual assistance device 506 in the first network, and the number of devices connected by the mutual assistance device 506. Specifically, the mutual assistance device 506 with a signal strength greater than -55 dBm, a floor less than or equal to 4 floors, and a connection point number less than 6 can be screened out.
[0110] Further, among the screened mutual assistance devices 506, the connection index of the mutual assistance device 506 is determined according to the signal strength of the mutual assistance device 506, the floor of the mutual assistance device 506 in the first network, and the number of devices connected by the mutual assistance device 506, and the mutual assistance device 506 with the largest connection index is determined as the target mutual assistance device 508. Specifically, first, the signal strength of the mutual assistance device 506, the strength weight and strength score corresponding to the signal strength, the floor weight and floor score corresponding to the floor, and the point weight and point score corresponding to the number of connection points can be determined, and then the connection index of each mutual assistance device 506 is calculated.
[0111] Specifically, the connection index can be calculated according to the formula P = A×a + B×b + C×c, where P is the connection index, A is the strength score, a is the strength weight, B is the point score, b is the point weight, C is the level score, and c is the level weight. For example, the strength weight of the signal strength is 0.5, and when the signal strength is -50 dBm, the corresponding strength score is 4. The point weight of the number of connection points is 0.5, and when the number of connection points is 5, the point score is 4. The floor weight of the floor is 0.3, and when the floor is 3, the corresponding floor score is 4. When the signal strength of the mutual assistance device 506 is -50 dBm, the number of connection points is 5, and the floor is 3, the connection index of this mutual assistance device is: P = 4×0.5 + 4×0.3 + 4×0.2 = 4.
[0112] Further, after determining the target mutual assistance device 508, the control device 502 to be connected negotiates a key with the target mutual assistance device 508 to generate a key for data transmission between the device 502 to be connected and the target mutual assistance device 508. The connection request sent by the device 502 to be connected includes the text R1 encrypted with the public key of the device 502 to be connected. Accordingly, the response information sent by the target mutual assistance device 508 to the device 502 to be connected includes R1 and the texts R1 and R2 encrypted with the public key of the device 502 to be connected.
[0113] In the process of key negotiation, the encryption key is obtained using the ECC encryption algorithm. While the device to be connected initiates a scan, it also initiates key negotiation, and the target mutual assistance device 508 responds to implement the second step of key negotiation. The third and fourth steps use the ACTION frame to confirm the key.
[0114] First, after the device 502 to be connected receives the response information from the target mutual assistance device 508, it decrypts the encrypted text. If the decrypted text includes R1, it indicates that the key negotiation between the device 502 to be connected and the mutual assistance device 506 is successful. Then the device 502 to be connected encrypts the negotiation result "OK" based on the public key of the mutual assistance device 506 and sends it to the mutual assistance device 506. After receiving the negotiation result, the mutual assistance device 506 generates a key according to R1 and R2, encrypts the text "OK" based on the generated key, and sends it to the device 502 to be connected, and the key negotiation is completed. Then, data transmission is performed between the device 502 to be connected and the mutual assistance device 506 based on the generated key. Specifically, during the key negotiation process, the device 502 to be connected sends key negotiation information using the 4-address mode action frame. Among them, the information sent by the device 502 to be connected and the mutual assistance device 506 can include the following fields: protocol version, capability display, frame type, message ID, CMD, negotiation step, and ciphertext.
[0115] Further, after the key negotiation is completed, the device node link of the first network can be updated. Specifically, in the original link of the first network, if there is no device node downstream of the target mutual assistance device 508, the device node of the device 502 to be connected can be directly added downstream of the target mutual assistance device 508 in the original link to realize the update of the device node link of the first network.
[0116] If the downstream node of the target mutual assistance device 508 is occupied, that is, there is a device node downstream of the target mutual assistance device 508. At this time, the original link of the first network can be assisted to generate a replication link, and the replication link is the same as the original link of the first network. Then, the downstream device node of the target mutual assistance device 508 in the replication link is replaced with the device node of the device to be connected 502, so as to generate a new device node link and complete the update of the device node link of the first network.
[0117] For example, as Figure 7 and Figure 8 shown, the original link is A - B - C - D. When E accesses, D adds E to the end to get A - B - C - D - E. At the same time, the device node in front of D reports the direction to add E at the end of the A - B - C - D routing table. After each node receives this information, it will add E after D. The node synchronization is completed. If at the same time, an F is added to the end of D on the A - B - C - D path. At this time, D finds that its end is occupied, so it replicates a connection and adds F to the end of D. At the same time, the D node synchronizes the information that needs to be added to the end to the root node. If each node is occupied, it is also replicated and added. Each node gets the complete two linked lists of A - B - C - D - F and A - B - C - D - E. Specifically, the data sent to the device node in front can include the following fields: protocol version; capability display; frame type; message ID; CMD; Sub, used to update the linked list to the associated network link; Len, used to indicate the length of the string, usually a multiple of 6; Macdata, mac data, 6(N + 2) bytes, where N represents the layer where the device is currently located. Mac is in little - endian alignment and is arranged sequentially from the mutual assistance device connected to the routing device backwards. The arrangement example of MACdata: MAC root, MAC1, MAC2... MACend.
[0118] Furthermore, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, the data forwarding rules are as follows:
[0119] Such as Figure 6As shown in the figure, a 4 - address mode is adopted for data transmission between the device to be connected 502 and the target mutual - assistance device 508. A 3 - address mode is adopted for data transmission between the target mutual - assistance device 508 and other mutual - assistance devices 506, and between the target mutual - assistance device 508 and the routing device 504. The device to be connected 502 is connected to the target mutual - assistance device 508, the target mutual - assistance device 508 is connected to the routing device 504, and the routing device 504 is connected to the host device. The process of the device to be connected 502 sending data to the host device: The device to be connected 502 sends 4 addresses to the target mutual - assistance device 508: Receive Address (RA) - the physical address of the target mutual - assistance device 508, Transmit Address (TA) - the physical address of the device to be connected 502, Destination Address (DA) - the physical address of the host device, Source Address (SA) - the physical address of the device to be connected 502; The target mutual - assistance device 508 sends 3 addresses to the routing device 504: Receive Address (RA) - the physical address of the routing device 504, Source Address (SA) - the physical address of the target mutual - assistance device 508, Destination Address (DA) - the physical address of the host device; The routing device 504 sends 3 addresses to the host device: Destination Address (DA) - the physical address of the host device, Transmit Address (TA) - the physical address of the routing device 504, Source Address (SA) - the physical address of the target mutual - assistance device 508.
[0120] The process of the host device sending data to the device to be connected 502: The host device sends 3 addresses to the routing device 504: Receive Address (RA) - the physical address of the routing device 504, Source Address (SA) - the physical address of the host device, Destination Address (DA) - the physical address of the target mutual - assistance device 508; The routing device 504 sends 3 addresses to the target mutual - assistance device 508: Destination Address (DA) - the physical address of the target mutual - assistance device 508, Transmit Address (TA) - the physical address of the routing device 504, Source Address (SA) - the physical address of the host device; The target mutual - assistance device 508 sends 4 addresses to the device to be connected 502: Receive Address (RA) - the physical address of the device to be connected 502, Transmit Address (TA) - the physical address of the target mutual - assistance device 508, Destination Address (DA) - the physical address of the device to be connected 502, Source Address (SA) - the physical address of the host device.
[0121] Specifically: When the device to be connected 502 actively sends data, it detects whether the Address Resolution Protocol (ARP table) of the device to be connected 502 contains the physical address of the target mutual - assistance device 508. If it does, it directly converts it into a 4 - address mode and sends it to the target mutual - assistance device 508. If not, it sends the data through the 4 - address mode step - by - step through the target mutual - assistance device 508 to the mutual - assistance device 506 connected to the routing device 504.
[0122] When the mutual assistance device 506 connected to the routing device 504 receives the data sent by the routing device 504, it first determines whether the logical address of the local device exists in the received data. If the logical address of the local device exists, the data is transmitted to the application layer of the local device. If not, the physical address of the next-level device is determined from the physical address routing table stored in the local device, and the data is transmitted to the next-level device.
[0123] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, the device to be connected 502 sends detection data to the target mutual assistance device 508 once every 1 minute. If the target mutual assistance device 508 does not receive the detection data of the device to be connected 502 for 2 minutes, it is considered that the device to be connected 502 is lost, and the relevant information of the device to be connected 502 is cleared; when the device to be connected 502 does not receive the detection data reply from the target mutual assistance device 508, it means that the connection fails, and all devices under this node need to be notified to clear the connection relationship and search for the network again. The detection data may include the following fields: protocol version, capability display, frame type, message ID, and CMD.
[0124] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, it is necessary to detect the connection exception of the device to be connected 502 in real time. Specifically, when the connection between the target mutual assistance device 508 and the routing device 504 is disconnected, the routing device 504 should retain the device information of all mutual assistance devices 506 connected to it and the address resolution protocol. After the routing device 504 is restarted, at this time, it is not necessary to clear the device information of the mutual assistance devices 506 connected to the routing device 504 and the address resolution protocol, and only the device addresses in the address resolution protocol need to be cleared. Then, an instruction is sent to the mutual assistance device 506 connected to it to notify the mutual assistance device 506 to re-initiate the Dynamic Host Configuration Protocol and update the physical address routing table, so that the mutual assistance device 506 and the routing device 504 re-establish the connection. Among them, the instruction sent by the routing device 504 may include the following fields: protocol version, capability display, frame type, message ID, and CMD.
[0125] Further, when the target mutual assistance device 508 finds that it is disconnected from the routing device 504, it can send an instruction to the device to be connected 502 connected to it to notify the device to be connected 502 to re-initiate the connection. Specifically, the instruction sent by the target mutual assistance device 508 may include the following fields: protocol version, capability display, frame type, message ID, and CMD.
[0126] According to the third aspect of the present application, as Figure 3As shown, a connection device 300 for a network is proposed for a device to be connected. The connection device 300 for the network includes: a sending unit 302 for sending a first connection request for a first network to a routing device; a receiving unit 304 for receiving first response information corresponding to the first connection request sent by the routing device; a determining unit 306 for determining connection conditions for the first network according to the first response information; a searching unit 308 for searching for at least one mutual assistance device when the device to be connected does not meet the connection conditions for the first network, where the mutual assistance device is connected to the first network through the routing device; and a connecting unit 310 for connecting to the first network through at least one mutual assistance device.
[0127] The connection device 300 for the network provided in this application, when the device to be connected does not meet the connection conditions for the first network, searches for at least one mutual assistance device connected to the first network, so that the device to be connected can be connected to the mutual assistance device, thereby realizing connecting the device to be connected to the first network through the mutual assistance device, enabling the device to be connected to implement an Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low and it is impossible to ensure a continuous and stable connection to the first network through the routing device. By using the mutual assistance device, a continuous and stable connection to the first network is achieved, improving the networking experience of the device to be connected and further enhancing the user experience of using the device to be connected.
[0128] Further, the sending unit 302 is further configured to send a second connection request for the first network to at least one of the mutual assistance devices; the receiving unit 304 is further configured to receive second response information corresponding to the second connection request sent by at least one mutual assistance device; the determining unit 306 is further configured to determine a target mutual assistance device among at least one mutual assistance device according to at least one second response information; and the connecting unit 310 is specifically configured to establish a network connection with the target mutual assistance device.
[0129] Further, the connecting unit 310 is specifically configured to perform key negotiation with the target mutual assistance device; and establish a network connection with the target mutual assistance device according to the key generated by the mutual assistance device.
[0130] Further, the connecting unit 310 is specifically further configured to send a first ciphertext to the mutual assistance device, where the first ciphertext is obtained by encrypting a first text based on the public key of the mutual assistance device; receive a second ciphertext sent by the mutual assistance device, where the second ciphertext is obtained by the mutual assistance device encrypting the first text and a second text, and the second text is a preset text for key negotiation between the mutual assistance device and the device to be connected; decrypt the second ciphertext to generate a third text; determine the negotiation result of the key negotiation according to the third text; and send the negotiation result to the mutual assistance device.
[0131] Further, the connection unit 310 is specifically further configured to obtain the text content of the third text; when the text content of the third text includes the first text, determine that the negotiation result is successful.
[0132] According to a fourth aspect of the present application, as Figure 4 shown, a connection device 400 of a network is proposed, which is used for a mutual assistance device. The mutual assistance device is connected to a first network through a routing device. The connection device includes: a response unit 402, configured to generate and send response information according to a connection request when receiving a connection request from a device to be connected, where the response information is used for the device to be connected to determine the mutual assistance device that needs to be connected; a negotiation unit 404, configured to perform key negotiation with the device to be connected when receiving a key negotiation request from the device to be connected, and generate a key; a connection unit 406, configured to establish a network connection with the device to be connected according to the key.
[0133] The connection device 400 of the network provided by the present application can connect the device to be connected to the mutual assistance device when the device to be connected does not meet the connection conditions of the first network, so as to realize connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. Thus, it solves the problem that the intensity of the network signal of the routing device received by the device to be connected is low and it is impossible to ensure a continuous and stable connection to the first network through the routing device. Through the mutual assistance device, a continuous and stable connection to the first network is realized, improving the networking experience of the device to be connected, and further improving the user experience of using the device to be connected.
[0134] Further, the negotiation unit 404 is specifically configured to decrypt the first ciphertext when receiving the first ciphertext of the device to be connected, generate a first text; encrypt the first text and a second text, generate and send a second ciphertext; where the second text is a preset text for key negotiation between the mutual assistance device and the device to be connected; receive the key negotiation result sent by the device to be connected, and generate a key according to the first text and the second text when the key negotiation result is successful; where the key negotiation result is determined by the device to be connected according to the third text obtained by decrypting the second ciphertext.
[0135] Further, the connection device 400 of the network further includes an update unit, configured to update the device node link connected to the first network.
[0136] Further, the update unit is specifically configured to obtain the original link of the first network, where the original link is the device node link of the first network before the device to be connected is not connected to the target mutual assistance device; in the case that there is no device node downstream of the device node of the target mutual assistance device in the original link, add the device node of the device to be connected downstream of the device node of the target mutual assistance device; in the case that there is a device node downstream of the device node of the target mutual assistance device in the original link, copy the original link to generate a copied link; and replace the downstream device node of the target mutual assistance device in the copied link with the device node of the device to be connected.
[0137] Further, the connection device 400 of the network further includes an establishment unit for establishing a device routing table of the first network.
[0138] According to the fifth aspect of the present application, there is provided an electronic device, including: a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the network connection method provided in any of the above embodiments are implemented.
[0139] The electronic device provided by the present application includes a memory and a processor, and also includes a program or instruction stored on the memory. When the program or instruction is executed by the processor, the steps of the network connection method in any of the above embodiments can be implemented. Therefore, the electronic device has all the beneficial effects of the above network connection method, which will not be elaborated here.
[0140] According to the sixth aspect of the present application, there is provided a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by the processor, the steps of the network connection method provided in any of the above embodiments are implemented.
[0141] The computer-readable storage medium provided by the present application stores a program or instruction thereon. Since the program or instruction can implement the network connection method in any of the above embodiments when executed by the processor, the computer-readable storage medium has all the beneficial effects of the above network connection method, which will not be elaborated here.
[0142] According to the seventh aspect of the present application, there is provided a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by the processor, the steps of the network connection method provided in any of the above embodiments are implemented.
[0143] The computer program product provided by the present application includes a computer program or instruction, and when the computer program or instruction is executed by the processor, the steps of the network connection method provided in any of the above embodiments are implemented. Therefore, the computer program product has all the beneficial effects of the above network connection method, which will not be elaborated here.
[0144] In the description of this application, the term "a plurality of" means two or more. Unless otherwise clearly defined, the orientation or positional relationship indicated by terms such as "upper" and "lower" is based on the orientation or positional relationship shown in the drawings. This is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to this application. The terms "connection", "installation", "fixation", etc. should all be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0145] In the description of this specification, the description of terms such as "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0146] The above are only the preferred embodiments of this application and are not used to limit this application. For those skilled in the art, various changes and modifications can be made to this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.
Claims
1. A connection method for a network, which is executed by a device to be connected, characterized in that The connection method includes: Sending a first connection request for a first network to a routing device; Receiving first response information corresponding to the first connection request sent by the routing device; Determining the connection conditions of the first network according to the first response information; Searching for at least one mutual assistance device when the device to be connected does not meet the connection conditions of the first network, where the mutual assistance device is connected to the first network through the routing device; Connecting to the first network through at least one of the mutual assistance devices.
2. The connection method according to claim 1, wherein The connecting to the first network through at least one of the mutual assistance devices includes: Sending a second connection request for the first network to at least one of the mutual assistance devices; Receiving second response information corresponding to the second connection request sent by at least one of the mutual assistance devices; Determining a target mutual assistance device among at least one of the mutual assistance devices according to at least one of the second response information; Establishing a network connection with the target mutual assistance device.
3. The connection method according to claim 2, characterized in that, The establishing a network connection with the target mutual assistance device includes: Performing key negotiation with the target mutual assistance device; Establishing a network connection with the target mutual assistance device according to the key generated by the mutual assistance device.
4. The connection method according to claim 3, characterized in that, The performing key negotiation with the target mutual assistance device includes: Sending a first ciphertext to the mutual assistance device, where the first ciphertext is obtained by encrypting a first text based on the public key of the mutual assistance device; Receiving a second ciphertext sent by the mutual assistance device, where the second ciphertext is obtained by the mutual assistance device encrypting the first text and a second text, and the second text is a preset text for the mutual assistance device and the device to be connected to perform key negotiation; Decrypting the second ciphertext to generate a third text; Determining the negotiation result of the key negotiation according to the third text; Sending the negotiation result to the mutual assistance device.
5. The connection method according to claim 4, characterized in that, The determining the negotiation result of the key negotiation according to the third text includes: Obtaining the text content of the third text; Determining that the negotiation result is successful when the text content of the third text includes the first text.
6. A connection method of a network, which is executed by a mutual assistance device, characterized in that The mutual assistance device is connected to the first network through a routing device, and the connection method includes: When receiving a connection request from a device to be connected, generating and sending response information according to the connection request, where the response information is used for the device to be connected to determine the mutual assistance device that needs to be connected; When receiving a key negotiation request from the device to be connected, performing key negotiation with the device to be connected to generate a key; Establishing a network connection with the device to be connected according to the key.
7. The connection method according to claim 6, characterized in that, The performing key negotiation with the device to be connected to generate a key when receiving a key negotiation request from the device to be connected includes: When receiving the first ciphertext of the device to be connected, decrypting the first ciphertext to generate a first text; Encrypting the first text and a second text to generate and send a second ciphertext; Where the second text is a preset text for the mutual assistance device and the device to be connected to perform key negotiation; Receive the key negotiation result sent by the device to be connected. When the key negotiation result is successful, generate the key according to the first text and the second text. Wherein, the key negotiation result is determined by the device to be connected according to the third text obtained by decrypting the second ciphertext.
8. The connection method according to claim 6 or 7, characterized in that After establishing a network connection with the device to be connected according to the key, the connection method further includes: Updating the device node link of the device connected to the first network.
9. The connection method according to claim 8, characterized in that, The updating of the device node link of the device connected to the first network includes: Obtain the original link of the first network, where the original link is the device node link of the first network before connecting the device to be connected. When there is no device node downstream of the device node of the mutual assistance device in the original link, add the device node of the device to be connected downstream of the device node of the target mutual assistance device. When there is a device node downstream of the device node of the target mutual assistance device in the original link, copy the original link to generate a copied link. Replace the downstream device node of the target mutual assistance device in the copied link with the device node of the device to be connected.
10. The connection method according to claim 8, characterized in that, After updating the device node link of the device connected to the first network, the connection method further includes: Establishing a device routing table for the first network.
11. A connection device for a network, for a device to be connected, characterized in that, The connection device includes: A sending unit, configured to send a first connection request for the first network to a routing device. A receiving unit, configured to receive first response information corresponding to the first connection request sent by the routing device. A determining unit, configured to determine the connection condition of the first network according to the first response information. A searching unit, configured to search for at least one mutual assistance device when the device to be connected does not meet the connection condition of the first network, where the mutual assistance device is connected to the first network through the routing device. A connecting unit, configured to connect to the first network through at least one of the mutual assistance devices.
12. A connection device for a network, for mutual assistance devices, characterized in that, The mutual assistance device is connected to the first network through a routing device, and the connection device includes: A response unit, configured to generate and send response information according to the connection request when receiving a connection request from a device to be connected, where the response information is used for the device to be connected to determine the mutual assistance device to be connected. A negotiation unit, configured to perform key negotiation with the device to be connected to generate a key when receiving a key negotiation request from the device to be connected. A connecting unit, configured to establish a network connection with the device to be connected according to the key.
13. An electronic device, characterized in that, Includes: A processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, it implements the steps of the method according to any one of claims 1 to 5 and / or the steps of the method according to any one of claims 6 to 10.
14. A computer-readable storage medium, characterized in that, A program or instructions are stored on the computer-readable storage medium, and when the program or instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 and / or the steps of the method described in any one of claims 6 to 10 are implemented.
15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 and / or the steps of the method described in any one of claims 6 to 10 are implemented.
Citation Information
Cited By
Network connection method and apparatus, and electronic device and readable storage medium
EP4746575A1
Network connection method and apparatus, and electronic device and readable storage medium
WO2025130033A1