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

By sending connection requests in multiple network devices, determining network parameters and selecting target devices, the problem of how to determine the best device in multiple network devices to ensure stable network connections is solved, and a more stable network connection and a better user experience is achieved.

CN120201582APending Publication Date: 2025-06-24MIDEA GRP (SHANGHAI) CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311788094.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

After determining the best network device among multiple network devices to ensure that the electronic device is connected to the network, the stability of network connection is an urgent problem to be solved.

Method used

By sending a network connection request, receiving response information from multiple mutual aid devices, determining their network parameters, and selecting the target mutual aid device based on these parameters to establish a network connection.

Benefits of technology

Improve the stability of the devices to be connected to the network, thereby improving the user's networking experience and device usage experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120201582A_ABST
    Figure CN120201582A_ABST
Patent Text Reader

Abstract

The invention provides a network connection method and device, electronic equipment and a readable storage medium, the network connection method is executed by to-be-connected equipment, and the connection method comprises the following steps: sending a network connection request; under the condition that multiple pieces of first response information of multiple pieces of mutual assistance equipment are received, network parameters of the multiple pieces of mutual assistance equipment are determined according to the multiple pieces of first response information, and the multiple pieces of mutual assistance equipment are connected to a first network; determining a target mutual assistance device in the multiple mutual assistance devices according to the network parameters; and establishing a network connection with the target mutual assistance device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of the Internet of Things, and more particularly, to a method for connecting a network, a connection device, an electronic device, and a readable storage medium. Background Art

[0002] In the related art, when an electronic device needs to connect to a network, it is first necessary to determine the network devices that can be connected. Among them, the number of network devices that can be connected may be multiple. At this time, it is necessary to determine the best network device among the multiple connectable network devices to ensure the stability of the network connection after the electronic device is connected to the network. How to determine the best network device among multiple network devices has become an urgent problem to be solved. Summary of the Invention

[0003] The present application aims to solve at least one of the technical problems existing in the prior art.

[0004] To this end, a first aspect of the present application provides a method for connecting a network.

[0005] A second aspect of the present application provides a connection device for a network.

[0006] A third aspect of the present application provides an electronic device.

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

[0008] A fifth aspect of the present application provides a computer program product.

[0009] The first aspect of the present application provides a method for connecting a network, which is executed by a device to be connected. The connection method includes: sending a network connection request; in the case of receiving multiple first response messages from multiple mutual assistance devices, determining network parameters of the multiple mutual assistance devices according to the multiple first response messages, where the multiple mutual assistance devices are connected to a first network; determining a target mutual assistance device among the multiple mutual assistance devices according to the network parameters; and establishing a network connection with the target mutual assistance device.

[0010] The network connection method provided by the present application can be used to connect a device to be connected to a first network, so as to enable the device to be connected to access the Internet through the first network.

[0011] Specifically, first, control the device to be connected to send a connection request for the first network. Among them, the first network may be a network connected to a routing device. Controlling the device to be connected to send a connection request for the first network means sending a connection request to the routing device to request the device to be connected to the routing device, so as to enable the device to be connected to be connected to the first network through the routing device.

[0012] Further, after receiving a connection request from a device to be connected, the routing device can send feedback information to the device to be connected. Further, the device to be connected determines whether it meets the connection conditions of the first network according to the feedback information sent by the routing device. Specifically, the connection conditions of the first network can 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 stably connect 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 experience frequent disconnections. The preset strength of the network signal can be set to -55 dBm.

[0013] Further, in the case where the device to be connected does not meet the connection conditions of the first network, it can search for a mutual assistance device. Among them, the mutual assistance device is connected to the first network, that is, the mutual assistance device is connected to the routing device of the first network, so as to realize connecting to the first network through the routing device. Specifically, the mutual assistance device can be a household appliance that can realize the Internet access function, such as a TV set, an air conditioner, a refrigerator, etc.

[0014] Further, in the case of receiving the first response information sent by multiple mutual assistance devices, the network parameters of the multiple mutual assistance devices can be determined according to the multiple first response information. Further, according to the network parameters of the multiple mutual assistance devices, a target mutual assistance device is determined among the multiple mutual assistance devices, and then the device to be connected is controlled to connect to the target mutual assistance device, so as to realize connecting the device to be connected to the first network through the target mutual assistance device.

[0015] It can be understood that the network parameters of the mutual assistance device can represent the connection stability between the mutual assistance device and the device to be connected. Further, according to the network parameters of the multiple mutual assistance devices, the target mutual assistance device with the most stable connection to the device to be connected is determined among the multiple mutual assistance devices, so as to improve the stability after the device to be connected is connected to the first network.

