Network connection method and apparatus, and electronic device and readable storage medium

By searching and connecting to the mutual aid device in electronic devices, the connection instability caused by insufficient network signal strength of the routing device is solved, and a better network connection experience and user experience are achieved.

WO2025130033A1PCT designated stage expired Publication Date: 2025-06-26MIDEA GRP (SHANGHAI) CO LTD +1
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/107949
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-22
Filing Date
2024-07-26
Publication Date
2025-06-26

AI Technical Summary

Technical Problem

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, and frequent disconnection, affecting the network connection experience.

Method used

By searching and connecting to at least one mutual aid device in the device to be connected, the mutual aid device is used to connect to the network through the routing device, thereby achieving a stable connection.

Benefits of technology

It improves the networking experience of the devices to be connected, ensures that the devices can be continuously and stably connected to the network, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024107949_26062025_PF_FP_ABST
    Figure CN2024107949_26062025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a network connection method and apparatus, and an electronic device and a readable storage medium. The network connection method comprises: sending a first connection request of a first network to a routing device (S102); receiving first response information, which is sent by the routing device and corresponds to the first connection request (S104); determining a connection condition of the first network on the basis of the first response information (S106); when a device to be connected does not meet the connection condition of the first network, searching for at least one mutual assistance device (S108), wherein the mutual assistance device is connected to the first network by means of the routing device; and connecting to the first network by means of the at least one mutual assistance device (S110). In the network connection method provided in the present application, a continuous and stable connection to a first network is realized by means of a mutual assistance device, thereby improving the networking experience of a device to be connected, and improving the usage experience, for a user, of using the device to be connected.
Need to check novelty before this filing date? Find Prior Art

Description

Network connection method, connection device, electronic device and readable storage medium

[0001] This application claims priority to the Chinese patent applications filed with the State Intellectual Property Office of China on December 22, 2023, with application number "202311788104.9", with application number "202311791581.0", and with application number "202311788094.9", filed with the State Intellectual Property Office of China on December 22, 2023, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the technical field of Internet of Things, and in particular to a network connection method, a connection device, an electronic device, and a readable storage medium. Background Art

[0003] In related technologies, electronic devices are connected to wireless networks through routing devices, enabling the electronic devices to access the wireless networks. However, in actual use, due to the location of the electronic devices or the configuration of the electronic devices themselves, the network signals sent by the routing devices received by the electronic devices may be weak, resulting in the electronic devices being unable to effectively connect to the wireless network of the routing devices or frequently disconnected, thereby resulting in a poor networking experience for the electronic devices.

[0004] Summary of the Invention

[0005] This application aims to solve at least one of the technical problems existing in the prior art.

[0006] To this end, a first aspect of the present application provides a network connection method.

[0007] A second aspect of the present application provides a network connection method.

[0008] A third aspect of the present application provides a network connection device.

[0009] A fourth aspect of the present application provides a network connection device.

[0010] A fifth aspect of the present application provides an electronic device.

[0011] A sixth aspect of the present application provides a computer-readable storage medium.

[0012] A seventh aspect of the present application provides a computer program product.

[0013] A first aspect of the present application provides a network connection method, which is performed by a device to be connected, and 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 a connection condition for the first network based on the first response information; if the device to be connected does not meet the connection condition for the first network, searching for at least one mutual aid device, wherein the mutual aid device is connected to the first network through the routing device; and connecting to the first network through at least one mutual aid device.

[0014] The network connection method provided by this application can connect the device to be connected to the mutual assistance device by searching for at least one mutual assistance device connected to the first network when the device to be connected does not meet the connection conditions of the first network. This allows the device to be connected to the mutual assistance device, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength of the routing device received by the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0015] According to the second aspect of the present application, a network connection method is proposed, which is executed by a mutual aid device, and the mutual aid device is connected to a first network through a routing device. The connection method includes: upon receiving a connection request from a device to be connected, generating and sending response information according to the connection request, wherein the response information is used for the device to be connected to determine the mutual aid device to be connected; upon 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 based on the key.

[0016] The network connection method provided by this application can connect the device to be connected to a mutual assistance device if the device to be connected does not meet the connection conditions of the first network, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength received by the routing device from the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0017] According to a third aspect of the present application, a network connection device is proposed for a device to be connected, the connection device comprising: a sending unit for sending a first connection request for a first network to a routing device; a receiving unit for receiving a first response information corresponding to the first connection request sent by the routing device; a determination unit for determining a connection condition for the first network based on the first response information; a search unit for searching for at least one mutual aid device when the device to be connected does not meet the connection condition for the first network, wherein the mutual aid device is connected to the first network through the routing device; and a first connection unit for connecting to the first network through at least one mutual aid device.

[0018] The network connection device provided in this application can connect the device to be connected to the mutual assistance device by searching for at least one mutual assistance device connected to the first network when the device to be connected does not meet the connection conditions of the first network. This allows the device to be connected to the first network through the mutual assistance device, thereby enabling the device to be connected to access the Internet through the first network. This solves the problem of the network signal strength of the routing device received by the device to be connected being low, making it impossible to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0019] According to the fourth aspect of the present application, a network connection device is proposed for mutual aid devices, which are connected to a first network through a routing device. The connection device includes: a response unit, which is used to generate and send response information based on the connection request when receiving a connection request from the device to be connected, wherein the response information is used for the device to be connected to determine the mutual aid device to be connected; a negotiation unit, which is used 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 second connection unit, which is used to establish a network connection with the device to be connected based on the key.

[0020] The network connection device provided in this application can connect the device to be connected to a mutual assistance device if the device to be connected does not meet the connection conditions of the first network, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength received by the routing device from the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0021] According to a fifth aspect of the present application, an electronic device is proposed, comprising: a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs 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.

[0022] The electronic device provided in this application includes a memory and a processor, and also includes a program or instruction stored in the memory. When the program or instruction is executed by the processor, it can implement the steps of the network connection method of the above-mentioned first aspect and / or second aspect. Therefore, the electronic device has all the beneficial effects of the above-mentioned network connection method, which will not be repeated here.

[0023] According to a sixth aspect of the present application, a computer-readable storage medium is proposed, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the network connection method provided in the first aspect and / or the second aspect are implemented.

[0024] The computer-readable storage medium provided in this application stores a program or instruction thereon. When the program or instruction is executed by the processor, it can implement the steps of the network connection method provided in the first aspect and / or the second aspect. Therefore, the computer-readable storage medium has all the beneficial effects of the above-mentioned network connection method and will not be repeated here.

[0025] According to a seventh aspect of the present application, a computer program product is proposed, comprising a computer program or instructions, which, when executed by a processor, implement the steps of the network connection method provided in the first aspect and / or the second aspect.

[0026] The computer program product provided in this application includes a computer program or instructions. When the computer program or instructions are executed by a 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 and will not be repeated here.

