CN107040302B - Relay communication configuration method and device - Google Patents

Relay communication configuration method and device Download PDF

Info

Publication number
CN107040302B
CN107040302B CN201710254564.1A CN201710254564A CN107040302B CN 107040302 B CN107040302 B CN 107040302B CN 201710254564 A CN201710254564 A CN 201710254564A CN 107040302 B CN107040302 B CN 107040302B
Authority
CN
China
Prior art keywords
relay
level
node
channel
relay node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710254564.1A
Other languages
Chinese (zh)
Other versions
CN107040302A (en
Inventor
杨川庆
赵玉峰
刘宏举
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201710254564.1A priority Critical patent/CN107040302B/en
Publication of CN107040302A publication Critical patent/CN107040302A/en
Priority to PCT/CN2017/119921 priority patent/WO2018192265A1/en
Application granted granted Critical
Publication of CN107040302B publication Critical patent/CN107040302B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B7/00Radio transmission systems, i.e. using radiation field
    • H04B7/14Relay systems
    • H04B7/15Active relay systems
    • H04B7/155Ground-based stations
    • H04B7/15528Control of operation parameters of a relay station to exploit the physical medium
    • H04B7/15542Selecting at relay station its transmit and receive resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B7/00Radio transmission systems, i.e. using radiation field
    • H04B7/14Relay systems
    • H04B7/15Active relay systems
    • H04B7/155Ground-based stations
    • H04B7/15528Control of operation parameters of a relay station to exploit the physical medium
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/04Terminal devices adapted for relaying to or from another terminal or user

Abstract

The embodiment of the invention provides a method and a device for configuring relay communication, which are applied to a mobile terminal, wherein the mobile terminal is configured with a Wi-Fi module, and the method comprises the following steps: a station node of the Wi-Fi module is connected with a router or a relay node of the upper stage; detecting a relay level of a relay node; selecting a target channel according to the relay level; starting a softAP node of the Wi-Fi module according to the relay level so as to connect an application terminal and/or a relay node at the next level on the target channel; configuring relay communication parameters according to the relay level to support communication between the station node and the softAP node. The embodiment of the invention forms a multi-stage relay network, widens the structure level of the network, and increases the number of relay nodes, thereby improving the number of connections without mutual interference among channels.

Description

Relay communication configuration method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a relay communication configuration method and a relay communication configuration device.
Background
With the improvement of living standards, wireless signals, such as Wi-Fi (wireless fidelity), have been widely used in various aspects of life due to the convenience of wireless.
At present, in order to save cost, a waste mobile terminal can be used to be hung under a router and used as a repeater to transmit a received wireless signal, so that the coverage range of the wireless signal is enlarged, the communication distance and the coverage range of the wireless signal are enlarged, and a wireless weak signal is enhanced.
However, the number of router connections is limited, and the number of devices that can use relays is limited, and with the increase in devices such as smart home appliances and handheld terminals, newly added devices cannot be connected to relays and cannot use wireless signals.
Disclosure of Invention
In view of the above problems, in order to solve the problem that the newly added devices cannot be connected to relays and use wireless signals due to the limited number of router connections, embodiments of the present invention provide a method and a device for configuring relay communications.
According to an aspect of the present invention, there is provided a method for configuring relay communication, which is applied in a mobile terminal, wherein the mobile terminal is configured with a Wi-Fi module, the method includes:
a station node of the Wi-Fi module is connected with a router or a relay node of the upper stage;
detecting a relay level of a relay node;
selecting a target channel according to the relay level;
starting a softAP node of the Wi-Fi module according to the relay level so as to connect an application terminal and/or a relay node at the next level on the target channel;
configuring relay communication parameters according to the relay level to support communication between the station node and the softAP node.
Optionally, the step of selecting a target channel according to the relay level includes:
inquiring a channel where a router or a relay node at the upper stage is located as an uplink channel;
determining the frequency band type of the uplink channel;
when the relay level is a first level, calculating a target channel which does not interfere with the uplink channel according to the frequency band type;
when the relay level is the second level or below, detecting a channel where an adjacent relay node is located as an adjacent channel;
and calculating a target channel which does not interfere with the uplink channel and the adjacent channel according to the frequency band type.
Optionally, the step of calculating a target channel that does not interfere with the uplink channel according to the frequency band type includes:
when the channel type is a 2.4G frequency band, offsetting the uplink channel by N channels to serve as a target channel;
and when the channel type is a 5G frequency band, offsetting the uplink channel by M channels to be used as a target channel.
Optionally, the step of detecting a channel in which the neighboring relay node is located as the neighboring channel includes:
searching for a relay node which is the same as the service set identifier of the mobile terminal;
and detecting a channel where the relay node is positioned as an adjacent channel.
Optionally, the step of calculating, according to the frequency band type, a target channel that does not interfere with the uplink channel and the adjacent channel includes:
when the channel type is a 2.4G frequency band, offsetting the uplink channel by N channels to serve as a candidate channel;
when the channel type is a 5G frequency band, offsetting the uplink channel by M channels to serve as a candidate channel;
when the candidate channel is the same as the adjacent channel, calculating an interference coefficient by adopting signal information of the relay node to which the adjacent channel belongs;
and selecting a target channel from the candidate channels according to the interference coefficient.
Optionally, the step of calculating a target channel that does not interfere with the uplink channel and the adjacent channel according to the frequency band type further includes:
and when the number of the candidate channels is one, setting the channel with the minimum number or the channel with the maximum number which is farthest from the candidate channels as the candidate channels.
Optionally, the step of calculating an interference coefficient by using the signal information of the relay node to which the adjacent channel belongs includes:
detecting the number and/or the signal strength of relay nodes to which the adjacent channels belong;
calculating an interference factor using the number and/or the signal strength, wherein the number and/or the signal strength is positively correlated with the interference factor.
Optionally, the step of detecting the relay level as the relay node includes:
setting a relay level as a first level, wherein the relay level is the relay node;
requesting relay configuration information from a router or a relay node at the upper level;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
on the basis of the relay level of the relay node at the upper stage, calculating the relay level where the relay node is located to replace the first stage;
when the request fails, the relay level as the relay node is determined to be the first level.
Optionally, the step of starting the softAP node of the Wi-Fi module according to the relay level to connect to the application terminal and/or the relay node of the next level on the target channel includes:
when the relay level is a first level, receiving login information input by a user;
when the relay level is the second level or more, extracting login information from relay configuration information of a relay node of the previous level, wherein the login information comprises a service set identifier and a password;
starting a softAP node of the Wi-Fi module according to the target channel, the service set identification and the password so as to broadcast the service set identification on the target channel.
Optionally, the step of configuring relay communication parameters to support communication between the station node and the softAP node according to the relay level comprises:
opening a packet forwarding function;
when the relay level is a first level, setting configuration information of an address translation function NAT;
when the relay level is the second level or below, an IP address is distributed from the relay node of the upper level, and a relay routing table between the relay nodes of all levels is established;
and/or the presence of a gas in the gas,
inquiring the IP address of the router or the relay node at the upper stage;
and setting the IP address of the router or the relay node at the upper stage as the gateway address of the Domain Name System (DNS).
Optionally, the method further comprises:
receiving a data packet sent by an application terminal and/or a relay node of a next stage through the softAP node;
forwarding the data packet from the softAP node to a station node;
and sending the data packet to a router or a relay node at the upper stage through the station node according to the communication configuration parameters.
Optionally, the step of sending the data packet to a router or a relay node at an upper stage through the station node according to the communication configuration parameter includes:
when the data packet has a Uniform Resource Locator (URL), inquiring a gateway address of a Domain Name System (DNS);
sending the data packet to a router or a relay node at the upper stage through the station node according to the gateway address;
alternatively, the first and second electrodes may be,
when the relay level is a first level, converting a source address in the data packet from the IP address of the application terminal to the IP address of the mobile terminal;
sending the data packet disguising the IP address from the mobile terminal to a router at the upper level through the station node;
alternatively, the first and second electrodes may be,
when the relay level is at or below the second level,
and sending the data packet to a relay node at the upper stage through the station node.
Optionally, the method further comprises:
receiving a data packet sent by a router or a relay node of the upper stage through the station node;
forwarding the data packet from the station node to the softAP node;
and sending the data packet to a next-level application terminal or a relay node through the softAP node according to the communication configuration parameters.
Optionally, the step of sending the data packet to a relay node at an upper stage by the station node includes:
when the relay level is a first level, converting the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal;
when the relay level is the second level or below, inquiring a source address in the data packet to acquire the IP address of the application terminal;
inquiring a target path from the IP address route of the mobile terminal to the IP address of the application terminal through a relay routing table between each level of relay nodes; inquiring the IP address of the next-level application terminal or the relay node in the target path;
and sending the data to the application terminal or the relay node of the next level through the softAP node according to the IP address of the application terminal or the relay node of the next level.
According to another aspect of the present invention, there is provided a device for configuring a relay communication, which is applied in a mobile terminal configured with a Wi-Fi module, the device comprising:
the upper-level equipment connection module is used for connecting a router or a relay node at the upper level through a station node of the Wi-Fi module;
the relay level detection module is used for detecting the relay level of the relay node;
a target channel selection module, configured to select a target channel according to the relay level;
the lower device connection module is used for starting a softAP node of the Wi-Fi module according to the relay level so as to connect a next-level application terminal and/or a relay node on the target channel;
and the relay communication parameter configuration module is used for configuring relay communication parameters according to the relay level so as to support communication between the station node and the softAP node.
Optionally, the target channel selecting module includes:
the uplink channel setting submodule is used for inquiring a channel where a router or a relay node at the previous stage is located as an uplink channel;
a frequency band type determining submodule for determining the frequency band type of the uplink channel;
a first target channel calculation submodule, configured to calculate, when the relay level is a first level, a target channel that does not interfere with the uplink channel according to the frequency band type;
the adjacent channel detection submodule is used for detecting a channel where an adjacent relay node is located as an adjacent channel when the relay level is the second level or below the second level;
and the second adjacent channel calculation submodule is used for calculating a target channel which does not interfere with the uplink channel and the adjacent channel according to the frequency band type.
Optionally, the first target channel calculation sub-module includes:
a first channel shifting unit, configured to shift the uplink channel by N channels as a target channel when the channel type is a 2.4G frequency band;
and the second channel offset unit is used for offsetting the uplink channel by M channels as a target channel when the channel type is a 5G frequency band.
Optionally, the adjacent channel detection sub-module includes:
the relay node searching unit is used for searching the relay node which has the same service set identifier with the mobile terminal;
and the node channel detection unit is used for detecting the channel where the relay node is positioned as an adjacent channel.
Optionally, the second adjacent channel calculation sub-module includes:
a third channel shifting unit, configured to shift the uplink channel by N channels as a candidate channel when the channel type is a 2.4G frequency band;
a fourth channel shifting unit, configured to shift the uplink channel by M channels as candidate channels when the channel type is a 5G frequency band;
an interference coefficient calculation unit, configured to calculate an interference coefficient by using signal information of a relay node to which the adjacent channel belongs when the candidate channel is the same as the adjacent channel;
and the target channel selecting unit is used for selecting a target channel from the candidate channels according to the interference coefficient.
Optionally, the second adjacent channel calculation sub-module further includes:
a candidate channel supplement unit, configured to set, as a candidate channel, a channel with the smallest number or a channel with the largest number that is farthest from the candidate channel when the number of the candidate channels is one.
Optionally, the interference coefficient calculating unit includes:
the node information detection subunit is used for detecting the number and/or the signal strength of the relay nodes to which the adjacent channels belong;
a node information calculating subunit, configured to calculate an interference coefficient by using the number and/or the signal strength, where the number and/or the signal strength are positively correlated to the interference coefficient.
Optionally, the relay level detecting module includes:
the default level setting submodule is used for setting the relay level of the relay node as a first level;
the relay configuration information request submodule is used for requesting relay configuration information to an upper-level router or a relay node;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
the upper level extraction submodule is used for calculating the relay level of the relay node on the basis of the relay level of the relay node on the upper level so as to replace the first level;
and the current level calculating submodule is used for determining the relay level as the first level when the request fails.
Optionally, the lower device connection module includes:
the login information receiving submodule is used for receiving login information input by a user when the relay level is a first level;
the login information extraction submodule is used for extracting login information from relay configuration information of a relay node at the upper level when the relay level is at the second level or above, wherein the login information comprises a service set identifier and a password;
and the softAP node starting module is used for starting the softAP node of the Wi-Fi module according to the target channel, the service set identification and the password so as to broadcast the service set identification on the target channel.
Optionally, the relay communication parameter configuration module includes:
the packet forwarding function starting submodule is used for starting the packet forwarding function;
the address translation function setting submodule is used for setting the configuration information of the address translation function NAT when the relay level is the first level;
the IP address allocation submodule is used for allocating an IP address from the relay node of the previous stage when the relay level is the second stage or below the second stage and establishing a relay routing table between the relay nodes of each stage;
and/or the presence of a gas in the gas,
the IP address query submodule is used for querying the IP address of the router or the relay node at the upper stage;
and the domain name system DNS setting submodule is used for setting the IP address of the router or the relay node at the upper level as the gateway address of the domain name system DNS.
Optionally, the method further comprises:
an uplink data packet receiving module, configured to receive, by the softAP node, a data packet sent by a next-stage application terminal and/or a relay node;
the uplink relay communication module is used for forwarding the data packet from the softAP node to the station node;
and the uplink data packet sending module is used for sending the data packet to a router or a relay node at the upper stage through the station node according to the communication configuration parameters.
Optionally, the uplink data packet sending module includes:
a gateway address query submodule, configured to query a gateway address of a domain name system DNS when the data packet has a uniform resource locator URL;
the gateway address sending submodule is used for sending the data packet to a router or a relay node at the upper stage through the station node according to the gateway address;
alternatively, the first and second electrodes may be,
a first IP address conversion sub-module, configured to convert, when the relay level is a first level, a source address in the data packet from an IP address of the application terminal to an IP address of the mobile terminal;
a first data packet forwarding sub-module, configured to send, through the station node, a data packet disguised as an IP address from the mobile terminal to a router at an upper level;
alternatively, the first and second electrodes may be,
and the second data packet forwarding submodule is used for sending the data packet to the relay node of the previous stage through the station node when the relay level is the second stage or below the second stage.
Optionally, the method further comprises:
a downlink data packet receiving module, configured to receive, by the station node, a data packet sent by a router or a relay node at an upper stage;
a downlink relay communication module for forwarding the data packet from the station node to the softAP node;
and the downlink data packet sending module is used for sending the data packet to a next-level application terminal or a next-level relay node through the softAP node according to the communication configuration parameters.
Optionally, the downlink data packet sending module includes:
a second IP address conversion sub-module, configured to convert the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal when the relay level is the first level;
a source address query submodule, configured to query a source address in the data packet to obtain an IP address of the application terminal when the relay level is a second level or below;
a target path query submodule, configured to query, through a relay routing table between each stage of relay nodes, a target path from the IP address of the mobile terminal to the IP address of the application terminal;
a lower address query submodule, configured to query an IP address of a next-stage application terminal or a relay node in the target path;
and the third data packet forwarding submodule is used for sending the data to the next-level application terminal or the next-level relay node through the softAP node according to the IP address of the next-level application terminal or the next-level relay node.
The embodiment of the invention has the following advantages:
the embodiment of the invention is characterized in that a mobile terminal is provided with a Wi-Fi module, a softAP node of the Wi-Fi module is started through a router or a relay node at the upper stage of a station node of the Wi-Fi module to connect an application terminal and/or a relay node at the lower stage, a target channel is selected according to the current relay level and relay communication parameters are configured to support communication between the station node and the softAP node, the mobile terminal is realized as the relay node, the relay node is hung behind the relay node to form a multi-stage relay network, the structure level of the network is expanded, the number of the relay nodes is increased, the number of the connection is increased, and under the condition that the number of intelligent household appliances, handheld terminals and other devices is increased, newly-added devices can be connected with relays and normally use wireless signals. In addition, the target channel is self-adaptive to the relay level to be adjusted, the channels are not interfered with each other, the data forwarding capability of the relay function is improved, and the relay performance is improved.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for configuring relay communication according to an embodiment of the present invention;
fig. 2 is a channel profile for a 2.4G frequency channel;
fig. 3 is a channel profile for a 5G channel;
FIG. 4 is a topology diagram of a relay network of one embodiment of the present invention;
fig. 5 is a flowchart illustrating steps of another method for configuring relay communications according to an embodiment of the present invention;
fig. 6 is a block diagram illustrating an embodiment of a configuration apparatus for relaying communication according to an embodiment of the present invention;
fig. 7 is a block diagram of another configuration apparatus for relaying communication according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a configuration method for relay communication according to an embodiment of the present invention is shown, and specifically may include the following steps:
and step 101, connecting a primary router or a relay node through a station node of the Wi-Fi module.
In a specific implementation, the embodiments of the present invention may be applied to a mobile terminal, for example, a mobile phone, a tablet computer, a smart wearable device (such as a smart watch), and the like.
These mobile terminals may be installed with Windows phone, Android, IOS, Windows, and other operating systems, configured with a Wi-Fi (WIreless-Fidelity) module, and may be connected to a WIreless node as a relay node to forward a WIreless signal.
A Wi-Fi module is also called a serial port Wi-Fi module, belongs to an Internet of things Transmission layer, can convert a serial port or TTL (transistor-transistor logic level) signal into an embedded module which accords with a Wi-Fi wireless network communication standard, and is internally provided with a wireless network Protocol IEEE802.11b.g.n Protocol stack and a TCP/IP (Transmission Control Protocol/Internet Protocol) Protocol stack.
In a particular implementation, Wi-Fi modules typically have three functions: station, softAP, P2P.
Wherein station: which means devices connected to a wireless network, can communicate with other devices inside or outside the wireless network through an AP (wireless access point).
softAP: the function of using the application to realize the AP is shown, so that the mobile terminal can be used as a route to link other stations.
P2P (Peer-to-Peer): also known as Wi-Fi Direct, can support two Wi-Fi devices to connect directly and communicate without an AP.
In the embodiment of the present invention, the mobile terminal may be used as a relay node to connect to a higher-level device, which may be a router or a relay node, that is, the relay node may be hooked after the relay node to form a tree-like relay network.
If the mobile terminal is a relay node of the first level, the mobile terminal can be connected with a router of the first level through a station node of the Wi-Fi module.
If the mobile terminal is a second-level relay node or a relay node below the second level, the mobile terminal can be connected with a first-level relay node through a station node of the Wi-Fi module.
In one embodiment, a getWifiState () method in a WifiManager can be called to detect whether the mobile terminal turns on a station node of Wi-Fi.
When the state node is detected to be started, whether the state node is connected with the wireless node or not can be detected by calling an Application Programming Interface (API) Interface getNetworkInfo () provided by the connectivity manager, and using the connectivity manager.
If the returned NetworkInfo object is not null and isConnected () is true, the wireless node is confirmed to be connected.
When the situation node is detected not to be started or not to be connected with the wireless node, prompt information of the connected wireless node is generated, such as 'please turn on the Wi-Fi and connect a router or a relay'.
Step 102, detecting a relay level of the relay node.
In a specific implementation, after the mobile terminal accesses the network as a relay node, the relay level at which the mobile terminal is currently located may be identified.
The relay node of the first stage may be referred to as a root node, and two stages of relay nodes are connected with each other, where the relay node of the previous stage is a parent node of the relay node of the next stage, and relatively speaking, the relay node of the next stage is a child node of the relay node of the previous stage.
In one embodiment, each level of relay node may maintain one relay configuration information, in which information such as routing path, relay level, login information (such as service set identification SSID and password) and the like may be recorded.
In this embodiment, the relay level at which the relay node is located may be set as the first level.
And according to a preset specification, requesting relay configuration information to a router or a relay node at the upper stage.
If the device at the upper level is a router, and the router does not set the specification, the request of the mobile terminal is ignored.
And if the equipment at the upper level is the relay node which has set the standard, responding to the request of the mobile terminal and returning the relay configuration information.
And when the request is successful, extracting the relay level of the relay node at the upper stage from the relay configuration information.
And on the basis of the relay level of the relay node at the upper stage, calculating the relay level where the relay node is located to replace the first stage.
Further, the mobile terminal may add one to the relay level of the relay node at the previous stage, so as to obtain the relay level at which the mobile terminal is currently used as the relay node.
For example, if the relay level of the relay node at the previous stage is the second stage, the relay level of the mobile terminal as the relay node is the third stage, and the default first stage is modified to the third stage.
When the request fails, the relay level as the relay node is determined to be the first level. Of course, the above-mentioned detection method of the relay level is only an example, and when implementing the embodiment of the present invention, other detection methods of the relay level may be set according to actual situations, for example, requesting the relay level to the router or the relay node at the previous stage, if the request fails, setting the relay level as the first stage, if the request succeeds, calculating the current relay level on the basis of the relay level of the relay node at the previous stage, and the like, which is not limited in this embodiment of the present invention. In addition, besides the above relay level detection method, a person skilled in the art may also adopt other relay level detection methods according to actual needs, and the embodiment of the present invention is not limited to this.
And 103, selecting a target channel according to the relay level.
According to the electromagnetic interference theory, electromagnetic waves of non-self equipment are interference sources, the interference sources emit electromagnetic energy, the electromagnetic energy is transmitted to sensitive equipment through a certain propagation path, and the sensitive equipment responds to interference in a certain form and generates an interference effect.
In the embodiment of the invention, Wi-Fi antennas in the mobile terminal are closely spaced, the mobile terminal is also closely spaced with the mobile terminal, the maximum interference is from radiation electromagnetic coupling of the antenna of the mobile terminal or the surrounding antennas, and the problems of low data forwarding capacity and poor relay performance can be caused.
When the signal source is closer to the interference frequency, the coupling value is larger, and the interference is larger, so that in order to reduce electromagnetic interference, a target channel can be selected at a relay level to select a frequency range without mutual interference, and the problems of lower data forwarding capacity and poorer relay performance caused by channel interference caused by channel setting of a relay function are solved.
In one embodiment of the present invention, step 103 may comprise the following sub-steps:
and a substep S11, querying a channel where the router or the relay node at the previous stage is located as an uplink channel.
In the Android system, WiFi service is a core service responsible for WiFi function, and the WiFi statemachine subsystem is responsible for maintaining various types of status information of WiFi.
The state information includes channel information of the router or the relay node at the previous stage, and thus, the first channel of the router or the relay node at the previous stage can be acquired by calling the mwifitatemachine.
And a substep S12 of determining a band type of the uplink channel.
In practical application, the working frequency bands of the first channel of the router or the relay node are different, and mainly comprise a 2.4G frequency band (2.412GHz-2.484GHz) and a 5G frequency band (5.735GHz-5.835GHz)
Of these, most routers or relay nodes commonly use wireless technology operating at 2.4Ghz, using the (fourth generation) 802.11n standard, and the fifth generation Wi-Fi technology operating at a 5Ghz high band, using the 802.11ac protocol standard.
And a substep S13, when the relay level is the first level, calculating a target channel which does not interfere with the uplink channel according to the frequency band type.
If the relay level of the mobile terminal as the relay node is the first level, the mobile terminal is connected with the router, and the target channel can be directly set according to the frequency band type of the uplink channel of the router.
And when the channel type is a 2.4G frequency band, shifting the uplink channel by N channels as a target channel, wherein N is a positive integer and is more than or equal to 5.
As shown in fig. 2, the map of the 1-14 channels in the 2.4G frequency band is a gradient matrix, 3 independent frequency bands are divided from the angle of the frequency band, the range of each independent frequency band is approximately 22MHz, because adjacent frequency bands have frequency values equal to each other in a crossing manner, the channels in each independent frequency band have interference, and the specific frequency bands are as follows:
a first area: 1-5 channels
And a second zone: 6-10 channels
And (3) three zones: 11-14 channels
For example, the frequency shared by channel 1 and channel 2 is 2406-2423, at this time, if the channel of the uplink channel of the router or relay node at the previous stage is set to 1 and the target channel of the relay node is set to 2, there is a frequency identical interval and interference.
From the angle of frequency band isolation, divide into 5 isolation intervals altogether, the channel in the isolation interval does not have the interference, and specific interval is as follows:
one type is as follows: 1. 6, 11
The second type is as follows: 2. 7, 12
Three types are as follows: 3. 8, 13
Four types: 4. 9. The following is a description of the preferred embodiment
And five types are as follows: 5. 10. the method of the present invention
Therefore, when the channel type is the 2.4G band, the uplink channel may be shifted by at least 5 channels as the target channel.
Assuming that X is an uplink channel of a router or a relay node at the previous stage, and Y is a target channel of the relay node (i.e., a mobile terminal), the two satisfy the following relation:
y is more than or equal to X +5, or, Y is less than or equal to X-5
Wherein X, Y is a positive integer, and when Y <1 or Y >13, Y is invalid and needs to be discarded.
When the channel type is 5G frequency band, the uplink channel is shifted by M channels as a target channel, where M is a positive integer, such as 1, 2.
As shown in fig. 3, since there is no crossover in the 5G frequency band, the uplink channel of the router or the relay node at the previous stage and the target channel of the current relay node are not the same channel, i.e. interference can be substantially avoided.
And a substep S14, when the relay level is at or below the second level, detecting a channel in which an adjacent relay node is located as an adjacent channel.
In an embodiment of the present invention, if the relay node sets the same service set identifier and password to facilitate roaming, the relay node that is the same as the service set identifier of the mobile terminal may be searched, and a channel where the relay node is located may be detected as an adjacent channel.
And a substep S15 of calculating a target channel which does not interfere with the uplink channel and the adjacent channel according to the frequency band type.
If the relay level of the mobile terminal serving as the relay node is the second level or below, the mobile terminal is connected with the relay node, and a target channel can be set according to the frequency band type of the uplink channel of the nearby relay node.
And when the channel type is a 2.4G frequency band, shifting the uplink channel by N channels as candidate channels, wherein N is a positive integer and is more than or equal to 5.
When the channel type is 5G frequency band, the uplink channel is shifted by M channels as candidate channels, where M is a positive integer, such as 1, 2.
When the candidate channel is the same as the adjacent channel, it may indicate that the relay node to which the current adjacent channel belongs and the current relay node belong to the same relay network, and there may be interference, and therefore, the interference coefficient may be calculated by using the signal information of the relay node to which the adjacent channel belongs.
For the case where the candidate channel is different from the adjacent channel, the adjacent channel may be ignored.
In one example, the number and/or signal strength of relay nodes to which adjacent channels belong may be detected, and the interference coefficient may be calculated by configuring a weighted sum or the like.
The number and/or the signal strength are/is positively correlated with the interference coefficient, that is, the interference coefficient is larger when the number is larger and the signal strength is stronger, and conversely, the interference coefficient is smaller when the number is smaller and the signal strength is lower.
Then, a target channel is selected from the candidate channels according to the interference coefficient, and in general, the target channel is selected from the candidate channels with the smallest interference coefficient.
It should be noted that, when the number of candidate channels is one, the channel with the smallest number or the channel with the largest number, which is farthest from the candidate channel, is set as the candidate channel.
Therefore, from the angle of frequency band isolation, 5 isolation intervals are divided, and channels in the isolation intervals do not have interference, and the specific intervals are as follows:
one type is as follows: 1. 6, 11
The second type is as follows: 2. 7, 12
Three types are as follows: 3. 8, 13
Four types: 4. 9, 13
And five types are as follows: 1. 5, 10
For the fourth and fifth classes, assuming that the uplink channels are 9, 5, and the uplink channels are shifted by 5 channels, resulting in 4, 14 (drop), 0 (drop), and 10 channels, respectively, 13, 1 channels may be added as candidate channels.
Assuming that Y is an uplink channel of a router or a relay node at the previous stage, and Z is a target channel of the relay node (i.e. a mobile terminal), the two satisfy the following relation:
z is more than or equal to Y +5, or Z is less than or equal to Y-5
Wherein Y, Z is a positive integer, and when Z <1 or Z >13, Z is invalid and needs to be discarded.
And 104, starting the softAP node of the Wi-Fi module according to the relay level so as to connect the application terminal and/or the relay node at the next level on the target channel.
If the station node of the Wi-Fi module of the mobile terminal is connected to the router or the relay node of the previous stage, a relay instruction can be sent to the Wi-Fi module according to the relay level, the softAP node is started, and the application terminal and/or the relay node of the next stage are/is connected through the softAP node.
Wherein, the application terminal may refer to a terminal that realizes its own function, for example, an intelligent electric rice cooker, an intelligent air conditioner, an intelligent water heater, and the like.
It should be noted that the mobile terminal may be used as a relay node, and may also be used as an application terminal to implement functions such as browsing a web page, playing a game, and playing a network video.
In one embodiment of the invention, a channel of the softAP node can be determined, which generally has no interference with the router and other relay nodes, and therefore, the relay instruction can be issued on the channel.
In a specific implementation, the frequencies corresponding to different channels are:
Figure BDA0001273031340000151
and when the relay level is the first level, receiving login information input by a user, wherein the login information comprises a service set identifier and a password.
In this case, the User may be prompted at a UI (User Interface) to enter the SSID and password of the relay (i.e., mobile terminal).
And if the user inputs the SSID and the password in the UI, using the SSID and the password, and otherwise, using a default SSID and a default password.
When the relay level is the second level or more, the login information is extracted from the relay configuration information of the relay node at the upper level, the login information between the father node and the son node is kept the same, and under the condition that the invalid network signal is poor (such as less than-90 DB), roaming can be started, and other adjacent relay nodes are automatically connected by adopting the same login information.
If the login information is obtained, the softAP node of the Wi-Fi module can be started according to the target channel, the service set identification and the password so as to broadcast the service set identification in the target channel.
In a specific implementation, freq (channel), SSID, and password are written into a hostapd.
hostapd-d hostapd.conf
The freq, SSID and password can be validated.
After the relay instruction is sent, the broadcast frame sent by the relay node (i.e. the mobile terminal) carries the SSID, and after the SSID is scanned, other terminals can use the SSID and the password for connection.
In a specific implementation, the relay node (i.e., the mobile terminal) may be regarded as an AP, which periodically broadcasts a Beacon frame, and the SSID of the relay node (i.e., the mobile terminal) can be obtained by scanning the Beacon frame by other station devices.
When an application request sent by one or more electronic devices (application terminals and/or relay nodes at the next stage) for the SSID is received, a response message challenge text is returned to the one or more electronic devices.
When a connection request sent by one or more electronic devices is received, whether the password in the connection request is the same as a preset password or not is verified, and if yes, the one or more electronic devices are accessed.
And 105, configuring relay communication parameters according to the relay level so as to support communication between the station node and the softAP node.
In the embodiment of the invention, the relay nodes of different relay levels have different relay communication parameters, so that the station node and the softAP node can communicate with each other, and the softAP node is connected with the next-level application terminal and/or relay node due to the fact that the station node is connected with the first-level wireless node, so that the previous-level router or relay node can communicate with the next-level application terminal and/or relay node, and the relay function is realized.
In one embodiment of the present invention, step 105 may comprise the sub-steps of:
and a sub-step S21 of turning on the packet forwarding function.
In a specific implementation, a packet forwarding function may be started through an echo attribute value to support forwarding of a data packet between a station node and a softAP node:
echo 1>/proc/sys/net/ipv4/ip_forward
packet forwarding is the process of allowing packets to be forwarded from one terminal to another.
In the embodiment of the invention, a packet forwarding function is opened, and the data packet is supported to be mutually forwarded between the station node and the softAP node.
And a substep S22, when the relay level is the first level, setting the configuration information of the address translation function NAT.
In practical application, the configuration information of an Address translation function NAT (network Address translation) can be called to the Wi-Fi module through the system Address table service iptables, and the NAT can automatically modify the source IP Address and the destination IP Address of the IP packet to disguise the IP Address of the application terminal.
Of course, prior routing tables may also be purged before sending the routing tables and NAT.
The configuration information of the Iptables and NAT configuration is as follows:
# remove old rules (clear previous routing tables)
iptables-F
iptables-t filter-F
iptables-t nat-F
#Bring up NAT rules
iptables-t nat-A POSTROUTING-s 192.168.49.0/24-d 0.0.0.0/0-jMASQUERADE
Wherein, assuming that the IP segment of the relay (i.e. the mobile terminal) is 192.168.49.0, the sending Bring up NAT rules can repackage and unpack the data packet with 192.168.49.0/24 network segment as the source address, and disguise as the source address of 0.0.0.0/0.
And a substep S23, when the relay level is the second level or below, allocating an IP address from the relay node of the previous level, and establishing a routing path between the relay nodes of each level.
In a specific implementation, an IP address may be dynamically assigned to a relay node at or below the second level.
In one embodiment, the total address space may be divided into multiple segments or multiple sub-domains, each relay node may continue to allocate its assigned address to a sub-node from which the application terminal does not have a sub-node, so no address needs to be allocated.
The mobile terminal as a relay node has an address pool, i.e. a set of addresses, the address pool capacity of a relay node at or below the second level is determined from its parent node, which calculates the address pool capacity by the following formula:
Cskip(d)=1+Cm×(Lm-d-1) Rm=1
Cskip(d)=(1+Cm-Rm-Cm×Rm Lm-d-1)/(1-Rm) Rm≠1
wherein, Cskip(d) An offset value indicating that a parent node having a relay level d determines when assigning an address, an address pool capacity of a corresponding child node, CmIndicating the maximum number of subnodes, L, that the relay node can receivemRepresenting the maximum depth of the network (relay level),Rmrepresents the maximum number of subnodes that the relay node can receive, and d represents the node depth (relay level).
The depth d of a father node is increased by 1 when the network is accessed, the depth of a coordinator is defined as 0, Cm、Lm、RmThese three parameters may be provided by the user describing the size and general form of the network.
Calculating the offset Cskip(d) And then, the father node determines the network address according to the type of the network-accessing child node.
If the child node is a relay node, the address can be calculated by adopting the following formula:
An=Ap+Cskip(d)×(n-1)+1 1≤n≤Rm
wherein A ispIs the network address of a father node, n is the node applying for network access and is the second child relay node, AnAnd obtaining the network address for the nth network access sub-relay node.
In the embodiment of the present invention, a relay routing table may be maintained in each relay node, and in the relay routing table, when each relay node enters the network, its assigned address and a parent-child relationship between the relay node and other relay nodes may be recorded, and when each relay node exits the network, its assigned address is deleted, so that the parent-child relationship and addresses between relays at each level may constitute a routing path of relays at each level.
And a substep S24 of inquiring the IP address of the router or the relay node of the previous stage.
Substep S25, setting the IP address of the router or the relay node at the upper stage as the gateway address of the domain name system DNS
In the embodiment of the invention, on one hand, an address table service iptable in the system can be called to send a gateway address of a DNS (Transmission Control Protocol) based on a TCP (Transmission Control Protocol) to a Wi-Fi module;
the command format is:
iptables-tnat-I PREROUTING-I (Relay device name) -p tcp-dport 53-j DNAT-to-destination (gateway)
On the other hand, the address table service iptable in the system can be called, and a gateway address of the DNS based on UDP (Open system interconnection) is sent to the Wi-Fi module.
The command format is:
iptables-tnat-I PREROUTING-I (Relay device name) -p udp-dport 53-j DNAT-to-destination (gateway)
When the relay node of which the relay level is the first level, the gateway address of the domain name system DNS is set as the gateway address of the router.
When the relay level is the second level or a relay node below the second level, the gateway address of the domain name system DNS is set as the IP address of the relay node at the upper level.
As described above, the DNS gateway addresses of TCP and UDP are added to the relay device (i.e., the mobile terminal), and after the DNS is configured, the input uniform resource locator URL is transferred step by step and is finally resolved by the DNS server, thereby implementing network communication.
The embodiment of the invention is characterized in that a mobile terminal is provided with a Wi-Fi module, a softAP node of the Wi-Fi module is started through a router or a relay node at the upper stage of a station node of the Wi-Fi module to connect an application terminal and/or a relay node at the lower stage, relay communication parameters are configured according to the current relay level to support communication between the station node and the softAP node, the mobile terminal is realized as the relay node, the relay node is hung behind the relay node to form a multi-stage relay network, the structure level of the network is expanded, the number of the relay nodes is increased, the number of the connected nodes is increased, and under the condition that intelligent household appliances, handheld terminals and other devices are increased, the newly-added devices can be connected with a relay and normally use wireless signals.
The embodiment of the invention is characterized in that a mobile terminal is provided with a Wi-Fi module, a softAP node of the Wi-Fi module is started through a router or a relay node at the upper stage of a station node of the Wi-Fi module to connect an application terminal and/or a relay node at the lower stage, a target channel is selected according to the current relay level and relay communication parameters are configured to support communication between the station node and the softAP node, the mobile terminal is realized as the relay node, the relay node is hung behind the relay node to form a multi-stage relay network, the structure level of the network is expanded, the number of the relay nodes is increased, the number of the connection is increased, and under the condition that the number of intelligent household appliances, handheld terminals and other devices is increased, newly-added devices can be connected with relays and normally use wireless signals. In addition, the target channel is self-adaptive to the relay level to be adjusted, the channels are not interfered with each other, the data forwarding capability of the relay function is improved, and the relay performance is improved.
In order to make those skilled in the art better understand the embodiments of the present invention, the relay network in the embodiments of the present invention is described below by way of specific examples.
As shown in fig. 4, it is assumed that there are a living room, a kitchen, two bedrooms (including a main bed and a secondary bed) and a study room in a house, wherein the main bed is close to the study room, and the secondary bed is close to the kitchen.
In this example, the router 42 is placed in the living room, the router 42 accesses the base station 41, and as a wireless node, broadcasts a Wi-Fi signal.
Due to the large living room area and the wall blockage, Wi-Fi signals in the main bed, the secondary bed, the study and the kitchen are weak, so that the mobile terminal 432 can be placed in the living room, the mobile terminal 431 can be placed near the main bed, the mobile terminal 4313 can be placed near the study, the mobile terminal 4321 can be placed near the secondary bed and the kitchen, the mobile terminal 43213 can be placed near the kitchen, and the mobile terminal 43211 can be placed near the secondary bed.
In the living room:
the mobile terminal 431 accesses the route 42 through the station node and starts the softAP node as a relay node of the first stage to relay the Wi-Fi signal to the master-slave.
The mobile terminal 432 accesses the route 42 through the station node and starts the softAP node as a relay node of the first level to relay the Wi-Fi signal to other parts of the living room (e.g., the balcony), respectively.
The portable computer 433 is used as an application terminal to access the route 42 for the user to perform work, entertainment and other processes in the living room.
The mobile terminal 4321 accesses the mobile terminal 432 through the station node and starts the softAP node as a relay node of the second level to relay the Wi-Fi signal to the sub-horizontal, kitchen.
The intelligent coffee machine 4322 and the intelligent water dispenser 4323 are used as application terminals to access the mobile terminal 432.
In the master-lying:
the tablet 4311, the PDA 4312 and the mobile terminal 4314 are accessed as application terminals to the mobile terminal 431 for the user to work, entertain and the like in the home position and the bedroom.
The mobile terminal 4313 accesses the mobile terminal 431 through the station node and starts the softAP node as a relay node of the second stage to relay the Wi-Fi signal to the study room.
In the study room:
the PC 43131 and the mobile terminal 43132 are accessed as application terminals to the mobile terminal 4313, so that the user can perform work, entertainment and other processes in the study.
In the secondary lying:
the mobile terminal 43211 accesses the mobile terminal 4321 through the station node and starts a softAP node as a relay node of the third stage to relay Wi-Fi signals to the second-lying.
The electronic game machine 432111, the television 432112, and the mobile terminal 432113 are connected to the mobile terminal 43111 as application terminals, so that the user can perform work, entertainment, and the like in a study room.
In the kitchen:
the mobile terminal 4322 accesses the mobile terminal 4321 through the station node and starts the softAP node as a relay node of the third stage to relay the Wi-Fi signal to the kitchen.
The intelligent refrigerator 432121, the intelligent microwave oven 432122 and the intelligent kitchen oven 432123 are used as application terminals to be connected to the mobile terminal 43112.
Referring to fig. 5, a flowchart illustrating steps of another embodiment of a method for configuring relay communication according to an embodiment of the present invention is shown, and the method is applied to a mobile terminal, where the mobile terminal is configured with a Wi-Fi module, and the method specifically includes the following steps:
and step 501, receiving a data packet sent by the application terminal and/or the relay node of the next level through the softAP node.
When the application terminal communicates with a target device (such as a web server) of an external network, the data packet generated by the application terminal is transmitted step by step through the relay node until the data packet is sent to the target device.
Step 502, forwarding the data packet from the softAP node to the station node.
In specific implementation, as the packet forwarding function is started, the data packet can be forwarded from the softAP node to the station node, so that forwarding of the data packet inside the relay node is realized.
Step 503, sending the data packet to the router or the relay node at the upper stage through the station node according to the communication configuration parameter.
In practical application, the data packet may be processed according to communication configuration parameters of different relay levels, so as to implement relay communication.
In one embodiment of the present invention, step 503 may include the following sub-steps:
and a substep S31, when the data packet has the uniform resource locator URL, inquiring the gateway address of the domain name system DNS.
And a substep S32, sending the data packet to the upper level router or the relay node through the station node according to the gateway address.
In the embodiment of the invention, the URL is analyzed when the application terminal accesses the webpage and the like.
If the gateway address of the DNS of the mobile terminal is the IP address of the relay node at the upper stage, the packet for resolving the URL can be forwarded to the relay node at the upper stage.
And the gateway address of the DNS of the relay node of the current level is the IP address of the relay node of the previous level, the packet for resolving the URL may be forwarded to the relay node of the previous level.
And until the D NS reaches the first-stage relay node, the gateway address of the D NS is the IP address of the router, the data packet for resolving the URL can be forwarded to the router, and the router sends the data packet to a server for providing domain name resolution for the external network and maps the URL to the IP address.
In another embodiment of the present invention, step 503 may include the following sub-steps:
and a substep S33, converting the source address in the data packet from the IP address of the application terminal to the IP address of the mobile terminal when the relay level is the first level.
And a substep S34 of transmitting the packet disguised from the IP address of the mobile terminal to the router at the upper stage through the station node.
For the relay node in the first level, the source address (i.e. the IP address of the mobile terminal) in the packet, such as 192.168.49.0, may be disguised as the IP address of the mobile terminal itself, such as 0.0.0.0, based on the NAT configuration information, and forwarded to the router.
In another embodiment of the present invention, step 503 may include the following sub-steps:
and a substep S35, when the relay level is at or below the second level,
and sending the data packet to a relay node at the upper stage through the station node.
In the embodiment of the present invention, for the relay node at the second level or below the second level, the data packet may be directly forwarded to the relay node at the upper level.
And step 504, receiving the data packet sent by the router or the relay node at the upper stage through the station node.
When the target device of the external network communicates with the application terminal, the data packet generated by the target device is transmitted to the relay node (i.e. the mobile terminal) hop by hop until the data packet is sent to the application terminal.
Step 505, forwarding the data packet from the station node to the softAP node.
In specific implementation, as the packet forwarding function is started, the data packet can be forwarded to the softAP node from the node station, so as to implement forwarding of the data packet inside the relay node.
Step 506, the data packet is sent to the next-level application terminal or the relay node through the softAP node according to the communication configuration parameters.
In practical application, the data packet may be processed according to communication configuration parameters of different relay levels, so as to implement relay communication.
In one embodiment of the present invention, step 506 may include the following sub-steps:
and a substep S41, converting the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal when the relay level is the first level.
And a substep S42, when the relay level is the second level or below, inquiring a source address in the data packet to obtain the IP address of the application terminal.
And a substep S43 of querying a target path from the IP address of the mobile terminal to the IP address of the application terminal through the relay routing tables between the relay nodes at each stage.
And a substep S44, inquiring the IP address of the application terminal or the relay node of the next stage in the target path.
And a substep S45, sending the data to the next-stage application terminal or relay node by the softAP node according to the IP address of the next-stage application terminal or relay node.
For the relay node of the first stage, the second IP address of the station node from which the packet originates may be determined, and the first IP address corresponding to the second IP address is looked up in the routing table, so that the packet may be forwarded to the softAP node to which the first IP address belongs.
For the relay node in the first level, the destination address in the packet (i.e. the IP address of the mobile terminal itself), for example, 0.0.0.0, may be translated into the IP address of the application terminal, for example, 192.168.49.0, based on the configuration information of the NAT. For each stage of relay node, since a plurality of relay nodes can be connected, that is, there are a plurality of routes to the application terminal, when a data packet is sent down, the destination address in the data packet can be queried to determine the application terminal to which the data packet is sent.
And inquiring a relay routing table to obtain a target path which can be routed to the application terminal, inquiring the IP address of the next-stage mobile terminal or the relay node from the path, and forwarding the data packet to the IP address.
If the next level is the application terminal, the data packet is sent to the application terminal through the softAP node, and the application terminal performs corresponding processing, such as loading a webpage, playing a video and the like.
If the next stage is a relay node, the softAP node transmits the packet to the relay node, and the relay node can continue to perform downward relay communication.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 6, a block diagram of a configuration apparatus for relay communication according to an embodiment of the present invention is shown, and is applied to a mobile terminal, where the mobile terminal is configured with a Wi-Fi module, and the apparatus may specifically include the following modules:
the upper level equipment connection module 601 is used for connecting a router or a relay node at the upper level through a station node of the Wi-Fi module;
a relay level detection module 602, configured to detect a relay level at which a relay node is located;
a target channel selecting module 603, configured to select a target channel according to the relay level;
a lower device connection module 604, configured to start a softAP node of the Wi-Fi module according to the relay level, so as to connect to a next application terminal and/or a relay node in the target channel;
a relay communication parameter configuration module 605, configured to configure a relay communication parameter according to the relay level, so as to support communication between the station node and the softAP node.
In one embodiment of the present invention, the target channel selecting module 603 includes:
the uplink channel setting submodule is used for inquiring a channel where a router or a relay node at the previous stage is located as an uplink channel;
a frequency band type determining submodule for determining the frequency band type of the uplink channel;
a first target channel calculation submodule, configured to calculate, when the relay level is a first level, a target channel that does not interfere with the uplink channel according to the frequency band type;
the adjacent channel detection submodule is used for detecting a channel where an adjacent relay node is located as an adjacent channel when the relay level is the second level or below the second level;
and the second adjacent channel calculation submodule is used for calculating a target channel which does not interfere with the uplink channel and the adjacent channel according to the frequency band type.
In one embodiment of the present invention, the first target channel calculation sub-module includes:
a first channel shifting unit, configured to shift the uplink channel by N channels as a target channel when the channel type is a 2.4G frequency band;
and the second channel offset unit is used for offsetting the uplink channel by M channels as a target channel when the channel type is a 5G frequency band.
In one embodiment of the present invention, the adjacent channel detection sub-module includes:
the relay node searching unit is used for searching the relay node which has the same service set identifier with the mobile terminal;
and the node channel detection unit is used for detecting the channel where the relay node is positioned as an adjacent channel.
In one embodiment of the present invention, the second adjacent channel calculation sub-module includes:
a third channel shifting unit, configured to shift the uplink channel by N channels as a candidate channel when the channel type is a 2.4G frequency band;
a fourth channel shifting unit, configured to shift the uplink channel by M channels as candidate channels when the channel type is a 5G frequency band;
an interference coefficient calculation unit, configured to calculate an interference coefficient by using signal information of a relay node to which the adjacent channel belongs when the candidate channel is the same as the adjacent channel;
and the target channel selecting unit is used for selecting a target channel from the candidate channels according to the interference coefficient.
In one embodiment of the present invention, the second adjacent channel calculation sub-module further includes:
a candidate channel supplement unit, configured to set, as a candidate channel, a channel with the smallest number or a channel with the largest number that is farthest from the candidate channel when the number of the candidate channels is one.
In one embodiment of the present invention, the interference coefficient calculation unit includes:
the node information detection subunit is used for detecting the number and/or the signal strength of the relay nodes to which the adjacent channels belong;
a node information calculating subunit, configured to calculate an interference coefficient by using the number and/or the signal strength, where the number and/or the signal strength are positively correlated to the interference coefficient.
In an embodiment of the present invention, the relay level detection module 602 includes:
the default level setting submodule is used for setting the relay level of the relay node as a first level;
the relay configuration information request submodule is used for requesting relay configuration information to an upper-level router or a relay node;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
the upper level extraction submodule is used for calculating the relay level of the relay node on the basis of the relay level of the relay node on the upper level so as to replace the first level;
and the current level calculating submodule is used for determining the relay level as the first level when the request fails.
In one embodiment of the present invention, the lower device connection module 604 includes:
the login information receiving submodule is used for receiving login information input by a user when the relay level is a first level;
the login information extraction submodule is used for extracting login information from relay configuration information of a relay node at the upper level when the relay level is at the second level or above, wherein the login information comprises a service set identifier and a password;
and the softAP node starting module is used for starting the softAP node of the Wi-Fi module according to the target channel, the service set identification and the password so as to broadcast the service set identification on the target channel.
In one embodiment of the present invention, the relay communication parameter configuration module 605 includes:
the packet forwarding function starting submodule is used for starting the packet forwarding function;
the address translation function setting submodule is used for setting the configuration information of the address translation function NAT when the relay level is the first level;
the IP address allocation submodule is used for allocating an IP address from the relay node of the previous stage when the relay level is the second stage or below the second stage and establishing a relay routing table between the relay nodes of each stage;
and/or the presence of a gas in the gas,
the IP address query submodule is used for querying the IP address of the router or the relay node at the upper stage;
and the domain name system DNS setting submodule is used for setting the IP address of the router or the relay node at the upper level as the gateway address of the domain name system DNS.
Referring to fig. 7, a block diagram of another configuration apparatus for relay communication according to an embodiment of the present invention is shown, and is applied to a mobile terminal, where the mobile terminal is configured with a Wi-Fi module, and the apparatus may specifically include the following modules:
an uplink data packet receiving module 701, configured to receive, by the softAP node, a data packet sent by a next-stage application terminal and/or a relay node;
an uplink relay communication module 702, configured to forward the data packet from the softAP node to the station node;
an uplink data packet sending module 703 is configured to send the data packet to a router or a relay node at an upper stage through the station node according to the communication configuration parameter.
A downlink data packet receiving module 704, configured to receive, by the station node, a data packet sent by a router or a relay node at an upper stage;
a downlink relay communication module 705 configured to forward the data packet from the station node to the softAP node;
a downlink data packet sending module 706, configured to send the data packet to an application terminal or a relay node at a next stage through the softAP node according to the communication configuration parameter.
In an embodiment of the present invention, the uplink data packet sending module 703 includes:
a gateway address query submodule, configured to query a gateway address of a domain name system DNS when the data packet has a uniform resource locator URL;
the gateway address sending submodule is used for sending the data packet to a router or a relay node at the upper stage through the station node according to the gateway address;
alternatively, the first and second electrodes may be,
a first IP address conversion sub-module, configured to convert, when the relay level is a first level, a source address in the data packet from an IP address of the application terminal to an IP address of the mobile terminal;
a first data packet forwarding sub-module, configured to send, through the station node, a data packet disguised as an IP address from the mobile terminal to a router at an upper level;
alternatively, the first and second electrodes may be,
and the second data packet forwarding submodule is used for sending the data packet to the relay node of the previous stage through the station node when the relay level is the second stage or below the second stage.
In an embodiment of the present invention, the downlink data packet sending module 706 includes:
a second IP address conversion sub-module, configured to convert the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal when the relay level is the first level;
a source address query submodule, configured to query a source address in the data packet to obtain an IP address of the application terminal when the relay level is a second level or below;
a target path query submodule, configured to query, through a relay routing table between each stage of relay nodes, a target path from the IP address of the mobile terminal to the IP address of the application terminal;
a lower address query submodule, configured to query an IP address of a next-stage application terminal or a relay node in the target path;
and the third data packet forwarding submodule is used for sending the data to the next-level application terminal or the next-level relay node through the softAP node according to the IP address of the next-level application terminal or the next-level relay node.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method for configuring relay communication and the device for configuring relay communication provided by the present invention are described in detail above, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (9)

1. A configuration method of relay communication is applied to a mobile terminal, wherein the mobile terminal is configured with a Wi-Fi module, and the method comprises the following steps:
a station node of the Wi-Fi module is connected with a router or a relay node of the upper stage;
detecting a relay level of a relay node;
selecting a target channel according to the relay level;
starting a softAP node of the Wi-Fi module according to the relay level so as to connect an application terminal and/or a relay node at the next level on the target channel;
configuring relay communication parameters according to the relay level to support communication between the station node and the softAP node;
the step of detecting the relay level as the relay node comprises:
setting a relay level as a first level, wherein the relay level is the relay node;
requesting relay configuration information from a router or a relay node at the upper level;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
on the basis of the relay level of the relay node at the upper stage, calculating the relay level where the relay node is located to replace the first stage;
when the request fails, the relay level as the relay node is determined to be the first level.
2. The method of claim 1, wherein the step of selecting the target channel according to the relay level comprises:
inquiring a channel where a router or a relay node at the upper stage is located as an uplink channel;
determining the frequency band type of the uplink channel;
when the relay level is a first level, calculating a target channel which does not interfere with the uplink channel according to the frequency band type;
when the relay level is the second level or below, detecting a channel where an adjacent relay node is located as an adjacent channel;
and calculating a target channel which does not interfere with the uplink channel and the adjacent channel according to the frequency band type.
3. The method of claim 2, wherein the step of calculating the target channel that does not interfere with the uplink channel according to the frequency band type comprises:
when the frequency band type is a 2.4G frequency band, offsetting the uplink channel by N channels to serve as a target channel;
and when the frequency band type is a 5G frequency band, offsetting the uplink channel by M channels to be used as a target channel.
4. The method of claim 2, wherein the step of detecting the channel in which the neighboring relay node is located as the neighboring channel comprises:
searching for a relay node which is the same as the service set identifier of the mobile terminal;
and detecting a channel where the relay node is positioned as an adjacent channel.
5. The method of claim 2, wherein the step of calculating the target channel that does not interfere with the uplink channel and the adjacent channel according to the frequency band type comprises:
when the frequency band type is a 2.4G frequency band, offsetting the uplink channel by N channels to serve as a candidate channel;
when the frequency band type is a 5G frequency band, offsetting the uplink channel by M channels to serve as a candidate channel;
when the candidate channel is the same as the adjacent channel, calculating an interference coefficient by adopting signal information of the relay node to which the adjacent channel belongs;
and selecting a target channel from the candidate channels according to the interference coefficient.
6. The method of claim 5, wherein the step of calculating the target channel that does not interfere with the uplink channel and the adjacent channel according to the frequency band type further comprises:
and when the number of the candidate channels is one, setting the channel with the minimum number or the channel with the maximum number which is farthest from the candidate channels as the candidate channels.
7. The method according to claim 5, wherein the step of calculating the interference coefficient by using the signal information of the relay node to which the adjacent channel belongs comprises:
detecting the number and/or the signal strength of relay nodes to which the adjacent channels belong;
calculating an interference factor using the number and/or the signal strength, wherein the number and/or the signal strength is positively correlated with the interference factor.
8. The method according to any one of claims 1 to 7, wherein the step of starting the softAP node of the Wi-Fi module according to the relay level to connect to the application terminal and/or the relay node of the next level on the target channel comprises:
when the relay level is a first level, receiving login information input by a user;
when the relay level is the second level or more, extracting login information from relay configuration information of a relay node of the previous level, wherein the login information comprises a service set identifier and a password;
starting a softAP node of the Wi-Fi module according to the target channel, the service set identification and the password so as to broadcast the service set identification on the target channel.
9. A configuration device for relay communication is applied to a mobile terminal, wherein the mobile terminal is configured with a Wi-Fi module, and the device comprises:
the upper-level equipment connection module is used for connecting a router or a relay node at the upper level through a station node of the Wi-Fi module;
the relay level detection module is used for detecting the relay level of the relay node;
a target channel selection module, configured to select a target channel according to the relay level;
the lower device connection module is used for starting a softAP node of the Wi-Fi module according to the relay level so as to connect a next-level application terminal and/or a relay node on the target channel;
a relay communication parameter configuration module, configured to configure a relay communication parameter according to the relay level, so as to support communication between the station node and the softAP node;
the relay level detection module includes:
the default level setting submodule is used for setting the relay level of the relay node as a first level;
the relay configuration information request submodule is used for requesting relay configuration information to an upper-level router or a relay node;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
the upper level extraction submodule is used for calculating the relay level of the relay node on the basis of the relay level of the relay node on the upper level so as to replace the first level;
and the current level calculating submodule is used for determining the relay level as the first level when the request fails.
CN201710254564.1A 2017-04-18 2017-04-18 Relay communication configuration method and device Active CN107040302B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710254564.1A CN107040302B (en) 2017-04-18 2017-04-18 Relay communication configuration method and device
PCT/CN2017/119921 WO2018192265A1 (en) 2017-04-18 2017-12-29 Configuration method and device for relay communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710254564.1A CN107040302B (en) 2017-04-18 2017-04-18 Relay communication configuration method and device

Publications (2)

Publication Number Publication Date
CN107040302A CN107040302A (en) 2017-08-11
CN107040302B true CN107040302B (en) 2020-06-12

Family

ID=59534936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710254564.1A Active CN107040302B (en) 2017-04-18 2017-04-18 Relay communication configuration method and device

Country Status (2)

Country Link
CN (1) CN107040302B (en)
WO (1) WO2018192265A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107257561B (en) * 2017-04-18 2021-04-06 青岛海信移动通信技术股份有限公司 Relay communication configuration method and device
CN107040302B (en) * 2017-04-18 2020-06-12 青岛海信移动通信技术股份有限公司 Relay communication configuration method and device
CN113163339B (en) * 2020-01-22 2022-05-13 深圳市云海物联科技有限公司 Method and device for searching equipment and terminal equipment
US20210368416A1 (en) * 2020-05-20 2021-11-25 Arcadyan Technology Corporation Wireless network bridging method and wireless network transmission device using the same
CN112533200B (en) * 2020-11-23 2021-10-08 广州技象科技有限公司 Data hopping transmission link management method and device based on system change

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212762B (en) * 2006-12-25 2011-03-16 华为技术有限公司 Method and system for allocating radio channel to trunk node
CN101577969A (en) * 2008-05-09 2009-11-11 中兴通讯股份有限公司 Resource allocation methods and resource regulation method
WO2010084775A1 (en) * 2009-01-26 2010-07-29 パナソニック株式会社 Relay apparatus, control method, and program
KR101908032B1 (en) * 2012-09-21 2018-10-15 삼성전자주식회사 Relay station and method for channel selection in a local area comunication system
CN105307290B (en) * 2015-09-30 2019-03-08 青岛海信移动通信技术股份有限公司 A kind of configuration method and device of the trunk channel of mobile device
CN105228150A (en) * 2015-09-30 2016-01-06 青岛海信移动通信技术股份有限公司 A kind of mobile device carries out the method and apparatus of relaying
CN107040302B (en) * 2017-04-18 2020-06-12 青岛海信移动通信技术股份有限公司 Relay communication configuration method and device

Also Published As

Publication number Publication date
CN107040302A (en) 2017-08-11
WO2018192265A1 (en) 2018-10-25

Similar Documents

Publication Publication Date Title
CN107040302B (en) Relay communication configuration method and device
CN107257561B (en) Relay communication configuration method and device
CN105228213A (en) A kind of mobile device carries out the method and apparatus of relaying
CN106535238B (en) Link switching method and device
CN105307290B (en) A kind of configuration method and device of the trunk channel of mobile device
CN105375970B (en) A kind of method and apparatus that mobile device is relayed
US20180041889A1 (en) Wireless communication system
CN105228150A (en) A kind of mobile device carries out the method and apparatus of relaying
CN107113892B (en) Method and device for automatically networking gateway equipment
CN105375969A (en) A method and a device for relaying by a mobile device
JP6239636B2 (en) System, apparatus, and method for range expansion of wireless communication (RANGEEXTENSION)
JPWO2015012208A1 (en) Access point, wireless communication method and program
CN105517182A (en) Random access signaling transmitting method and transmitting device
CN105227693A (en) The collocation method of a kind of DNS of mobile device and device
CN105101466A (en) Wireless network configuration method and wireless network configuration system
US10567338B2 (en) Method and apparatus for setting up relay link in wireless communication system
CN104918302B (en) A kind of method and wireless sound box for building wireless mesh network
CN107249204B (en) Antenna setting method and device for relay communication
CN115529668B (en) Channel selection method, electronic equipment and storage medium
JP2010177796A (en) Communication control device and method, program, and communication system
CN106878182B (en) Data transmission method and equipment
EP3437383B1 (en) Method for performing random access, and associated terminal device
JP2017022556A (en) Communication device and communication method
Di Benedetto et al. Cognitive radio and networking for cooperative coexistence of heterogeneous wireless networks
JP2007019670A (en) Power line communication system, access plc modem, premises plc modem, and power line communication method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.