[0016] The network connection method provided by this application, in the case where the device to be connected does not meet the connection conditions of the first network, searches for multiple mutual assistance devices connected to the first network, and determines the network parameters of the multiple mutual assistance devices according to the first response information of the multiple mutual assistance devices. Then, according to the network parameters of the mutual assistance devices, a target mutual assistance device is determined among the multiple mutual assistance devices. The device to be connected is connected to the target mutual assistance device, so as to connect the device to be connected to the first network through the target mutual assistance device, enabling the device to be connected to access the Internet through the first network. Moreover, by screening the target mutual assistance device based on the network parameters of the mutual assistance devices, the stability of the network connection between the device to be connected and the target mutual assistance device is further improved, thereby improving the network connection experience of the device to be connected, and further improving the user experience of using the device to be connected.

[0017] According to the second aspect of this application, a network connection device for a device to be connected is proposed. The connection device includes: a sending unit for sending a network connection request; a determining unit for determining the network parameters of multiple mutual assistance devices according to the multiple first response information of the multiple mutual assistance devices when receiving the multiple first response information of the multiple mutual assistance devices, where the multiple mutual assistance devices are connected to the first network; and determining a target mutual assistance device among the multiple mutual assistance devices according to the network parameters; a connection unit for establishing a network connection with the target mutual assistance device.

[0018] The network connection device provided by this application, in the case where the device to be connected does not meet the connection conditions of the first network, searches for multiple mutual assistance devices connected to the first network, and determines the network parameters of the multiple mutual assistance devices according to the first response information of the multiple mutual assistance devices. Then, according to the network parameters of the mutual assistance devices, a target mutual assistance device is determined among the multiple mutual assistance devices. The device to be connected is connected to the target mutual assistance device, so as to connect the device to be connected to the first network through the target mutual assistance device, enabling the device to be connected to access the Internet through the first network. Moreover, by screening the target mutual assistance device based on the network parameters of the mutual assistance devices, the stability of the network connection between the device to be connected and the target mutual assistance device is further improved, thereby improving the network connection experience of the device to be connected, and further improving the user experience of using the device to be connected.

[0019] According to the third aspect of this application, an electronic device is proposed, including: a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the network connection method provided in the first aspect are implemented.

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

[0021] According to the fourth aspect of the present application, a computer-readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by the processor, it implements the network connection method in any one of the above technical solutions.

[0022] The computer-readable storage medium provided by the present application stores a program or instruction. Since the program or instruction can implement the network connection method in any one of the above technical solutions when executed by the processor, the storage medium has all the beneficial effects of the above-mentioned network connection method, which will not be elaborated here.

[0023] According to the fifth aspect of the present application, a computer program product is provided, including a computer program or instruction. When the computer program or instruction is executed by the processor, it implements the network connection method in any one of the above technical solutions.

[0024] The computer program product provided by the present application includes a computer program or instruction. When the computer program or instruction is executed by the processor, it implements the network connection method in any one of the above technical solutions. Therefore, the computer program product has all the beneficial effects of the above-mentioned network connection method, which will not be elaborated here.

[0025] The additional aspects and advantages of the present application will become obvious in the following description section or be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The above and / or additional aspects and advantages of the present application will become obvious and easy to understand from the description of the embodiments in conjunction with the following drawings, where:

[0027] Figure 1 One of the flow diagrams showing the network connection method provided by the embodiment of the present application is shown;

[0028] Figure 2 Another flow diagram showing the network connection method provided by the embodiment of the present application is shown;

[0029] Figure 3 The structural block diagram of the data transmission device provided by the embodiment of the present application is shown;

[0030] Figure 4 The topology diagram of the network connection provided by the embodiment of the present application is shown;

[0031] Figure 5 Shows a schematic diagram of the address mode during data transmission provided according to an embodiment of the present application;

[0032] Figure 6 Shows one of the schematic diagrams of the address link of the network connection provided according to an embodiment of the present application;

[0033] Figure 7 Shows another schematic diagram of the address link of the network connection provided according to an embodiment of the present application.

[0034] Among them, Figure 3 and Figure 4 The corresponding relationship between the reference numerals and the component names in is:

[0035] The connection device of the 300 network, the sending unit 302, the determining unit 304, the connecting unit 306, the device to be connected 502, the routing device 504, the mutual assistance device 506, the target mutual assistance device 508. Specific embodiments

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

[0037] Many specific details are set forth in the following description in order to fully understand the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below.

[0038] The following refers to Figures 1 to 7 to describe a network connection method, a connection device and a computer-readable storage medium provided according to some embodiments of the present application.

[0039] As Figure 1 shown, according to an embodiment of the present application, a network connection method is proposed, which is executed by a device to be connected, and the connection method includes:

[0040] S102, sending a network connection request;

[0041] S104, in the case of receiving multiple first response messages from multiple mutual assistance devices, determining the network parameters of the multiple mutual assistance devices according to the multiple first response messages;

[0042] Among them, the multiple mutual assistance devices are connected to the first network;

[0043] S106, determining a target mutual assistance device among the multiple mutual assistance devices according to the network parameters;

[0044] S108. Establish a network connection with the target mutual assistance device.

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

[0046] Specifically, first, control the device to be connected to send a connection request for the first network. Among them, the first network can be the network connected by a routing device. Controlling the device to be connected to send a connection request for the first network means sending a connection request to the routing device to request the device to be connected to the routing device, so as to realize that the device to be connected is connected to the first network through the routing device.

[0047] Furthermore, after receiving the connection request from the device to be connected, the routing device can send feedback information to the device to be connected. Further, the device to be connected determines whether it meets the connection conditions of the first network according to the feedback information sent by the routing device. Specifically, the connection conditions of the first network can be whether the intensity of the network signal of the routing device received by the device to be connected is greater than a preset intensity. It can be understood that if the intensity of the network signal of the routing device that the device to be connected can receive is high, it means that the device to be connected can stably connect to the routing device, so that it can stably and continuously access the first network. If the intensity of the network signal of the routing device that the device to be connected can receive is low, it will cause the device to be connected unable to connect to the routing device or frequent disconnection. The preset intensity of the network signal can be set to -55dBm.

[0048] Furthermore, when the device to be connected does not meet the connection conditions of the first network, it can search for mutual assistance devices. Among them, the mutual assistance device is connected to the first network, that is, the mutual assistance device is connected to the routing device of the first network, so as to realize the connection to the first network through the routing device. Specifically, the mutual assistance device can be household appliances that can realize Internet access functions, such as televisions, air conditioners, refrigerators, etc.

[0049] Furthermore, when receiving the first response information sent by multiple mutual assistance devices, the network parameters of the multiple mutual assistance devices can be determined according to the multiple first response information. Further, according to the network parameters of the multiple mutual assistance devices, a target mutual assistance device is determined among the multiple mutual assistance devices, and then the device to be connected is controlled to connect to the target mutual assistance device, so as to realize that the device to be connected is connected to the first network through the target mutual assistance device.

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

[0051] The network connection method provided by this application, in the case where the device to be connected does not meet the connection conditions of the first network, searches for multiple mutual assistance devices connected to the first network, and determines the network parameters of the multiple mutual assistance devices according to the first response information of the multiple mutual assistance devices. Furthermore, based on the network parameters of the mutual assistance devices, the target mutual assistance device is determined among the multiple mutual assistance devices. Connect the device to be connected to the target mutual assistance device to achieve connecting the device to be connected to the first network through the target mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. Moreover, by screening the target mutual assistance device through the network parameters of the mutual assistance device, the stability of the network connection between the device to be connected and the target mutual assistance device is further improved, thereby improving the network connection experience of the device to be connected, and further improving the user experience of using the device to be connected.

[0052] According to an embodiment of the present application, as Figure 2 shown, a network connection method is proposed, including:

[0053] S202, send a network connection request;

[0054] S204, in the case of receiving multiple first response information of multiple mutual assistance devices, determine the network parameters of the multiple mutual assistance devices according to the multiple first response information;

[0055] Wherein, multiple mutual assistance devices are connected to the first network;

[0056] S206, determine the connection index of the mutual assistance device according to the signal strength, network level, and number of access points;

[0057] S208, determine the target mutual assistance device among the multiple mutual assistance devices according to the connection index;

[0058] S210, establish a network connection with the target mutual assistance device.

[0059] In this embodiment, the target mutual assistance device is determined among the multiple mutual assistance devices according to the response information sent by the multiple mutual assistance devices. First, a preliminary selection can be made according to the signal strength of the mutual assistance device, the number of layers of the mutual assistance device in the first network, and the number of devices connected by the mutual assistance device. Specifically, mutual assistance devices with a signal strength greater than -55 dBm, a number of layers less than or equal to 4 layers, and a number of connection points less than 6 can be screened out.

[0060] Further, among the selected mutual assistance devices, the connection index of the mutual assistance device is determined according to the signal strength of the mutual assistance device, the layer number of the mutual assistance device in the first network, and the number of devices connected to the mutual assistance device, and the mutual assistance device with the largest connection index is determined as the target mutual assistance device.