[0027] Additional aspects and advantages of the present application will become apparent in the following description or may be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0029] FIG1 shows a schematic diagram of a flow chart of a network connection method according to an embodiment of the present application;

[0030] FIG2 shows a second flow chart of a network connection method according to an embodiment of the present application;

[0031] FIG3 shows one structural block diagram of a network connection device according to an embodiment of the present application;

[0032] FIG4 shows a second structural block diagram of a network connection device according to an embodiment of the present application;

[0033] FIG5 shows a topological diagram of a network connection provided according to an embodiment of the present application;

[0034] FIG6 is a schematic diagram showing an address mode during data transmission in a network connection method according to an embodiment of the present application;

[0035] FIG7 shows one of the address link diagrams of the network connection method provided according to an embodiment of the present application;

[0036] FIG8 shows a second address link diagram of the network connection method provided according to an embodiment of the present application.

[0037] The corresponding relationship between the reference numerals and component names in FIG3 to FIG5 is as follows:

[0038] 300 network connection device, 302 sending unit, 304 receiving unit, 306 determination unit, 308 search unit, 310 first connection unit, 400 network connection device, 402 response unit, 404 negotiation unit, 406 second connection unit, 502 device to be connected, 504 routing device, 506 mutual assistance device, 508 target mutual assistance device. DETAILED DESCRIPTION

[0039] In order to more clearly understand the above-mentioned objects, features and advantages of the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features therein can be combined with each other in the absence of conflict.

[0040] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.

[0041] The following describes a network connection method, a connection device, an electronic device, and a readable storage medium provided according to some embodiments of the present application with reference to Figures 1 to 8.

[0042] As shown in FIG1 , according to one embodiment of the present application, a network connection method is proposed, which is performed by a device to be connected. The connection method includes:

[0043] S102, sending a first connection request for a first network to a routing device;

[0044] S104, receiving first response information corresponding to the first connection request sent by the routing device;

[0045] S106, determining a connection condition of the first network according to the first response information;

[0046] 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;

[0047] Wherein, the mutual aid device is connected to the first network via the routing device;

[0048] S110 , connecting to a first network through at least one mutual assistance device.

[0049] The network connection method provided in 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.

[0050] Specifically, first, the device to be connected is controlled to send a connection request for a first network to the routing device. The first network may be a network to which the routing device is connected. Controlling the device to be connected to send the connection request for the first network, i.e., sending a connection request to the routing device to request the device to be connected to connect to the routing device, thereby enabling the device to be connected to the first network through the routing device.

[0051] Furthermore, the routing device may send feedback information to the device to be connected after receiving the connection request from the device to be connected, and the device to be connected may receive the first response information sent by the routing device, and determine whether the device to be connected meets the connection conditions of the first network based on the first response information sent by the routing device. Specifically, the connection condition of the first network may be whether the strength of the network signal of the routing device received by the device to be connected is greater than a preset strength. It can be understood that if the strength 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 be stably connected to the routing device, so that it can stably and continuously access the first network. If the strength 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 to be unable to connect to the routing device, or frequent disconnections will occur. The preset strength of the network signal can be set to -55dBm.

[0052] Furthermore, if the device to be connected does not meet the connection conditions of the first network, at least one mutual assistance device is searched for. 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, thereby connecting to the first network through the routing device. Specifically, the mutual assistance device can be a household appliance that can achieve Internet access, such as a television, air conditioner, refrigerator, etc.

[0053] Furthermore, after searching for the mutual aid device, the device to be connected can be connected to the mutual aid device, thereby connecting the device to be connected to the first network through the mutual aid device, so that the device to be connected can access the Internet through the first network.

[0054] The network connection method provided by this application can connect the device to be connected to the mutual assistance device by searching for at least one mutual assistance device connected to the first network when the device to be connected does not meet the connection conditions of the first network. This allows the device to be connected to the mutual assistance device, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength of the routing device received by the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0055] In some embodiments, exemplarily, connecting to the first network through at least one mutual aid device includes: sending a second connection request for the first network to at least one mutual aid device; receiving second response information corresponding to the second connection request sent by at least one mutual aid device; determining a target mutual aid device in at least one mutual aid device based on the at least one second response information; and establishing a network connection with the target mutual aid device.

[0056] In this embodiment, when the device to be connected cannot connect to the first network through the routing device, it can send a second connection request to at least one mutual assistance device and wait for second response information sent by the mutual assistance device.

[0057] Furthermore, after receiving the second response information sent by at least one mutual assistance device, a target mutual assistance device to be connected is determined in the at least one mutual assistance device according to the second response information of each mutual assistance device.

[0058] It can be understood that when there is only one mutual aid device, after receiving the second response information of the mutual aid device, it can be determined that the device is the target mutual aid device that needs to be connected. At this time, the device to be connected can be controlled to connect to the mutual aid device, thereby realizing connection to the first network through the mutual aid device.

[0059] When there are two or more mutual assistance devices, the device to be connected can receive multiple second response messages. In this case, the target mutual assistance device to be connected can be determined from the multiple mutual assistance devices based on the multiple second response messages. In other words, based on the second response messages from the multiple mutual assistance devices, the target mutual assistance device that is most suitable for the current device to be connected to is determined from the multiple mutual assistance devices, and the device to be connected is further controlled to connect to the target mutual assistance device, thereby ensuring the stability of the device to be connected after connecting to the first network.

[0060] In some embodiments, illustratively, establishing a network connection with a 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 based on a key generated by the mutual assistance device.

[0061] In this embodiment, in the process of connecting the device to be connected to the target mutual aid device, key negotiation can be controlled between the device to be connected and the mutual aid device, so that the mutual aid device generates a key, and then the device to be connected and the mutual aid device can be connected based on the generated key.

[0062] Through key negotiation between the device to be connected and the mutual aid device, a key between the two devices can be generated. During data transmission between the device to be connected and the mutual aid device, the key generated by key negotiation can be used to encrypt the data to ensure the security of data transmission between the device to be connected and the mutual aid device.

[0063] In some embodiments, exemplarily, the first connection request includes a first ciphertext, which is obtained by encrypting a first text based on the public key of the mutual aid device, and performing key negotiation with the target mutual aid device includes: receiving a second ciphertext sent by the mutual aid device, wherein the second ciphertext is obtained by encrypting the first text and the second text by the mutual aid device, the first text is obtained by decrypting the first ciphertext by the mutual aid device, and the second text is the text for key negotiation between the mutual aid device and the device to be connected; decrypting the second ciphertext to generate a third text; determining the negotiation result of the key negotiation based on the third text; and sending the negotiation result to the mutual aid device, wherein the negotiation result is used for reception by the mutual aid device to instruct the mutual aid device to generate a key.

[0064] In this embodiment, the device to be connected first sends a first ciphertext to the target mutual aid device. The first ciphertext is obtained by encrypting the first text using the public key of the target mutual aid device. The mutual aid device then receives the first ciphertext from the device to be connected and decrypts the first ciphertext to generate the first text.

