Automatic relay method, device, storage medium and WiFi relay device
By using automated relay equipment for dynamic network quality assessment and selection, the problem of complex relay equipment configuration is solved, enabling stable expansion and simplified deployment of wireless networks, and adapting to various network environments.
Patent Information
- Application Number
- CN202510099358.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-01-22
AI Technical Summary
Existing relay equipment is complex to configure, requires manual operation by users and a high level of professional knowledge, making it difficult for ordinary users to deploy and potentially causing network interference or security risks.
The relay device automatically activates STA and AP functions, selects the working mode by detecting wired network connections, broadcasts relay information, dynamically evaluates network quality, and selects the optimal AP or upstream relay device to avoid relay loops and disconnections.
It enables automatic relay deployment without requiring manual configuration by the user, ensuring relay link stability and network performance, avoiding relay loops, and adapting to different network environments.
Smart Images

Figure CN119946767B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of wireless communication, and in particular to an automatic relay method and device, a storage medium and a WiFi relay device. BACKGROUND
[0002] In today's increasingly popular wireless local area network (WLAN) technology, the wireless access point (AP) as an important part of the network infrastructure, plays a bridge role in connecting wireless stations (STA) and wired networks or other wireless networks. However, in the actual deployment and application process, the performance of the AP and the communication quality between the AP and the STA are often affected by various factors.
[0003] One of the significant problems is that due to the physical obstruction of the AP or its own small transmission power, the signal coverage range is limited, so that some STAs in certain locations cannot establish stable and reliable connections with the AP. This not only affects the data transmission efficiency and quality between the STA and the AP, but also may further hinder the data transmission between different STAs communicating through the AP, seriously affecting the overall performance and user experience of the wireless network.
[0004] In order to solve the above problems, a common method in the prior art is to introduce a relay device. The relay device can receive wireless signals from the AP or the STA, amplify them and then forward them to the target device, thereby effectively expanding the coverage of the wireless network, enhancing the signal strength and improving the communication quality. However, to realize this function of the relay device, a series of complex network parameter configurations are required, including but not limited to operating frequency band, channel selection, encryption method, network authentication information, etc.
[0005] Currently, these network parameter configurations are mostly completed manually by the user, and the user is required to have certain professional knowledge and operating skills of wireless networks. This is undoubtedly a great challenge for ordinary users, not only increasing the operation difficulty and complexity, but also possibly causing the relay device to malfunction due to improper configuration, and even causing interference or security risks to the entire wireless network.
[0006] Therefore, how to simplify the configuration process of the relay device, reduce the requirement for professional knowledge of the user, and at the same time ensure that the relay device can stably and efficiently realize its function of expanding the network coverage range and enhancing the signal strength, has become a technical problem to be solved in the current wireless local area network technology field. SUMMARY
[0007] The embodiments of the present application provide an automatic relay method, device, storage medium and WiFi relay equipment, which can solve the problem of high configuration difficulty and manual configuration of relay equipment in the related art. The technical solution is as follows.
[0008] In a first aspect, the embodiments of the present application provide an automatic relay method, which comprises the following steps.
[0009] After the first WiFi relay equipment is started, the STA function and the AP function are started simultaneously, and the relay depth value relaydeep is initialized and set to 0.
[0010] The first WiFi relay equipment detects whether the wired network is connected through the network cable.
[0011] If yes, the relay depth value of the first WiFi relay equipment is updated to 1, and the relay information of the first WiFi relay equipment is broadcasted outward through the beacon frame and the scanning response frame, wherein the relay information comprises the relay depth value and the network quality parameter value; the WiFi relay equipment with the relay depth value equal to 1 is the root node.
[0012] If no, an AP list is obtained by scanning the surrounding APs, and an AP with the optimal network quality is selected from the AP list for connection; after the first WiFi relay equipment is successfully connected to the selected AP, the relay depth value of the first WiFi relay equipment is updated to 1; or the first WiFi relay equipment obtains a relay equipment list by scanning the surrounding WiFi relay equipment; an upper WiFi relay equipment with the optimal network quality and the relay depth value greater than 0 is selected from the relay equipment list, and a connection request frame carrying the relay information of the first WiFi relay equipment is sent to the upper WiFi relay equipment; when the first WiFi relay equipment receives a connection permission frame returned by the upper WiFi relay equipment based on the connection request frame, the relay depth value of the first WiFi relay equipment is updated to the relay depth value of the upper WiFi relay equipment + 1.
[0013] The first WiFi relay equipment receives a connection request frame from a second WiFi relay equipment, wherein the connection request frame carries the relay information of the second WiFi relay equipment, and the first WiFi relay equipment sends the relay information of the first WiFi relay equipment outward through the beacon frame and the scanning response frame.
[0014] analyzing the received connection request frame to obtain relay information of the second WiFi relay device, judging whether to allow access of the second WiFi relay device according to a network quality parameter in the analyzed relay information, if yes, sending a connection permission frame to the second WiFi relay device, so that the second WiFi relay device updates its relay depth value to the relay depth value of the first WiFi relay device + 1 based on the received connection permission frame;
[0015] When the first WiFi relay device detects disconnection, resetting its relay depth value to 0, disconnecting all subordinate relay WiFi devices, and keeping the connection of all STAs to avoid forming a relay loop.
[0016] In a second aspect, the embodiments of the present application provide an automatic relay device, which comprises:
[0017] The starting unit is configured to start the STA function and the AP function simultaneously after starting, and initialize the relay depth value relaydeep to 0.
[0018] The detection unit is configured to detect whether there is a wired network connected through a network cable.
[0019] The wired connection unit is configured to, if yes, update the relay depth value of the first WiFi relay device to 1, and broadcast the relay information of the first WiFi relay device to the outside through a beacon frame and a scan response frame, the relay information comprising the relay depth value and a network quality parameter value; the WiFi relay device with the relay depth value equal to 1 is a root node.
[0020] The wireless connection unit is configured to, if no, scan APs to obtain an AP list, select an AP with the optimal network quality in the AP list to connect; after successfully connecting to the selected AP, update the relay depth value of the first WiFi relay device to 1; or scan WiFi relay devices to obtain a relay device list; select a superior WiFi relay device with the optimal network quality and a relay depth value greater than 0 in the relay device list, send a connection request frame carrying the relay information of the first WiFi relay device to the superior WiFi relay device; when receiving a connection permission frame returned from the superior WiFi relay device based on the connection request frame, update the relay depth value of the first WiFi relay device to the relay depth value of the superior WiFi relay device + 1.
[0021] a transceiving unit, configured to receive a connection request frame from a second WiFi relay device, the connection request frame carrying relay information of the second WiFi relay device, and to send the relay information of the first WiFi relay device outward through a beacon frame and a scanning response frame;
[0022] an access control unit, configured to obtain the relay information of the second WiFi relay device after parsing the received connection request frame, to determine whether to allow access of the second WiFi relay device according to a network quality parameter in the parsed relay information, and to send a connection permission frame to the second WiFi relay device if the determination is positive, so that the second WiFi relay device updates its relay depth value to the relay depth value of the first WiFi relay device + 1 based on the received connection permission frame;
[0023] a disconnection processing unit, configured to reset the relay depth value of the first WiFi relay device to 0 when a disconnection is detected, and to disconnect all subordinate relay WiFi devices and keep the connection with all STAs to avoid forming a relay loop.
[0024] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and performing the method steps described above.
[0025] In a fifth aspect, an embodiment of the present application provides a WiFi relay device, which can include a processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and performing the method steps described above.
[0026] The technical solutions provided by some embodiments of the present application have at least the following beneficial effects:
[0027] Automatic relay configuration and deployment: the STA and AP functions of the relay device are automatically started after the relay device is powered on, and the working mode is intelligently selected according to whether the relay device is connected to a wired network through a network cable. If the relay device is connected to the wired network, the relay device broadcasts its relay information as a root node (with a relay depth value of 1); if the relay device is not connected to the wired network, the relay device automatically scans and connects to an optimal AP or a superior relay device, and automatically updates the relay depth value according to the connection. This process does not require manual configuration by the user, greatly simplifying the deployment process of the relay device.
[0028] Dynamic network quality evaluation and selection: when the relay device selects a connection AP or a superior relay device, the relay device makes an optimal selection based on network quality parameters (such as signal strength, delay, etc.), to ensure the stability and efficiency of the relay link. Meanwhile, when the relay device receives a connection request from a subordinate relay device, the relay device also determines whether to allow access according to the network quality parameters, to further ensure the performance of the entire relay network.
[0029] Avoidance of relay loop and broken line processing: In the technical solution, a broken line detection mechanism is designed. When the relay device detects a broken line, it will reset the relay depth value and disconnect all the connections of the subordinate relay devices, but keep the connection of the STA uninterrupted, effectively avoiding the formation of a relay loop, while ensuring that the basic network connection of the STA is not affected.
[0030] Extensibility and flexibility: The technical solution allows hierarchical connection of relay devices. Each relay device can automatically adjust its role (root node, intermediate node or leaf node) according to the current network environment. This dynamic adjustment mechanism makes the relay network have good extensibility and flexibility, and can adapt to wireless network environments of different scales and complexities. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application. Those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0032] Figure 1 is an architecture diagram of a WiFi wireless communication system provided by the embodiments of the present application;
[0033] Figure 2 is an interaction schematic diagram of an automatic relay method provided by the embodiments of the present application;
[0034] Figure 3 is a structure schematic diagram of an automatic relay device provided by the present application;
[0035] Figure 4 is another structure schematic diagram of a WiFi relay device provided by the present application. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0037] Reference Figure 1 , Figure 1 is a network architecture diagram of a wireless fidelity communication system. The wireless fidelity communication system includes a wireless station 10, a WiFi relay device 11, a WiFi relay device 13, a wireless access point 12 and a wireless station 14. The above-mentioned devices communicate with each other through wireless WiFi protocol
[0038] The WiFi relay device 11 and the WiFi relay device 13 have the functions of both STA and AP, and the WiFi relay device of a non-root node can be connected to one or more subordinate WiFi relay devices or to a STA.
[0039] In the embodiments of the present application, the wireless station can be a smartphone, a tablet computer, a game device, an AR (Augmented Reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook computer, a desktop computing device, etc.
[0040] The embodiments of the present application will be described below in conjunction with the accompanying drawings. Figure 2 The automatic relay method provided by the embodiments of the present application will be described in detail. The automatic relay method in the embodiments of the present application can be a method for automatically determining whether a WiFi relay device is a root node or a non-root node. Figure 1 The station in the embodiments of the present application can be a WiFi relay device.
[0041] Please refer to Figure 2 The flowchart of the automatic relay method provided by the embodiments of the present application is shown in FIG. 1. The method provided by the present application can include the following steps:
[0042] S201, after the first WiFi relay device is powered on, the STA function and the AP function are started simultaneously, and the relay deep value is initialized to 0.
[0043] After the first WiFi relay device is powered on, the first WiFi relay device first performs initialization operations at the hardware and software levels. The hardware initialization can include checking network interfaces (wired and wireless), power status, etc.; the software initialization involves loading the operating system, the driver program, and the WiFi relay related application program.
[0044] After the initialization is completed, the device starts the STA function and the AP function simultaneously. The STA function allows the device to scan and attempt to connect to the surrounding WiFi network as a client, while the AP function enables the device to provide a WiFi signal for other devices to connect as a hotspot. The start of these two functions usually involves configuring network interface parameters (such as SSID, password), starting network listening services, etc.
[0045] In addition, the device also initializes an internal variable named "relay deep" to 0. This variable is used to identify the hierarchical position of the device in the entire WiFi relay network. A relay deep value of 0 indicates that the device has not been connected to any superior relay device or wired network and is an independent node.
[0046] S202, the first WiFi relay device detects whether it is connected to a wired network through a network cable.
[0047] Wherein, the device detects wired network connection by checking the physical connection status of the network interface and attempting to communicate through a wired network protocol (such as Ethernet). The physical connection status can be obtained by reading the status register of the network interface, while the communication attempt can involve sending and receiving test packets.
[0048] If the device detects that a wired network connection exists and is stable, it will proceed to the next operation S203; otherwise, it will perform S204 to attempt a wireless connection.
[0049] Further, the first WiFi relay device detects the physical connection status by reading the status register of the network interface (such as the Ethernet interface). These status registers usually contain information about the connection status of the network interface, such as whether the link is established, the connection speed, the duplex mode, etc. Or the first WiFi relay device can also detect whether the network cable is connected and the connection is stable by detecting physical layer signals (such as voltage, current, etc.). For example, the Ethernet interface will detect a specific voltage change when the connection is established, thereby confirming the existence of the physical connection.
[0050] S203, if yes, update the relay depth value of the first WiFi relay device to 1, and broadcast the relay information of the first WiFi relay device through Beacon Frame and Probe Response Frame, the relay information including the relay depth value and the network quality parameter value; the WiFi relay device with relay depth value equal to 1 is the root node.
[0051] Wherein, once the device detects a wired network connection, the following operations will be performed:
[0052] Update the relay depth value to 1, indicating that the device is now the root node (i.e. the starting point of the entire relay network).
[0053] Generate a relay information packet containing the relay depth value and the network quality parameter value (such as signal strength, link delay, etc.). These parameters can be obtained through network diagnostic tools or protocols.
[0054] Broadcast its relay information through Beacon Frame and Probe Response Frame. Beacon Frame is sent periodically to inform surrounding devices of the existence of the hotspot; Probe Response Frame is sent when the device receives Probe Request Frame.
[0055] S204, if no, scanning the surrounding AP to get the AP list, selecting an AP with the best network quality in the AP list to connect; after successfully connecting to the selected AP, updating the relay depth value of the first WiFi relay device to 1; or the first WiFi relay device scans the surrounding WiFi relay device to get the relay device list; selecting a superior WiFi relay device with a relay depth value greater than 0 and the best network quality in the relay device list, and sending a connection request frame carrying the relay information of the first WiFi relay device to the superior WiFi relay device; when the first WiFi relay device receives the connection permission frame returned by the superior WiFi relay device based on the connection request frame, the first WiFi relay device updates its relay depth value to the relay depth value of the superior WiFi relay device + 1; and sending the relay information of the first WiFi relay device to the outside through the beacon frame and the scan response frame.
[0056] If the device does not detect a wired network connection, one of the following steps will be performed to attempt a wireless connection:
[0057] 1. Scan and connect to the optimal AP:
[0058] The device starts the wireless scanning function, scans the surrounding APs and generates an AP list.
[0059] Sort the AP list according to network quality parameters (such as signal strength, stability, whether it supports the required security protocol, etc.).
[0060] Select an optimal AP and try to connect using the configured SSID and password.
[0061] If the connection is successful, the device updates the relay depth value to 1 and prepares to broadcast its relay information (if configured to allow relay).
[0062] 2. Scan and connect to the optimal superior relay device:
[0063] If the device is configured to support relay-to-relay connection, it will start the wireless scanning function, scan the surrounding WiFi relay devices and generate a relay device list.
[0064] Sort the relay device list according to the relay depth value and network quality parameters. Note that in order to avoid forming a relay link loop, the device may select a relay device with a relay depth value greater than 0 and not its own as the superior relay.
[0065] Select an optimal superior relay device and send a connection request frame carrying its own relay information to it. The connection request frame may contain the device's SSID, password (if required by the superior relay), relay depth value, network quality parameters, etc.
[0066] Wait for the response of the superior relay device. If a connection permission frame is received, the device updates its relay depth value to the relay depth value of the superior relay device plus 1, and starts broadcasting its relay information (if configured to allow relay).
[0067] For example: The first WiFi relay device does not detect a wired network connection, so it starts scanning for APs and relay devices around it. It finds two APs (AP1 and AP2) and one relay device (Relay-A). According to the signal strength and stability, it chooses to connect to AP1 (signal strength -65dBm, high stability). After a successful connection, it updates the relay depth value to 1 and prepares to broadcast its relay information.
[0068] In another case, if the first WiFi relay device is configured to support relay-to-relay connection, and finds that Relay-A is a better choice (relay depth value 1, signal strength -60dBm), it will send a connection request frame to Relay-A. After receiving the connection permission frame from Relay-A, it updates its relay depth value to 2 (the relay depth value of Relay-A plus 1), and starts broadcasting its relay information.
[0069] S205, the first WiFi relay device receives a connection request frame from the second WiFi relay device, the connection request frame carrying the relay information of the second WiFi relay device.
[0070] Among them, as an AP or relay device, the first WiFi relay device can receive connection request frames from other WiFi relay devices (such as the second WiFi relay device). These request frames usually contain the SSID, password (if applicable), relay depth value, network quality parameters, etc. of the relay device requesting connection.
[0071] The device first verifies the legitimacy of the connection request frame (such as checking whether the SSID and password match). If it is legitimate, it will proceed to the next step; otherwise, it will ignore the request frame.
[0072] S206, after parsing the received connection request frame, the relay information of the second WiFi relay device is obtained, and whether to allow the access of the second WiFi relay device is judged according to the network quality parameters in the parsed relay information. If yes, a connection permission frame is sent to the second WiFi relay device, so that the second WiFi relay device updates its relay depth value to the relay depth value of the first WiFi relay device plus 1 based on the received connection permission frame.
[0073] Wherein, the device parses the received connection request frame, obtaining the relay information of the second WiFi relay device (including the relay depth value and network quality parameters, etc.). Then, it decides whether to allow the second WiFi relay device to access according to these information and its own configuration and network state.
[0074] The decision process may involve the following factors:
[0075] Relay depth limit: The device may be configured with a maximum relay depth value. If the relay depth value of the second WiFi relay device plus its own relay depth value exceeds this limit, the device will reject the access request.
[0076] Network quality: The device may evaluate the feasibility of the connection according to the network quality parameters of the second WiFi relay device (such as signal strength, stability, etc.). If the network quality is poor, the device may reject the access request or require the second WiFi relay device to adjust its transmission power or position.
[0077] Avoiding loopback: The device needs to check whether the second WiFi relay device is already its subordinate device or whether it will cause a relay link loopback. If so, the device will reject the access request.
[0078] If the device decides to allow access, it will send a connection permission frame to the second WiFi relay device, which may contain some additional configuration information (such as specified channel, transmission power, etc.). At the same time, it instructs the second WiFi relay device to update its relay depth value to the device's relay depth value plus 1.
[0079] Wherein, the first WiFi relay device needs to periodically detect the connection status with the upper-level relay device or wired network. This can be achieved by sending heartbeat packets, monitoring network interface status, or checking routing tables, etc.
[0080] If the device detects that the connection is disconnected (i.e. broken), it will perform the following operations: reset its own relay depth value to 0, indicating that it is no longer a relay node. Disconnect all subordinate relay WiFi devices. This can be achieved by sending a disconnect instruction or stopping broadcasting relay information. Note that in order to avoid affecting the connection of STAs, the device may need to first notify the subordinate relay devices that they need to handle the disconnection operation themselves. Keep all STA connections unchanged. This means that the device will continue to serve as an AP for STAs even if it is no longer a relay node.
[0081] It should be noted that the first WiFi relay device can try to re-establish the connection with the upper-level relay device or wired network. If successful, it will update the relay depth value and restore the relay function.
[0082] In summary, the beneficial effects of implementing the embodiments of the present application include:
[0083] Automatic relay configuration and deployment: After the relay device is powered on, it automatically starts the STA and AP functions, and intelligently selects the working mode according to whether it is connected to a wired network through a network cable. If connected to a wired network, it broadcasts its relay information as a root node (relay depth value is 1); if there is no network cable connection, it automatically scans and connects to the optimal AP or upper relay device, and automatically updates the relay depth value according to the connection situation. This process does not require manual configuration by the user, greatly simplifying the deployment process of the relay device.
[0084] Dynamic network quality evaluation and selection: When selecting a connected AP or upper relay device, the relay device makes the optimal selection based on network quality parameters (such as signal strength, delay, etc.), ensuring the stability and efficiency of the relay link. At the same time, when receiving a connection request from a lower relay device, the relay device also determines whether to allow access based on network quality parameters, further ensuring the performance of the entire relay network.
[0085] Avoidance of relay loop and broken line processing: The technical solution designs a broken line detection mechanism. When the relay device detects a broken line, it resets the relay depth value and disconnects all lower relay devices, but maintains the connection of the STA, effectively avoiding the formation of a relay loop and ensuring that the basic network connection of the STA is not affected.
[0086] Extensibility and flexibility: The technical solution allows hierarchical connection of relay devices, and each relay device can automatically adjust its role (root node, intermediate node or leaf node) according to the current network environment. This dynamic adjustment mechanism makes the relay network have good extensibility and flexibility, and can adapt to wireless network environments of different scales and complexities.
[0087] The following is an embodiment of the device of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0088] Please refer to Figure 3 which shows a structure diagram of an automatic relay device provided by an exemplary embodiment of the present application. The device can be realized by software, hardware or a combination of both to become all or part of a terminal. The automatic relay device 3 (referred to as device 3) includes: a starting unit 301, a detection unit 302, a wired connection unit 303, a wireless connection unit 304, a transceiver unit 305, an access control unit 306, and a broken line processing unit 307.
[0089] The starting unit 301 is used to start the STA function and the AP function at the same time after power-on, and initialize the relay depth value relaydeep to 0;
[0090] The detection unit 302 is configured to detect whether a wired network is connected through a network cable.
[0091] The wired connection unit 303 is configured to, if the answer is yes, update the relay depth value of the first WiFi relay device to 1, and broadcast the relay information of the first WiFi relay device through a beacon frame and a scanning response frame, wherein the relay information comprises the relay depth value and the network quality parameter value; the WiFi relay device with the relay depth value equal to 1 is a root node.
[0092] The wireless connection unit 304 is configured to, if the answer is no, scan the surrounding APs to obtain an AP list, select an AP with the optimal network quality in the AP list to connect, update the relay depth value of the first WiFi relay device to 1 after successfully connecting to the selected AP, or scan the surrounding WiFi relay devices to obtain a relay device list, select a superior WiFi relay device with the relay depth value greater than 0 and the optimal network quality in the relay device list, and send a connection request frame carrying the relay information of the first WiFi relay device to the superior WiFi relay device; and when a connection permission frame returned by the superior WiFi relay device based on the connection request frame is received, update the relay depth value of the first WiFi relay device to the relay depth value of the superior WiFi relay device + 1.
[0093] The transceiver unit 305 is configured to receive a connection request frame from a second WiFi relay device, wherein the connection request frame carries the relay information of the second WiFi relay device, and send the relay information of the first WiFi relay device to the outside through a beacon frame and a scanning response frame.
[0094] The access control unit 306 is configured to obtain the relay information of the second WiFi relay device after analyzing the received connection request frame, and determine whether to allow the access of the second WiFi relay device according to the network quality parameter in the analyzed relay information; if the answer is yes, send a connection permission frame to the second WiFi relay device, so that the second WiFi relay device updates the relay depth value of the second WiFi relay device to the relay depth value of the first WiFi relay device + 1 based on the received connection permission frame.
[0095] The disconnection processing unit 307 is configured to, when a disconnection is detected, reset the relay depth value of the first WiFi relay device to 0, and disconnect all the subordinate relay WiFi devices, and keep the connection of all the STAs to avoid forming a relay loop.
[0096] In a possible implementation, the first WiFi relay device detects whether a wired network is connected through a network cable, comprising:
[0097] Whether a network is connected to a wired network via a network cable can be determined by reading the status register of the network interface or by detecting physical layer signals.
[0098] In one possible implementation, network quality parameter values include signal strength and link delay.
[0099] It should be noted that the above embodiments of the device 3, when executing the automatic relay method, are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the touch operation response device and the touch operation response method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.
[0100] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0101] This application also provides a computer storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figure 2 The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figure 2 The specific details of the illustrated embodiments will not be elaborated here.
[0102] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by the processor to implement the automatic relay method as described in the above embodiments.
[0103] Please see Figure 4 This is a schematic diagram of the structure of a WiFi relay device provided in an embodiment of this application. Figure 4 As shown, the WiFi relay device 400 may include: at least one processor 401, a communication interface 403, a memory 404, and at least one communication bus 402.
[0104] The communication bus 402 is used to enable communication between these components.
[0105] The communication interface 403 includes a WiFi interface, which can be used for WiFi protocol data packets.
[0106] The processor 401 may include one or more processing cores. The processor 401 connects to various parts of the terminal 400 using various interfaces and lines, and performs various functions of the terminal 400 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 404, and by calling data stored in the memory 404.
[0107] The memory 404 may include random access memory (RAM) or read-only memory. Optionally, the memory 404 may include a non-transitory computer-readable storage medium. The memory 404 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 404 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 404 may also be at least one storage device located remotely from the aforementioned processor 401. Figure 4 As shown, the memory 404, which serves as a computer storage medium, may include an operating system, a network communication module, and application programs.
[0108] exist Figure 4 In the WiFi repeater device 400 shown, the processor 401 can be used to call the application stored in the memory 404 and specifically execute, such as Figure 2 The method shown can be referred to for details. Figure 2 As shown, it will not be elaborated further here.
[0109] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0110] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Those skilled in the art will understand that implementing all or part of the processes of the above embodiments and making equivalent changes in accordance with the claims of this application are still within the scope of the invention.
Claims
1. An automatic relay method characterized by, The method comprises: The first WiFi relay device starts STA function and AP function after starting, and initializes relay deep value to 0; The first WiFi relay device detects whether it is connected to wired network through network cable; If yes, the relay deep value of the first WiFi relay device is updated to 1, and the relay information of the first WiFi relay device is broadcasted outward through beacon frame and scanning response frame, wherein the relay information comprises relay deep value and network quality parameter value; the WiFi relay device with relay deep value equal to 1 is root node; If no, an AP list is obtained by scanning surrounding APs, and an AP with optimal network quality is selected from the AP list for connection; after successful connection to the selected AP, the relay deep value of the first WiFi relay device is updated to 1; or a relay device list is obtained by scanning surrounding WiFi relay devices; a superior WiFi relay device with relay deep value greater than 0 and optimal network quality is selected from the relay device list, and a connection request frame carrying the relay information of the first WiFi relay device is sent to the superior WiFi relay device; when the first WiFi relay device receives a connection permission frame returned by the superior WiFi relay device based on the connection request frame, the relay deep value of the first WiFi relay device is updated to the relay deep value of the superior WiFi relay device + 1; The first WiFi relay device receives a connection request frame from a second WiFi relay device, the connection request frame carrying the relay information of the second WiFi relay device, and the relay information of the first WiFi relay device is sent outward through beacon frame and scanning response frame; The relay information of the second WiFi relay device is obtained after analyzing the received connection request frame, and whether the access of the second WiFi relay device is allowed is judged according to the network quality parameter in the analyzed relay information; if yes, a connection permission frame is sent to the second WiFi relay device, so that the relay deep value of the second WiFi relay device is updated to the relay deep value of the first WiFi relay device + 1 based on the received connection permission frame; When the first WiFi relay device detects disconnection, the relay deep value of the first WiFi relay device is reset to 0, and the connection of all subordinate relay WiFi devices is disconnected, and the connection of all STAs is maintained to avoid forming relay loop.
2. The method of claim 1, wherein, The first WiFi relay device detects whether it is connected to wired network through network cable, comprising: Whether it is connected to wired network through network cable is judged by reading state register of network interface or by detecting physical layer signal.
3. The method according to claim 1 or 2, characterized in that, The network quality parameter value comprises signal strength and link delay.
4. An automatic relay device, characterized by Comprise: The starting unit is used for starting STA function and AP function after starting, and initializing relay deep value to 0; The detection unit is used for detecting whether it is connected to wired network through network cable; a wired connection unit configured to, if yes, update a relay depth value of the first WiFi relay device to 1, and broadcast relay information of the first WiFi relay device including the relay depth value and a network quality parameter value to the outside through a beacon frame and a scan response frame; and a WiFi relay device with the relay depth value equal to 1 is a root node; a wireless connection unit configured to, if no, scan APs around to obtain an AP list, and select an AP with optimal network quality in the AP list to connect to; after successfully connecting to the selected AP, update the relay depth value of the first WiFi relay device to 1; or scan WiFi relay devices around to obtain a relay device list; select a superior WiFi relay device with a relay depth value greater than 0 and optimal network quality in the relay device list, and send a connection request frame carrying relay information of the first WiFi relay device to the superior WiFi relay device; and when a connection permission frame returned by the superior WiFi relay device based on the connection request frame is received, update a relay depth value of the first WiFi relay device to the relay depth value of the superior WiFi relay device + 1; a transceiver unit configured to receive a connection request frame from a second WiFi relay device, the connection request frame carrying relay information of the second WiFi relay device, and send relay information of the first WiFi relay device to the outside through a beacon frame and a scan response frame; an access control unit configured to, after parsing the received connection request frame, obtain the relay information of the second WiFi relay device, and determine whether to allow access of the second WiFi relay device according to a network quality parameter in the parsed relay information; if yes, send a connection permission frame to the second WiFi relay device, so that the second WiFi relay device updates a relay depth value of the second WiFi relay device to the relay depth value of the first WiFi relay device + 1 based on the received connection permission frame; a disconnection processing unit configured to, when disconnection is detected, reset a relay depth value of the first WiFi relay device to 0, and disconnect all subordinate relay WiFi devices, and keep connection of all STAs to avoid forming a relay loop.
5. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, the instructions being adapted to be loaded and executed by the processor to perform the method steps of any one of claims 1-3.
6. A WiFi relay device, characterized in that, comprise: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded and executed by the processor to perform the method steps of any one of claims 1-3.
Citation Information
Patent Citations
Ad hoc network method and device based on WiFi, storage medium and wireless node
CN113179509A
Data transmission method, data acquiring method, and electronic device
US20150237660A1