[0061] It can be understood that the connection index of the mutual assistance device can be used to indicate the network connection stability information after the connection between the mutual assistance device and the device to be connected. The connection index of the mutual assistance device is determined by the signal strength of the device, the layer number of the mutual assistance device in the first network, and the number of devices connected to the mutual assistance device, so as to realize the determination of the connection index, determine the target mutual assistance device, and further ensure that after the device to be connected and the target mutual assistance device, a stable connection can be maintained, and further ensure the networking experience of the device to be connected.

[0062] Further, determining the connection index of the mutual assistance device according to the signal strength, network level, and number of access points includes: obtaining the intensity weight corresponding to the signal strength and the intensity score corresponding to different signal strengths; obtaining the point weight corresponding to the number of access points and the point score corresponding to different numbers of access points; obtaining the layer weight corresponding to the network level and the layer score corresponding to different network levels; determining the connection index according to the preset formula P = A×a + B×b + C×c; where P is the connection index, A is the intensity score, a is the intensity weight, B is the point score, b is the point weight, C is the layer score, and c is the layer weight.

[0063] Specifically, first, the signal strength of the mutual assistance device, the intensity weight and intensity score corresponding to the signal strength, the layer weight and layer score corresponding to the layer number, and the point weight and point score corresponding to the number of connection points can be determined, and then the connection index of each mutual assistance device is further calculated.

[0064] 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 intensity score, a is the intensity weight, B is the point score, b is the point weight, C is the layer score, and c is the layer weight.

[0065] In some embodiments, preferably, in the case of receiving multiple first response messages of multiple mutual assistance devices, before determining the network parameters of the multiple mutual assistance devices according to the multiple first response messages, the connection method further includes: receiving a second response message of a routing device, where the multiple mutual assistance devices are connected to the first network through the routing device; determining the connection condition of the routing device according to the second response message; connecting to the routing device when the connection condition is satisfied; and receiving the multiple first response messages of the multiple mutual assistance devices when the connection condition is not satisfied.

[0066] In this embodiment, before the device to be connected receives the first response signals of multiple mutual assistance devices, it can first receive the second response signal of the routing device, and then determine the connection condition of the routing device according to the second response signal of the routing device, that is, determine whether the device to be connected can be directly connected to the routing device, that is, directly connect to the first network through the routing device. When the device to be connected meets the connection condition, it can control the device to be connected to be directly connected to the routing device to realize the connection of the device to be connected to the first network. If the device to be connected does not meet the connection condition, at this time, it can receive the first response information of multiple mutual assistance devices connected to the first network to determine the mutual assistance device to be connected, and realize the connection to the first network through the mutual assistance device.

[0067] In some embodiments, optionally, determining the connection condition of the routing device according to the second response information includes: determining the signal strength of the routing device according to the second response information; and determining the connection condition according to the signal strength.

[0068] In this embodiment, to determine whether the device to be connected meets the connection condition with the routing device, first determine the signal strength of the routing device according to the second response information of the routing device. 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 experience frequent disconnections. At this time, it can receive the first response information of multiple mutual assistance devices, and then determine the target mutual assistance device according to the first response information of multiple mutual assistance devices to realize the connection to the first network through the target mutual assistance device.

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

[0070] In some embodiments, optionally, determining the connection condition of the routing device according to the second response information includes: when the second response information includes a preset data packet, determining that the device to be connected does not meet the connection condition.

[0071] In this embodiment, to determine whether the device to be connected meets the connection condition with the routing device, it can also be judged according to whether the received second response information includes a preset data packet. Specifically, when the received second response information does not include a preset data packet, 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.

[0072] If the second response message includes a preset data packet, it indicates that the device to be connected does not meet the connection conditions for connecting to the routing device. At this time, the first response messages of multiple mutual assistance devices can be received, and then the target mutual assistance device can be determined according to the first response messages of the multiple mutual assistance devices, so as to realize connecting to the first network through the target mutual assistance device.

[0073] In some embodiments, preferably, after establishing a network connection with the target mutual assistance device, 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; and detecting the connection status between the device to be connected and the target mutual assistance device according to the detection signal and the reply signal.

[0074] 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. Further, if the target mutual assistance device does not receive the detection signal of the device to be connected for 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, when the device to be connected does not receive the reply of the target mutual assistance device to the detection signal, it indicates that the connection fails, and all devices under this node need to be notified to clear the connection relationship and search for the network again.

[0075] By sending the detection signal of the device to be connected, the connection status between the device to be connected and the target mutual assistance device can be detected in real time, and then it can be determined in time whether the device to be connected maintains a connection with the target mutual assistance device. In the case where the device to be connected is disconnected from the target mutual assistance device, the connection process can be restarted to ensure the connection effect of the device to be connected.