[0065] Furthermore, after decrypting the first text, the mutual-assistance device can encrypt the first text and the second text using the mutual-assistance device's public key to generate a second ciphertext. The second ciphertext is a preset text used for key negotiation between the mutual-assistance device and the device to be connected. The second ciphertext is then sent to the device to be connected.

[0066] Furthermore, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. The device to be connected then determines the negotiation result of the key negotiation with the mutual assistance device based on the third text.

[0067] Furthermore, when it is determined that the negotiation result of the key negotiation is successful, the mutual assistance device may generate a key according to the first text and the second text.

[0068] During the key negotiation process, the connecting device and the assisting device generate a first ciphertext and a second ciphertext based on each other's public key. After decrypting the first and second ciphertexts, the generated third ciphertext is used to determine the key negotiation result, thereby achieving key negotiation between the connecting device and the assisting device and ensuring the accuracy of the negotiation result.

[0069] In some embodiments, exemplarily, determining a negotiation result of the key negotiation based on the third text includes: obtaining text content of the third text; and determining that the negotiation result is successful when the text content of the third text includes the first text.

[0070] In this embodiment, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. The device to be connected then determines the negotiation result of the key negotiation with the mutual assistance device based on the third text.

[0071] Specifically, the text content of the third text can be obtained first 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 aid device generated the third text based on the first text sent by the device to be connected, and then it can be determined that the negotiation result of the key negotiation between the mutual aid device and the device to be connected is successful, and then the mutual aid device can generate a key based on the first text and the second text.

[0072] In some embodiments, illustratively, sending the negotiation result to the mutual assistance device includes: encrypting the negotiation result based on the public key of the device to be connected to generate a third ciphertext; and sending the third ciphertext to the mutual assistance device.

[0073] In this embodiment, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. The device to be connected then determines the negotiation result of the key negotiation with the mutual assistance device based on the third text.

[0074] Furthermore, after the device to be connected determines that the negotiation result of the key negotiation is successful based on the third text, the negotiation result can be encrypted based on the public key of the device to be connected to generate a third ciphertext, and then the third ciphertext can be sent to the mutual aid device to notify the mutual aid device of the negotiation result.

[0075] Furthermore, after the mutual aid device receives the third ciphertext, it can decrypt the third ciphertext to determine whether the negotiation result is successful. After the mutual aid device receives the negotiation result, it can generate a target key based on the first text and the second text.

[0076] Specifically, the negotiation result may be the text "ok".

[0077] In some embodiments, exemplarily, determining a target mutual aid device among at least one mutual aid device based on at least one second response information includes: determining network parameters of multiple mutual aid devices based on multiple second response information; and determining the target mutual aid device among multiple mutual aid devices based on the network parameters.

[0078] In this embodiment, upon receiving first response information sent by multiple mutual assistance devices, network parameters of the multiple mutual assistance devices can be determined based on the multiple first response information. Furthermore, based on the network parameters of the multiple mutual assistance devices, a target mutual assistance device is determined from the multiple mutual assistance devices, and the device to be connected is then controlled to connect to the target mutual assistance device, thereby connecting the device to be connected to the first network through the target mutual assistance device.

[0079] It can be understood that the network parameters of the mutual aid device can represent the connection stability between the mutual aid device and the device to be connected, and then based on the network parameters of multiple mutual aid devices, the target mutual aid device with the most stable connection with the device to be connected is determined among multiple mutual aid devices, thereby improving the stability of the device to be connected after connecting to the first network.

[0080] The target mutual aid device is screened through the network parameters of the mutual aid device, further improving the stability of the network connection between the device to be connected and the target mutual aid device, thereby improving the networking experience of the device to be connected and further improving the user experience of using the device to be connected.

[0081] In some embodiments, exemplarily, the network parameters include signal strength, the network level of the mutual aid device in the first network, and the number of access points of the mutual aid device. Determining a target mutual aid device among multiple mutual aid devices based on the network parameters includes: determining a connection index of the mutual aid device based on at least any one of the signal strength, the network level, and the number of access points; and determining the target mutual aid device among multiple mutual aid devices based on the connection index.

[0082] In this embodiment, a target mutual aid device is identified from among multiple mutual aid devices based on the response information sent by the multiple mutual aid devices. Initially, a preliminary selection can be made based on the mutual aid device's signal strength, the number of layers of the mutual aid device in the first network, and the number of device points to which the mutual aid device is connected. Specifically, mutual aid devices with a signal strength greater than -55dBm, a number of layers less than or equal to 4, and fewer than 6 connection points can be selected.

[0083] Furthermore, among the screened mutual aid devices, the connection index of the mutual aid device is determined based on the signal strength of the mutual aid device, the number of layers of the mutual aid device in the first network, and the number of device points connected to the mutual aid device, and the mutual aid device with the largest connection index is determined as the target mutual aid device.

[0084] It can be understood that the connection index of the mutual aid device can be used to indicate the network connection stability information after the connection between the mutual aid device and the device to be connected. The connection index of the mutual aid device is determined by the signal strength of the device, the number of layers of the mutual aid device in the first network and the number of device points connected to the mutual aid device, so as to determine the connection index and determine the target mutual aid device, thereby ensuring that the device to be connected and the target mutual aid device can maintain a stable connection, thereby ensuring the networking experience of the device to be connected.

[0085] Furthermore, the connection index of the mutual aid device is determined based on at least any one of the signal strength, the network level and the number of access points, including: obtaining the strength weight corresponding to the signal strength and the strength scores corresponding to different signal strengths; obtaining the point weight corresponding to the number of access points and the point scores corresponding to different numbers of access points; obtaining the level weight corresponding to the network level and the level scores corresponding to different network levels; determining the connection index according to a preset formula P=A×a+B×b+C×c; wherein 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.

[0086] Specifically, we can first determine the signal strength of the mutual aid device and the strength weight and strength score corresponding to the signal strength, the layer weight and layer score corresponding to the number of layers, and the point weight and point score corresponding to the number of connection points, and further calculate the connection index of each mutual aid device.

[0087] Specifically, the connection index can be calculated according to the preset 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.

[0088] In some embodiments, illustratively, determining the connection condition of the first network according to the first response information includes: determining the signal strength of the routing device according to the first response information; and determining the connection condition according to the signal strength.

[0089] In this embodiment, to determine whether the device to be connected meets the connection conditions with the routing device, the signal strength of the routing device is first determined based on the first response information of the routing device. If the network signal strength of the routing device that the device to be connected can receive is high, it means that the device to be connected can be stably connected to the routing device, thereby being able to stably and continuously access the first network. If the network signal strength of the routing device that the device to be connected can receive is low, the device to be connected will be unable to connect to the routing device, or may experience frequent disconnections. At this point, the first response information of multiple mutual aid devices can be received, and then the target mutual aid device can be determined based on the first response information of the multiple mutual aid devices, so as to achieve connection to the first network through the target mutual aid device.

[0090] Among them, the preset strength of the network signal can be set to -55dBm.

[0091] In some embodiments, illustratively, determining the connection condition of the first network according to the first response information includes: determining that the device to be connected does not meet the connection condition when the first response information includes a preset data packet.

[0092] In this embodiment, determining whether the device to be connected meets the connection conditions with the routing device can also be determined based on whether the received first response information includes a preset data packet. Specifically, if the received first response information does not include the preset data packet, it indicates that the device to be connected can stably connect to the routing device, thereby stably and continuously accessing the first network.

[0093] If the first response information includes a preset data packet, it means that the device to be connected does not meet the connection conditions for connecting to the routing device. At this time, the first response information of multiple mutual aid devices can be received, and then the target mutual aid device can be determined based on the first response information of the multiple mutual aid devices to achieve connection to the first network through the target mutual aid device.

[0094] In some embodiments, exemplarily, after connecting to the first network through at least one mutual aid device, the connection method further includes: sending a detection signal to the target mutual aid device according to a preset time interval; receiving a reply signal sent by the target mutual aid device; and detecting the connection status of the device to be connected and the target mutual aid device based on the detection signal and the reply signal.

[0095] In this embodiment, after the device to be connected is connected to the first network through the target mutual assistance device, the device to be connected sends a detection signal to the target mutual assistance device according to a preset time interval. Specifically, the preset time interval can be 1 minute, that is, a detection signal is sent every 1 minute. Furthermore, if the target mutual assistance device does not receive a detection signal from the device to be connected within 2 minutes, it is considered that the device to be connected is lost and the relevant information of the device to be connected is cleared. In addition, if the device to be connected does not receive a response to the detection signal from the target mutual assistance device, it means that the connection has failed, and it is necessary to notify all devices under the node to clear the connection relationship and search the network again.

[0096] By sending the detection signal of the device to be connected, the connection status between the device to be connected and the target mutual aid device can be detected in real time, and then it can be determined in time whether the device to be connected and the target mutual aid device are connected. In the case that the device to be connected and the target mutual aid device are disconnected, the connection process can be re-initiated to ensure the connection effect of the device to be connected.

[0097] As shown in FIG2 , according to one embodiment of the present application, a network connection method is proposed, which is performed by a mutual assistance device. The mutual assistance device is connected to a first network through a routing device. The connection method includes:

[0098] S202, upon receiving a connection request from a device to be connected, generating and sending a response message according to the connection request;

[0099] The response information is used by the device to be connected to determine the mutual assistance device to be connected;

[0100] S204: upon receiving a key negotiation request from the device to be connected, performing key negotiation with the device to be connected to generate a key;

[0101] S206: Establish a network connection with the device to be connected based on the key.

[0102] The network connection method provided by the present application is that when a mutual aid device receives a connection request from a device to be connected, the mutual aid device can generate and send a response message based on the connection request. The response message is sent by the user to the device to be connected so that the device to be connected can determine the mutual aid device to be connected based on the response information.

[0103] It is understandable that the connection request sent by the device to be connected may be sent to multiple mutual aid devices at the same time. Each mutual aid device will send response information to the connection request of the device to be connected. The device to be connected can determine the mutual aid device that needs to be connected based on the response information received from multiple mutual aid devices.

[0104] Furthermore, after the device to be connected determines the mutual aid device to be connected, it will send a key negotiation request to the mutual aid device. After the mutual aid device and the device to be connected have completed the key negotiation, a key will be generated. Finally, the mutual aid device can establish a network connection with the device to be connected based on the generated key.

[0105] The network connection method provided by this application can connect the device to be connected to a mutual assistance device if the device to be connected does not meet the connection conditions of the first network, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength received by the routing device from the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0106] In some embodiments, exemplarily, upon receiving a key negotiation request from the device to be connected, key negotiation is performed with the device to be connected to generate a key, including: upon receiving a first ciphertext from the device to be connected, decrypting the first ciphertext to generate a first text; encrypting the first text and the second text to generate and send a second ciphertext; wherein the second text is a preset text for key negotiation between the mutual aid device and the device to be connected; receiving a key negotiation result sent by the device to be connected, and if the key negotiation result is successful, generating a key based on the first text and the second text; wherein the key negotiation result is determined by the device to be connected based on a third text obtained by decrypting the second ciphertext.

[0107] In this embodiment, the device to be connected first sends a first ciphertext to the target mutual aid device. The first ciphertext is obtained by encrypting the first text using the public key of the target mutual aid device. The mutual aid device then receives the first ciphertext from the device to be connected and decrypts the first ciphertext to generate the first text.

[0108] Furthermore, after decrypting the first text, the mutual-assistance device can encrypt the first text and the second text using the mutual-assistance device's public key to generate a second ciphertext. The second ciphertext is a preset text used for key negotiation between the mutual-assistance device and the device to be connected. The second ciphertext is then sent to the device to be connected.

[0109] Furthermore, after receiving the second ciphertext, the device to be connected can decrypt the second ciphertext to generate a third text. The device to be connected then determines the negotiation result of the key negotiation with the mutual assistance device based on the third text.

[0110] Furthermore, when it is determined that the negotiation result of the key negotiation is successful, the mutual assistance device may generate a key according to the first text and the second text.

[0111] During the key negotiation process, the connecting device and the assisting device generate a first ciphertext and a second ciphertext based on each other's public key. After decrypting the first and second ciphertexts, the generated third ciphertext is used to determine the key negotiation result, thereby achieving key negotiation between the connecting device and the assisting device and ensuring the accuracy of the negotiation result.

[0112] In some embodiments, exemplarily, after establishing a network connection with the device to be connected based on the key, the network connection method further includes: updating a device node link connected to the first network.

[0113] In this embodiment, after the device to be connected is connected to the target mutual assistance device, the device node link of the first network needs to be updated. This ensures that the device node link connected to the first network is accurately determined, and further ensures that data transmission in the first network can be carried out according to the correct device node link, thereby ensuring the accuracy of data transmission.

[0114] Further, updating the device node link connected to the first network includes:

[0115] Acquire an original link of the first network, wherein the original link is a device node link of the first network before the device to be connected is connected to the target mutual assistance device;

[0116] In the original link, if there is no device node downstream of the device node of the mutual aid device, add the device node of the device to be connected downstream of the device node of the mutual aid device;

[0117] If there is a device node downstream of the device node of the mutual aid device in the original link, the original link is copied to generate a duplicate link;

[0118] Replace the downstream device node of the mutual aid device in the replication link with the device node of the device to be connected.

[0119] Specifically, after the device to be connected is connected to the mutual aid device, the original link of the first network is obtained, that is, the device node link of the first network before the device to be connected is connected to the mutual aid device. Then, in the original link of the first network, it is determined whether there is a device node connected downstream of the mutual aid device.