[0076] In a specific embodiment, as Figure 4 shown, when the device to be connected 502 needs to be connected to the first network, first, control the device to be connected 502 to send a connection request for the first network to discover connectable Internet devices. Specifically, the device to be connected 502 can send a connection request every 0.5 s. If no response from other devices is received for a long time, the device to be connected 502 can send requests at random number intervals of 0.1 s within 5 s. At the same time, the device to be connected 502 also listens to the beacon sent by the routing device 504, and makes a comprehensive judgment based on the scanned wireless access point and the device information of the mutual assistance device 506 to determine whether to connect to the routing device 504 or the mutual assistance device 506.

[0077] Specifically, during the information interaction process between the device to be connected 502, the routing device 504, and the mutual assistance device 506, the information sent includes multiple fields. Among them, the key fields include capability display, frame type, message ID, CMD, level, etc. 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: global ID, set by the initiator and the responder returns the same ID. CMD: 01: key negotiation; 02: password update; 03: routing table update; Level: the network layer where the mutual assistance device 506 is located. The mutual assistance device 506 directly connected to the routing device 504 is layer 0, the mutual assistance device 506 connected to the mutual assistance device 506 directly connected to the routing device 504 is 1, the leaf connected to 1 is 2... The level range can be less than or equal to 4 layers.

[0078] 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, R1. In one embodiment, the protocol version is used to indicate the version of the communication protocol of the sent connection request; the capability display is used to show whether the device to be connected 502 supports the connection of the mutual assistance device 506; the frame type is used to indicate the message type of the sent connection request; the message ID is used to show the sent ID information, set by the initiator and the responder returns the same ID; CMD, 01 represents key negotiation, 02 represents password update, 03 represents routing table update; the negotiation step is used to show the process in the current connection process; Pub key 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.

[0079] Further, after receiving the response information of the routing device 504, the strength of the network signal of the routing device 504 that the device to be connected 502 can receive is determined according to the response information of the routing device 504. If the strength of the network signal of the routing device 504 that the device to be connected 502 can receive is lower than -55 dBm, it will cause the device to be connected 502 to be unable to connect to the routing device 504 or experience frequent disconnections. At this time, it can be determined whether the response information of the mutual assistance device 506 is received.

[0080] When the mutual assistance device 506 receives a connection request, it sends a response message after rule judgment. The judgment rules are as follows: 1. It allows the device to be connected to access itself; 2. The device that the device 502 to be connected requests to access is the mutual assistance device 506; 3. The name of the routing device 504 requesting access is the same as the network it accesses itself. The response message includes other information such as merchant private information, the number of connected terminals, and the floor where it is located.

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

[0082] Further, according to the response messages sent by multiple mutual assistance devices 506, a target mutual assistance device 508 is determined among the multiple mutual assistance devices 506. First, a preliminary selection can be made according to the signal strength of the mutual assistance device 506, the floor of the mutual assistance device 506 in the first network, and the number of devices connected by the mutual assistance device 506. Specifically, the mutual assistance devices 506 with a signal strength greater than -55 dBm, a floor less than or equal to 4 floors, and a connection point number less than 6 can be screened out.

[0083] Further, among the screened mutual assistance devices 506, the connection index of the mutual assistance device 506 is determined according to the signal strength of the mutual assistance device 506, the floor of the mutual assistance device 506 in the first network, and the number of devices connected by the mutual assistance device 506, and the mutual assistance device 506 with the largest connection index is determined as the target mutual assistance device 508. Specifically, first, the signal strength of the mutual assistance device 506, the strength weight and strength score corresponding to the signal strength, the floor weight and floor score corresponding to the floor, and the point weight and point score corresponding to the number of connection points can be determined, and then the connection index of each mutual assistance device 506 is calculated.

[0084] Specifically, the connection index can be calculated according to the formula P = A×a + B×b + C×c, where P is the connection index, A is the strength score, a is the strength weight, B is the point score, b is the point weight, C is the level score, and c is the level weight. For example, the strength weight of the signal strength is 0.5, and when the signal strength is -50 dBm, the corresponding strength score is 4. The point weight of the number of connection points is 0.5, and when the number of connection points is 5, the point score is 4. The floor weight of the floor is 0.3, and when the floor is 3, the corresponding floor score is 4. When the signal strength of the mutual assistance device 506 is -50 dBm, the number of connection points is 5, and the floor is 3, the connection index of this mutual assistance device is: P = 4×0.5 + 4×0.3 + 4×0.2 = 4.

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

[0086] During the key negotiation process, the encryption key is obtained using the ECC encryption algorithm (elliptic curve encryption algorithm). While the connection device to be connected initiates a scan, it also initiates key negotiation, and the target mutual assistance device 508 responds to implement the second step of key negotiation. The third and fourth steps use ACTION frames to confirm the key.