[0120] In the original link of the first network, if there is no device node downstream of the mutual aid device, the device node of the device to be connected can be directly added downstream of the mutual aid device in the original link to implement the update of the device node link of the first network.

[0121] If the downstream node of the mutual-assistance device is already occupied, that is, a device node exists downstream of the mutual-assistance device, the original link of the first network can be supplemented to generate a duplicate link. In this case, the duplicate link is identical to the original link of the first network. The downstream device node of the mutual-assistance device in the duplicate link is then replaced with the device node of the device to be connected, thereby generating a new device node link and completing the update of the device node link of the first network.

[0122] Furthermore, after the device node link of the first network is updated, 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, to facilitate the data transmission process. Each device can locate the next device node to be transmitted according to the routing table.

[0123] In some embodiments, exemplarily, the connection method further includes: sending the key to all devices connected to the mutual assistance device.

[0124] In this embodiment, after generating the target key, the mutual assistance device sends the target key to the device to be connected, so that the device to be connected can transmit data with the mutual assistance device based on the target key.

[0125] In addition, the mutual aid device can also send the target key to other devices connected to it, so that other devices can encrypt and decrypt data based on the target key when transmitting data with the device to be connected through the mutual aid device, thereby ensuring the security of data transmission between other devices and the device to be connected through the mutual aid device.

[0126] In a specific embodiment, as shown in FIG5 , when the device to be connected 502 needs to connect to the first network, first, the device to be connected 502 is controlled to send a connection request to the first network to discover a connectable Internet device. Specifically, the device to be connected 502 can send a connection request every 0.5 seconds. If no response is received from other devices for a long time, the device to be connected 502 can send a request at a random interval of 0.1 seconds within 5 seconds. At the same time, the device to be connected 502 will also listen to the beacon sent by the routing device 504, and make a comprehensive judgment based on the device information of the scanned wireless access point and the mutual assistance device 506 to determine whether to connect to the routing device 504 or the mutual assistance device 506.

[0127] Specifically, during information exchange between the device to be connected 502, the routing device 504, and the mutual assistance device 506, the information sent includes multiple fields, among which key fields include capability display, frame type, message ID, CMD, and layer. In one embodiment, the key fields are described as follows: Capability 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: a global ID set by the initiator, and the responder returns the same ID; CMD: 01: key negotiation; 02: password update; 03: routing table update; layer: the network layer number of the mutual assistance device 506. 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 layer 1, the leaf of connection 1 is layer 2, and so on. The layer range can be less than or equal to 4 layers.

[0128] Specifically, the connection request sent by the device to be connected 502 may include the following fields: protocol version, capability display, frame type, message ID, CMD, negotiation step, Pubkey, Sha, and R1. In one embodiment, the protocol version is used to indicate the version of the communication protocol of the connection request sent; the capability display is used to indicate 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 connection request sent; the message ID is used to display the ID information sent, and the ID is set by the initiator and the responder returns the same ID; CMD, 01 indicates key negotiation, 02 indicates password update, and 03 indicates routing table update; negotiation step is used to display the current process of the connection; Pub key is the public key generated by the device to be connected 502; Sha is the ciphertext encryption method; R1 is the ciphertext encrypted based on the public key.

[0129] Furthermore, after receiving the response information from 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 based on the response information from 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 -55dBm, the device to be connected 502 will be unable to connect to the routing device 504 or may experience frequent disconnections. At this point, it can be determined whether the response information from the mutual assistance device 506 has been received.

[0130] When the mutual aid device 506 receives a connection request, it performs a rule-based judgment before sending a response. The judgment criteria are: 1. It allows access to the device to be connected; 2. The device to be connected 502 is requesting access to the mutual aid device 506; 3. The name of the routing device 504 requesting access is the same as the network it is accessing. The response includes other information, such as the carrier's private information, the number of connected terminals, and the floor number.

[0131] Specifically, the response information sent by the mutual aid device 506 may include the following fields in addition to the fields in the connection request sent by the device to be connected 502: level, used to indicate the level of the mutual aid device 506 in the first network; number of access points, used to indicate the number of devices accessed by the mutual aid device 506; the strength of the network signal; R2, ciphertext encrypted based on the public key of the mutual aid device 506; R1.

[0132] Furthermore, based on the response information sent by the multiple mutual aid devices 506, a target mutual aid device 508 is determined from the multiple mutual aid devices 506. First, a preliminary selection can be made based on the signal strength of the mutual aid device 506, the number of layers of the mutual aid device 506 in the first network, and the number of device points to which the mutual aid device 506 is connected. Specifically, mutual aid devices 506 with a signal strength greater than -55dBm, a number of layers less than or equal to 4, and a number of connection points less than 6 can be selected.

[0133] Furthermore, among the selected mutual aid devices 506, a connection index of each mutual aid device 506 is determined based on the signal strength of each mutual aid device 506, the number of layers of each mutual aid device 506 in the first network, and the number of device points to which each mutual aid device 506 is connected. The mutual aid device 506 with the largest connection index is then determined as the target mutual aid device 508. Specifically, the signal strength of each mutual aid device 506, along with the corresponding strength weight and strength score, the corresponding layer weight and layer score, and the corresponding connection point weight and point score can be determined. The connection index of each mutual aid device 506 can then be further calculated.

[0134] 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, when the strength weight of the signal strength is 0.5 and the signal strength is -50dBm, the corresponding strength score is 4. When the point weight of the number of connection points is 0.5 and the number of connection points is 5, the point score is 4. When the layer weight of the number of layers is 0.3 and the number of layers is 3, the corresponding layer score is 4. When the model strength of the mutual aid device 506 is -50dBm, the number of connection points is 5, and the number of layers is 3, the connection index of the mutual aid device is: P=4×0.5+4×0.3+4×0.2=4.

[0135] Furthermore, after determining the target mutual assistance device 508, the device to be connected 502 is controlled to perform key negotiation with the target mutual assistance device 508 to generate a key for data transmission between the device to be connected 502 and the target mutual assistance device 508. The connection request sent by the device to be connected 502 includes a text R1 encrypted with the public key of the device to be connected 502. Correspondingly, the response information sent by the target mutual assistance device 508 to the device to be connected 502 includes R1 and the texts R1 and R2 encrypted with the public key of the device to be connected 502.

[0136] During the key negotiation process, the encryption key is obtained using the ECC encryption algorithm. When the device to be connected initiates the scan, it initiates the key negotiation, and the target mutual assistance device 508 responds to implement the second step of the key negotiation. Steps 3 and 4 use the ACTION frame to implement key confirmation.

[0137] First, after receiving the response from the target mutual-assistance device 508, the connecting device 502 decrypts the encrypted text. If the decrypted text includes R1, it indicates that the key negotiation between the connecting device 502 and the mutual-assistance device 506 is successful. The connecting device 502 then encrypts the negotiation result, "OK," using 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 based on R1 and R2, encrypts the text "OK" using the generated key, and sends it to the connecting device 502, completing the key negotiation. Data is then transmitted between the connecting device 502 and the mutual-assistance device 506 based on the generated key. Specifically, during the key negotiation process, the connecting device 502 sends key negotiation information using a 4-address mode action frame. The information sent by the connecting device 502 and the information sent by the mutual-assistance device 506 can include the following fields: protocol version, capability display, frame type, message ID, CMD, negotiation step, and ciphertext.