[0087] First, after the connection device 502 to be connected receives the response information from the target mutual assistance device 508, it decrypts the encrypted text. If the decrypted text includes R1, it indicates that the key negotiation between the connection device 502 to be connected and the mutual assistance device 506 is successful. Then, the connection device 502 encrypts the negotiation result "OK" based on the public key of the mutual assistance device 506 and sends it to the mutual assistance device 506. After receiving the negotiation result, the mutual assistance device 506 generates a key based on R1 and R2, encrypts the text "OK" based on the generated key, and sends it to the connection device 502, and the key negotiation is completed. Then, data transmission is performed between the connection device 502 and the mutual assistance device 506 based on the generated key. Specifically, during the key negotiation process, the connection device 502 uses a 4-address mode action frame to send key negotiation information. Among them, the information sent by the connection device 502 and the information sent by the mutual assistance device 506 may include the following fields: protocol version, capability display, frame type, message ID, CMD, negotiation step, and ciphertext.

[0088] Further, after the key negotiation is completed, the device node link of the first network can be updated. Specifically, in the original link of the first network, if there is no device node downstream of the target mutual assistance device 508, the device node of the connection device 502 to be connected can be directly added downstream of the target mutual assistance device 508 in the original link to realize the update of the device node link of the first network.

[0089] If the downstream node of the target mutual assistance device 508 is occupied, that is, there is a device node downstream of the target mutual assistance device 508. At this time, the original link of the first network can be assisted to generate a replication link, and the replication link is the same as the original link of the first network. Then, the downstream device node of the target mutual assistance device 508 in the replication link is replaced with the device node of the device to be connected 502, so as to generate a new device node link and complete the update of the device node link of the first network.

[0090] For example, as Figure 6 and Figure 7 shown, the original link is A - B - C - D. When E accesses, D adds E to the end to get A - B - C - D - E. At the same time, the device node in front of D reports the direction to add E at the end of the A - B - C - D routing table. After each node receives this information, it will add E after D. The node synchronization is completed. If a new F is added to the end of D on the A - B - C - D path at the same time. At this time, D finds that its end is occupied, so it replicates a connection and adds F to the end of D. At the same time, the D node synchronizes the information that needs to be added to the end to the root node. If each node is occupied, it is also replicated and added. Each node gets the complete two linked lists of A - B - C - D - F and A - B - C - D - E. Specifically, the data sent to the device node in front can include the following fields: protocol version; ability display; frame type; message ID; CMD; Sub, which is used to update the linked list to the associated network link; Len, which is used to indicate the length of the string, usually a multiple of 6; Macdata, mac data, 6(N + 2) bytes, where N represents the layer where the device is currently located. Mac is in little - endian alignment and is arranged sequentially from the mutual assistance device connected to the routing device to the back. MACdata arrangement example: MAC root, MAC1, MAC2... MACend.

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

[0092] Such as Figure 5As shown in the figure, a 4-address mode is adopted for data transmission between the device to be connected 502 and the target mutual assistance device 508, and a 3-address mode is adopted 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 assistance device 508: receiving address (RA) - physical address of the target mutual assistance device 508, sending address (TA) - physical address of the device to be connected 502, destination address (DA) - physical address of the host device, source address (SA) - physical address of the device to be connected 502; The target mutual assistance 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 assistance device 508, destination address (DA) - physical address of the host device; The routing device 504 sends 3 addresses to the host device: destination 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 assistance device 508.

[0093] The process of the host device sending data to the device to be connected 502: The host device sends 3 addresses to the routing device 504: receiving address (RA) - physical address of the routing device 504, source address (SA) - physical address of the host device, destination address (DA) - physical address of the target mutual assistance device 508; The routing device 504 sends 3 addresses to the target mutual assistance device 508: destination address (DA) - physical address of the target mutual assistance device 508, sending address (TA) - physical address of the routing device 504, source address (SA) - physical address of the host device; The target mutual assistance device 508 sends 4 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 assistance device 508, destination address (DA) - physical address of the device to be connected 502, source address (SA) - physical address of the host device.

[0094] Specifically: When the device to be connected 502 actively sends data, it is detected whether the address resolution protocol (ARP table) of the device to be connected 502 contains the physical address of the target mutual assistance device 508. If so, it is directly sent to the target mutual assistance device 508 in 4-address mode. If not, the data is sent to the mutual assistance device 506 connected to the routing device 504 through the target mutual assistance device 508 in 4-address mode step by step.

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