[0138] Furthermore, 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 aid device 508, the device node of the device to be connected 502 can be directly added to the downstream of the target mutual aid device 508 in the original link to realize the update of the device node link of the first network.

[0139] If the downstream node of the target mutual-assistance device 508 is already occupied, that is, a device node exists downstream of the target mutual-assistance device 508, the original link of the first network can be supplemented to generate a duplicate link. In this case, the duplicate link is identical to the original link of the first network. The downstream device node of the target mutual-assistance device 508 in the duplicate link is then replaced with the device node of the device to be connected 502, thereby generating a new device node link, completing the update of the device node link of the first network.

[0140] For example, as shown in Figures 7 and 8, the original link is ABCD. When E connects, D adds E to the end, resulting in ABCDE. Simultaneously, D's forward device node reports adding E to the end of the ABCD routing table. Upon receiving this information, each node adds E after D, completing node synchronization. If, at the same time, another node, F, is added to the ABCD-based route and attached to the end of D, D discovers that its end is already occupied, so it copies a connection and adds F to its end. Simultaneously, D synchronizes the information needed to be added to the end with the root node. If each node is occupied, it copies and adds it again. Each node then completes the two linked lists ABCDF and ABCDE. Specifically, the data sent to the forward device node for all node updates may include the following fields: protocol version; capability display; frame type; message ID; CMD; Sub, used to update the linked list for the associated network link; Len, used to indicate the length of the string, typically a multiple of 6; and Macdata, 6(N+2) bytes, where N represents the layer the device is currently on. Macs are little-endian aligned, starting with the mutual aid device connected to the routing device and proceeding in sequence. MACdata arrangement example: MACroot, MAC1, MAC2, ... MACend.

[0141] 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:

[0142] As shown in Figure 6, the 4-address mode is used for data transmission between the device to be connected 502 and the target mutual assistance device 508, and the 3-address mode is used for data transmission between the target mutual assistance device 508 and other mutual assistance devices 506, as well as 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 aid device 508: receiving address (RA)-physical address of the target mutual aid device 508, sending address (TA)-physical address of the device to be connected 502, target address (DA)-physical address of the host device, source address (SA)-physical address of the device to be connected 502; the target mutual aid device 508 sends 3 addresses to the routing device 504: receiving address (RA)-physical address of the routing device 504, source address (SA)-physical address of the target mutual aid device 508, target address (DA)-physical address of the host device; the routing device 504 sends 3 addresses to the host device: target address (DA)-physical address of the host device, sending address (TA)-physical address of the routing device 504, source address (SA)-physical address of the target mutual aid device 508.

[0143] The process of the host device sending data to the device to be connected 502: the host device sends three addresses to the routing device 504: receiving address (RA)-physical address of the routing device 504, source address (SA)-physical address of the host device, and target address (DA)-physical address of the target mutual aid device 508; the routing device 504 sends three addresses to the target mutual aid device 508: target address (DA)-physical address of the target mutual aid device 508, sending address (TA)-physical address of the routing device 504, and source address (SA)-physical address of the host device; the target mutual aid device 508 sends four addresses to the device to be connected 502: receiving address (RA)-physical address of the device to be connected 502, sending address (TA)-physical address of the target mutual aid device 508, target address (DA)-physical address of the device to be connected 502, and source address (SA)-physical address of the host device.

[0144] 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 aid device 508. If so, it is directly converted into a 4-address mode and sent to the target mutual aid device 508. If not, the data is sent step by step through the target mutual aid device 508 through the 4-address mode to the mutual aid device 506 connected to the routing device 504.

[0145] When the mutual assistance device 506 connected to the routing device 504 receives data sent by the routing device 504, it first determines whether the local logical address exists in the received data. If the local logical address exists, the data is transmitted to the application layer of the local computer. If not, the physical address of the next-level device is determined from the physical address routing table stored in the local computer, and the data is transmitted to the next-level device.

[0146] Furthermore, after the to-be-connected device 502 connects to the first network via the target mutual assistance device 508, the to-be-connected device 502 sends detection data to the target mutual assistance device 508 every minute. If the target mutual assistance device 508 does not receive the detection data from the to-be-connected device 502 within 2 minutes, the to-be-connected device 502 is considered lost and the relevant information of the to-be-connected device 502 is cleared. If the to-be-connected device 502 does not receive the detection data from the target mutual assistance device 508 and does not respond, it indicates that the connection has failed, and it is necessary to notify all devices under the node to clear the connection relationship and search the network again. The detection data may include the following fields: protocol version, capability display, frame type, message ID, and CMD.

[0147] Furthermore, after the to-be-connected device 502 is connected to the first network through the target mutual aid device 508, it is necessary to detect the connection anomaly of the to-be-connected device 502 in real time. Specifically, when the target mutual aid device 508 is disconnected from the routing device 504, the routing device 504 should retain the device information and address resolution protocol of all mutual aid devices 506 connected to it. After the routing device 504 is restarted, it is not necessary to clear the device information and address resolution protocol of the mutual aid devices 506 connected to the routing device 504. It is only necessary to clear the device address in the address resolution protocol. Then, an instruction is sent to the mutual aid device 506 connected to it to notify the mutual aid device 506 to re-initiate the dynamic host configuration protocol and update the physical address routing table so that the mutual aid device 506 can re-establish a connection with the routing device 504. 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.

[0148] Furthermore, when the target mutual assistance device 508 finds that it is disconnected from the routing device 504, it can send an instruction to the to-be-connected device 502 connected to it to notify the to-be-connected device 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.

[0149] According to the third aspect of the present application, as shown in Figure 3, a network connection device 300 is proposed for a device to be connected, and the network connection device 300 includes: a sending unit 302, used to send a first connection request for a first network to a routing device; a receiving unit 304, used to receive a first response information corresponding to the first connection request sent by the routing device; a determining unit 306, used to determine the connection condition of the first network based on the first response information; a searching unit 308, used to search for at least one mutual aid device when the device to be connected does not meet the connection condition of the first network, wherein the mutual aid device is connected to the first network through the routing device; a first connecting unit 310, used to connect to the first network through at least one mutual aid device.

[0150] The network connection device 300 provided in this application can connect the device to be connected to the mutual assistance device by searching for at least one mutual assistance device connected to the first network when the device to be connected does not meet the connection conditions of the first network, thereby connecting the device to be connected to the mutual assistance device, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength of the routing device received by the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0151] Furthermore, the sending unit 302 is also used to send a second connection request of the first network to at least one mutual aid device; the receiving unit 304 is also used to receive a second response information corresponding to the second connection request sent by at least one mutual aid device; the determination unit 306 is also used to determine the target mutual aid device in at least one mutual aid device based on at least one second response information; the first connection unit 310 is specifically used to establish a network connection with the target mutual aid device.