[0096] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, the device to be connected 502 sends detection data to the target mutual assistance device 508 once every 1 minute. If the target mutual assistance device 508 does not receive the detection data of the device to be connected 502 for 2 minutes, it is considered that the device to be connected 502 is lost, and the relevant information of the device to be connected 502 is cleared; when the device to be connected 502 does not receive the detection data reply from the target mutual assistance device 508, it means that the connection fails, and all devices under this node need to be notified to clear the connection relationship and search for the network again. The detection data may include the following fields: protocol version, capability display, frame type, message ID, and CMD.

[0097] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, it is necessary to detect the connection exception of the device to be connected 502 in real time. Specifically, when the connection between the target mutual assistance device 508 and the routing device 504 is disconnected, the routing device 504 should retain the device information of all mutual assistance devices 506 connected to it and the address resolution protocol. After the routing device 504 is restarted, at this time, it is not necessary to clear the device information of the mutual assistance devices 506 connected to the routing device 504 and the address resolution protocol, and only the device addresses in the address resolution protocol need to be cleared. Then, an instruction is sent to the mutual assistance device 506 connected to it to notify the mutual assistance device 506 to re-initiate the Dynamic Host Configuration Protocol and update the physical address routing table, so that the mutual assistance device 506 and the routing device 504 re-establish the connection. Among them, the instruction sent by the routing device 504 may include the following fields: protocol version, capability display, frame type, message ID, and CMD.

[0098] Further, when the target mutual assistance device 508 finds that it is disconnected from the routing device 504, it can send an instruction to the device to be connected 502 connected to it to notify the device to be connected 502 to re-initiate the connection. Specifically, the instruction sent by the target mutual assistance device 508 may include the following fields: protocol version, capability display, frame type, message ID, and CMD.

[0099] According to the second aspect of the present application, as Figure 3As shown in the figure, a connection device 300 for a network is proposed, including: a sending unit 302 for sending a network connection request; a determining unit 304 for determining network parameters of a plurality of mutual assistance devices according to a plurality of first response messages received when receiving the plurality of first response messages of the plurality of mutual assistance devices, wherein the plurality of mutual assistance devices are connected to a first network; and determining a target mutual assistance device among the plurality of mutual assistance devices according to the network parameters; and a connecting unit 306 for establishing a network connection with the target mutual assistance device.

[0100] For the connection device 300 of the network provided in this application, when the device to be connected does not meet the connection conditions of the first network, by searching for a plurality of mutual assistance devices connected to the first network, and according to the first response messages of the plurality of mutual assistance devices, determining the network parameters of the plurality of mutual assistance devices, and then according to the network parameters of the mutual assistance devices, determining a target mutual assistance device among the plurality of mutual assistance devices. Connect the device to be connected to the target mutual assistance device to realize connecting the device to be connected to the first network through the target mutual assistance device, so that the device to be connected can realize the Internet access function through the first network. And, by screening the target mutual assistance device through the network parameters of the mutual assistance device, the stability of the network connection between the device to be connected and the target mutual assistance device is further improved, thereby improving the network connection experience of the device to be connected, and further improving the user experience of using the device to be connected.

[0101] Further, the network parameters include signal strength, network level of the mutual assistance device in the first network, and access points of the mutual assistance device. The determining unit 304 is specifically configured to determine a connection index of the mutual assistance device according to at least any one of the signal strength, network level, and access points; and determine a target mutual assistance device among the plurality of mutual assistance devices according to the connection index.

[0102] Further, the determining unit 304 is specifically further configured to obtain an intensity weight corresponding to the signal strength and intensity scores corresponding to different signal strengths; obtain a point weight corresponding to the access points and point scores corresponding to different access points; obtain a level weight corresponding to the network level and level scores corresponding to different network levels; determine the connection index according to a preset formula P = A×a + B×b + C×c; where P is the connection index, A is the intensity score, a is the intensity weight, B is the point score, b is the point weight, C is the level score, and c is the level weight.

[0103] Further, the determining unit 304 is further configured to receive a second response message of a routing device, wherein the plurality of mutual assistance devices are connected to the first network through the routing device; determine the connection conditions of the routing device according to the second response message; and the connecting unit is further configured to connect to the routing device when the connection conditions are met; and receive the plurality of first response messages of the plurality of mutual assistance devices when the connection conditions are not met.

[0104] Further, the determining unit 304 is specifically configured to determine the signal strength of the routing device according to the second response information; and determine the connection condition according to the signal strength.

[0105] Further, when the second response information includes a preset data packet, the determining unit 304 is specifically further configured to determine that the device to be connected does not meet the connection condition.

[0106] Further, the sending unit 302 is further configured 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; and the determining unit 304 is further configured to detect the connection state between the device to be connected and the target mutual assistance device according to the detection signal and the reply signal.

[0107] According to a third aspect of the present application, an electronic device is provided, including: a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the network connection method provided in the first aspect are implemented.

[0108] The electronic device provided by the present application includes a memory and a processor, and further includes a program or instruction stored on the memory. When the program or instruction is executed by the processor, the steps of the network connection method in any one of the above embodiments can be implemented. Therefore, the electronic device has all the beneficial effects of the above network connection method, which will not be elaborated here.

[0109] According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the network connection method in any one of the above embodiments is implemented.

[0110] The computer-readable storage medium provided by the present application stores a program or instruction. Since the program or instruction can implement the network connection method in any one of the above embodiments when executed by a processor, the storage medium has all the beneficial effects of the above network connection method, which will not be elaborated here.

[0111] According to a fifth aspect of the present application, a computer program product is provided, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the network connection method in any one of the above embodiments is implemented.

[0112] The computer program product provided by the present application includes a computer program or instruction, and when the computer program or instruction is executed by a processor, the network connection method in any one of the above embodiments is implemented. Therefore, the computer program product has all the beneficial effects of the above network connection method, which will not be elaborated here.

[0113] In the description of the present application, the term "a plurality of" means two or more. Unless otherwise clearly defined, the orientation or positional relationship indicated by terms such as "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings. This is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present application. Terms such as "connection", "installation", "fixation", etc. should all be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.

[0114] In the description of this specification, the description of terms such as "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or instance. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0115] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for connecting a network, which is executed by a device to be connected, characterized in that The connection method includes: Sending a network connection request; In the case of receiving multiple first response messages of multiple mutual assistance devices, determining network parameters of the multiple mutual assistance devices according to the multiple first response messages, wherein the multiple mutual assistance devices are connected to a first network; Determining a target mutual assistance device among the multiple mutual assistance devices according to the network parameters; Establishing a network connection with the target mutual assistance device.

2. The connection method according to claim 1, characterized in that, The network parameters include signal strength, network level of the mutual assistance device in the first network, and access points of the mutual assistance device. Determining a target mutual assistance device among the multiple mutual assistance devices according to the network parameters includes: Determining a connection index of the mutual assistance device according to at least any one of the signal strength, the network level, and the access points; Determining a target mutual assistance device among the multiple mutual assistance devices according to the connection index.

3. The connection method according to claim 2, characterized in that, Determining the connection index of the mutual assistance device according to the signal strength, the network level, and the access points includes: Obtaining an intensity weight corresponding to the signal strength and intensity scores corresponding to different signal strengths; Obtaining a point weight corresponding to the access points and point scores corresponding to different access points; Obtaining a level weight corresponding to the network level and 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 intensity score, a is the intensity weight, B is the point score, b is the point weight, C is the level score, and c is the level weight.

4. The connection method according to any one of claims 1 to 3, characterized in that, Before determining the network parameters of the multiple mutual assistance devices according to the multiple first response messages in the case of receiving the multiple first response messages of the multiple mutual assistance devices, the connection method further includes: Receiving a second response message of a routing device, wherein the multiple mutual assistance devices are connected to the first network through the routing device; Determining connection conditions of the routing device according to the second response message; Connecting to the routing device when the connection conditions are met; Receiving the multiple first response messages of the multiple mutual assistance devices when the connection conditions are not met.

5. The connection method according to claim 4, characterized in that, Determining the connection conditions of the routing device according to the second response message includes: Determining the signal strength of the routing device according to the second response message; Determining the connection conditions according to the signal strength.

6. The connection method according to claim 4, characterized in that, Determining the connection conditions of the routing device according to the second response message includes: Determining that the device to be connected does not meet the connection conditions when the second response message includes a preset data packet.

7. The connection method according to any one of claims 1 to 3, characterized in that, After establishing a network connection with the target mutual assistance device, the connection method further includes: Sending a detection signal to the target mutual assistance device at a preset time interval; Receiving a reply signal sent by the target mutual assistance device; Detecting a connection state between the device to be connected and the target mutual assistance device according to the detection signal and the reply signal.

8. A connection device for a network, for a device to be connected, characterized in that, The connection device includes: A sending unit, configured to send a network connection request; A determination unit, configured to determine network parameters of a plurality of mutual assistance devices according to a plurality of first response messages of the plurality of mutual assistance devices when receiving the plurality of first response messages, wherein the plurality of mutual assistance devices are connected to a first network; and determine a target mutual assistance device among the plurality of mutual assistance devices according to the network parameters; A connection unit, configured to establish a network connection with the target mutual assistance device.

9. An electronic device, characterized in that, Comprising: A processor and a memory, where the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that, A program or instructions are stored on the computer-readable storage medium, and when the program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

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

    EP4746575A1

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

    WO2025130033A1