[0152] Furthermore, the first connection 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 based on the key generated by the mutual assistance device.

[0153] Furthermore, the first connection unit 310 is specifically used to receive a second ciphertext sent by the mutual aid device, wherein the second ciphertext is obtained by the mutual aid device encrypting the first text and the second text, the first text is obtained by the mutual aid device decrypting the first ciphertext, and the second text is a preset text for key negotiation between the mutual aid device and the device to be connected; decrypt the second ciphertext to generate a third text; determine the negotiation result of the key negotiation based on the third text; and send the negotiation result to the mutual aid device.

[0154] Furthermore, the first connection unit 310 is further configured to obtain text content of the third text; and when the text content of the third text includes the first text, determine that the negotiation result is successful.

[0155] Furthermore, the first connection unit 310 is further configured to encrypt the negotiation result based on the public key of the device to be connected to generate a third ciphertext; and send the third ciphertext to the mutual assistance device.

[0156] Furthermore, the network parameters include signal strength, the network level of the mutual aid device in the first network, and the number of access points of the mutual aid device. The determination unit 306 is specifically used to determine the connection index of the mutual aid device based on at least any one of the signal strength, network level, and number of access points; and determine the target mutual aid device among multiple mutual aid devices based on the connection index.

[0157] Furthermore, the determination unit 306 is specifically used to obtain the strength weight corresponding to the signal strength and the strength scores corresponding to different signal strengths; obtain the point weight corresponding to the number of access points and the point scores corresponding to different numbers of access points; obtain the level weight corresponding to the network level and the level scores corresponding to different network levels; determine the connection index according to the preset formula P=A×a+B×b+C×c; wherein 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.

[0158] Furthermore, the determining unit 306 is specifically configured to determine the signal strength of the routing device according to the first response information; and determine the connection condition according to the signal strength.

[0159] Furthermore, the determining unit 306 is further configured to determine that the device to be connected does not meet the connection condition when the first response information includes a preset data packet.

[0160] Furthermore, the sending unit 302 is also used to send a detection signal to the target mutual assistance device according to a preset time interval; receive a reply signal sent by the target mutual assistance device; the determination unit 306 is also used to detect the connection status between the device to be connected and the target mutual assistance device based on the detection signal and the reply signal.

[0161] According to the fourth aspect of the present application, as shown in Figure 4, a network connection device 400 is proposed, which is used for mutual assistance devices. The mutual assistance devices are connected to the first network through a routing device. The connection device includes: a response unit 402, which is used to generate and send response information according to the connection request when a connection request from the device to be connected is received, wherein the response information is used for the device to be connected to determine the mutual assistance device to be connected; a negotiation unit 404, which is used to perform key negotiation with the device to be connected and generate a key when a key negotiation request from the device to be connected is received; and a second connection unit 406, which is used to establish a network connection with the device to be connected based on the key.

[0162] The network connection device 400 provided in this application can connect the device to be connected to a mutual assistance device if the device to be connected does not meet the connection conditions of the first network, thereby connecting the device to be connected to the first network through the mutual assistance device, so that the device to be connected can access the Internet through the first network. This solves the problem of the network signal strength of the routing device received by the device to be connected being low, and the inability to ensure a continuous and stable connection to the first network through the routing device. By achieving a continuous and stable connection to the first network through the mutual assistance device, the device to be connected can improve the networking experience of the device to be connected, and thus improve the user experience of the device to be connected.

[0163] Furthermore, the negotiation unit 404 is specifically configured to, upon receiving a first ciphertext from the device to be connected, decrypt the first ciphertext to generate a first text; encrypt the first text and the second text to generate and send a second ciphertext; wherein the second text is a preset text for key negotiation between the mutual aid device and the device to be connected; receive a key negotiation result sent by the device to be connected, and when the key negotiation result is successful, generate a key based on the first text and the second text; wherein the key negotiation result is determined by the device to be connected based on a third text obtained by decrypting the second ciphertext.

[0164] Furthermore, the network connection device 400 further includes an updating unit configured to update the device node link connected to the first network.

[0165] Furthermore, the update unit is specifically used to obtain the original link of the first network, wherein the original link is the device node link of the first network before the device to be connected is connected to the target mutual aid device; in the original link, if there is no device node downstream of the device node of the target mutual aid device, the device node of the device to be connected is added downstream of the device node of the target mutual aid device; in the original link, if there is a device node downstream of the device node of the target mutual aid device, the original link is copied to generate a copied link; and the downstream device node of the target mutual aid device in the copied link is replaced with the device node of the device to be connected.

[0166] Furthermore, the network connection device 400 further includes an establishing unit configured to establish a device routing table of the first network.

[0167] Furthermore, the network connection device 400 further includes a sending unit configured to send the target key to all devices connected to the mutual assistance device.

[0168] According to a fifth aspect of the present application, an electronic device is proposed, comprising: a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the network connection method provided in any of the above embodiments are implemented.

[0169] The electronic device provided in this application includes a memory and a processor, and also includes a program or instruction stored in the memory. When the program or instruction is executed by the processor, it can implement the steps of the network connection method of any of the above-mentioned embodiments. Therefore, the electronic device has all the beneficial effects of the above-mentioned network connection method, which will not be repeated here.

[0170] According to a sixth aspect of the present application, a computer-readable storage medium is proposed, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the network connection method provided in any of the above embodiments are implemented.

[0171] The computer-readable storage medium provided in this application stores a program or instruction thereon. When the program or instruction is executed by the processor, it can implement a network connection method as in any of the above-mentioned embodiments. Therefore, the computer-readable storage medium has all the beneficial effects of the above-mentioned network connection method, which will not be repeated here.

[0172] According to a seventh aspect of the present application, a computer program product is proposed, comprising a computer program or instructions, which, when executed by a processor, implements the steps of the network connection method provided in any of the above embodiments.

[0173] The computer program product provided in this application includes a computer program or instructions. When the computer program or instructions are executed by a 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-mentioned network connection method and will not be repeated here.

[0174] In the description of this application, the term "plurality" refers to two or more than two. Unless otherwise expressly defined, the orientation or positional relationship indicated by the terms "upper" and "lower" is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application. The terms "connection", "installation", "fixed", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to the specific circumstances.

[0175] Throughout this specification, terms such as "one embodiment," "some embodiments," and "specific embodiments" mean that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0176] The above are merely preferred embodiments of the present application and are not intended to limit the present application. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A network connection method, performed by a device to be connected, wherein: 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 a connection condition of the first network according to the first response information; When the device to be connected does not meet the connection condition of the first network, searching for at least one mutual assistance device, wherein the mutual assistance device is connected to the first network through the routing device; Connecting to the first network via 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 comprises: Sending a second connection request of 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 from at least one of the mutual assistance devices according to at least one of the second response information; Establish a network connection with the target mutual assistance device.

3. The connection method according to claim 2, wherein: The establishing of a network connection with the target mutual assistance device includes: Performing key negotiation with the target mutual assistance device; A network connection is established with the target mutual assistance device according to the key generated by the mutual assistance device.

4. The connection method according to claim 3, wherein: The first connection request includes a first ciphertext, where the first ciphertext is obtained by encrypting a first text based on a public key of the mutual assistance device. The performing key negotiation with the target mutual assistance device includes: receiving a second ciphertext sent by the mutual assistance device, wherein the second ciphertext is obtained by the mutual assistance device encrypting the first text and the second text, the first text is obtained by the mutual assistance device decrypting the first ciphertext, and the second text is a preset text for the mutual assistance device to negotiate a key with the device to be connected; decrypting the second ciphertext to generate a third text; Determining a negotiation result of the key negotiation according to the third text; The negotiation result is sent to the mutual assistance device, wherein the negotiation result is used to be received by the mutual assistance device to instruct the mutual assistance device to generate the key.

5. The connection method according to claim 4, wherein: The determining, according to the third text, a negotiation result of the key negotiation includes: Acquire the text content of the third text; In a case where the text content of the third text includes the first text, the negotiation result is determined to be successful.

6. The connection method according to claim 4, wherein: The sending the negotiation result to the mutual assistance device comprises: Encrypting the negotiation result based on the public key of the device to be connected to generate a third ciphertext; The third ciphertext is sent to the mutual assistance device.

7. The connection method according to claim 2, wherein: The step of determining a target mutual assistance device from at least one of the mutual assistance devices according to at least one of the second response information includes: Determining network parameters of the plurality of mutual assistance devices according to the plurality of second response information; A target mutual assistance device is determined from among the plurality of mutual assistance devices according to the network parameters.

8. The connection method according to claim 7, wherein: The network parameters include signal strength, the network level of the mutual assistance device in the first network, and the number of access points of the mutual assistance device. Determining a target mutual assistance device from among the plurality of mutual assistance devices according to the network parameters includes: Determine a connection index of the mutual assistance device according to at least any one of the signal strength, the network level, and the number of access points; A target mutual assistance device is determined from among the plurality of mutual assistance devices according to the connection index.

9. The connection method according to claim 8, wherein: The determining the connection index of the mutual assistance device according to at least any one of the signal strength, the network level and the number of access points includes: Obtaining a strength weight corresponding to the signal strength and strength scores corresponding to different signal strengths; Obtaining point weights corresponding to the number of access points and point scores corresponding to different numbers of access points; Obtaining the level weight corresponding to the network level and the level scores corresponding to different network levels; Determine the connection index according to a preset formula P=A×a+B×b+C×c; Wherein, P is the connection index, A is the strength score, a is the strength weight, and B is The point score, b is the point weight, C is the level score, and c is the level weight.

10. The connection method according to any one of claims 1 to 9, wherein: The determining, according to the first response information, a connection condition of the first network includes: determining, according to the first response information, a signal strength of the routing device; The connection condition is determined according to the signal strength.

11. The connection method according to any one of claims 1 to 9, wherein: The determining, according to the first response information, a connection condition of the first network includes: In a case where the first response information includes a preset data packet, it is determined that the device to be connected does not meet the connection condition.

12. The connection method according to claim 7, wherein: After connecting to the first network through at least one of the mutual assistance devices, the connection method further includes: Sending a detection signal to the target mutual assistance device according to a preset time interval; Receiving a reply signal sent by the target mutual assistance device; The connection status between the device to be connected and the target mutual assistance device is detected according to the detection signal and the reply signal.

13. A network connection method, performed by a mutual assistance device, wherein: The mutual assistance device is connected to the first network via a routing device, and 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, wherein the response information is used for the device to be connected to determine the mutual assistance device to be connected; Upon receiving a key negotiation request from the device to be connected, performing key negotiation with the device to be connected to generate a key; A network connection is established with the device to be connected according to the key.

14. The connection method according to claim 13, wherein: The step of performing key negotiation with the device to be connected to generate a key upon receiving a key negotiation request from the device to be connected includes: Upon receiving the first ciphertext of the device to be connected, decrypting the first ciphertext to generate a first text; Encrypting the first text and the second text to generate and send a second ciphertext; The second text is a preset text for the mutual assistance device to negotiate a key with the device to be connected; receiving a key negotiation result sent by the device to be connected, and generating the key according to the first text and the second text when the key negotiation result is successful; The key negotiation result is determined by the device to be connected according to a third text obtained by decrypting the second ciphertext.

15. The connection method according to claim 13 or 14, wherein: After establishing a network connection with the device to be connected according to the key, the connection method further includes: A device node link connected to the first network is updated.

16. The connection method according to claim 15, wherein: The updating of the device node link connected to the first network includes: Acquire an original link of the first network, wherein the original link is a device node link of the first network before the device to be connected is connected; In the original link, if there is no device node downstream of the device node of the mutual assistance device, adding the device node of the device to be connected to the downstream of the device node of the mutual assistance device; In the original link, if there is a device node downstream of the device node of the mutual assistance device, copy the original link to generate a copy link; The downstream device node of the mutual assistance device in the replication link is replaced with the device node of the device to be connected.

17. The connection method according to claim 15, wherein: After the updating of the device node link connected to the first network, the connection method further comprises: A device routing table for the first network is established.

18. The connection method according to claim 13 or 14, wherein: The connection method further comprises: The key is sent to all devices connected to the mutual aid device.

19. A network connection device, used for a device to be connected, wherein: The connecting device comprises: 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 a 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, wherein the mutual assistance device is connected to the first network through the routing device; The first connecting unit is used to connect to the first network through at least one of the mutual assistance devices.

20. A network connection device for mutual assistance equipment, wherein: The mutual assistance device is connected to the first network via a routing device, and the connecting 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, 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 to generate a key when receiving a key negotiation request from the device to be connected; The second connecting unit is used to establish a network connection with the device to be connected according to the key.

21. An electronic device, wherein: include: A processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 12 and / or the steps of the method according to any one of claims 13 to 18 are implemented.

22. A computer-readable storage medium, wherein: The computer-readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 12 and / or the steps of the method according to any one of claims 13 to 18 are implemented.

23. A computer program product comprising a computer program or instructions, wherein: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 12 and / or the steps of the method according to any one of claims 13 to 18 are implemented.

Citation Information

Patent Citations

  • Network connection method and device, electronic equipment and readable storage medium

    CN120201582A

  • Network connection method and device, electronic equipment and readable storage medium

    CN120201583A

  • Network connection method and device, electronic equipment and readable storage medium

    CN120201584A

  • Networking control method and terminal devices

    CN106131899A

  • Network data transmission method, device and system

    CN108601057A