WO2018192265A1 - 一种中继通信的配置方法和装置 - Google Patents

一种中继通信的配置方法和装置 Download PDF

Info

Publication number
WO2018192265A1
WO2018192265A1 PCT/CN2017/119921 CN2017119921W WO2018192265A1 WO 2018192265 A1 WO2018192265 A1 WO 2018192265A1 CN 2017119921 W CN2017119921 W CN 2017119921W WO 2018192265 A1 WO2018192265 A1 WO 2018192265A1
Authority
WO
WIPO (PCT)
Prior art keywords
relay
level
channel
node
relay node
Prior art date
Application number
PCT/CN2017/119921
Other languages
English (en)
French (fr)
Inventor
杨川庆
赵玉峰
刘宏举
Original Assignee
青岛海信移动通信技术股份有限公司
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 青岛海信移动通信技术股份有限公司 filed Critical 青岛海信移动通信技术股份有限公司
Publication of WO2018192265A1 publication Critical patent/WO2018192265A1/zh

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

Definitions

  • the present invention relates to the technical field of communications, and in particular, to a method for configuring relay communication and a device for configuring relay communication.
  • Wi-Fi WIreless-Fidelity
  • the number of devices that the router can connect to is limited, and the newly added devices may not be able to connect to routers or relays, and wireless signals cannot be used.
  • the embodiment of the invention provides a configuration method of relay communication and a corresponding configuration device of relay communication.
  • a method for configuring a relay communication for a mobile terminal wherein the mobile terminal is configured with a Wi-Fi module, and the method includes:
  • a relay communication parameter is configured according to the relay level to support communication between the station node and the softAP node.
  • the step of selecting a target channel according to the relay level includes:
  • the relay level When the relay level is the first level, calculating, according to the frequency band type, a target channel that does not interfere with the uplink channel;
  • the relay level When the relay level is lower than the second level or the second level, detecting a channel where the adjacent relay node is located as an adjacent channel, and calculating, according to the frequency band type, the uplink channel and the phase A target channel in which adjacent channels do not interfere with each other.
  • the step of calculating a target channel that does not interfere with the uplink channel according to the frequency band type includes:
  • the uplink channel is offset by N channels as a target channel, and N is an integer greater than or equal to 5;
  • the uplink channel is offset by M channels as a target channel, and M is an integer greater than or equal to 1.
  • the step of detecting a channel where the adjacent relay node is located as an adjacent channel includes:
  • the channel in which the relay node is located is detected as an adjacent channel.
  • 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:
  • the uplink channel is offset by N channels as a candidate channel, and N is an integer greater than or equal to 5;
  • the uplink channel is offset by M channels as a candidate channel, and M is an integer greater than or equal to 1;
  • the interference coefficient is calculated by using signal information of the relay node to which the adjacent channel belongs, and the target channel is selected from the candidate channel according to the interference coefficient.
  • 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:
  • the channel with the smallest number or the channel with the largest number farthest from the candidate channel is set as the candidate channel.
  • the step of calculating the interference coefficient by using the signal information of the relay node to which the adjacent channel belongs includes:
  • the interference coefficient is calculated using the quantity and/or the signal strength, wherein the quantity and/or the signal strength is positively correlated with the interference coefficient.
  • the step of detecting the relay level as the relay node includes:
  • the relay level as the relay node is the first level.
  • the step of starting the softAP node of the Wi-Fi module according to the relay level to connect the application terminal and/or the relay node of the next level to the target channel includes:
  • the login information is extracted from the relay configuration information of the relay node of the upper level, where the login information includes a service set identifier and a password;
  • the step of configuring the relay communication parameter according to the relay level to support communication between the station node and the softAP node includes:
  • an IP address is allocated from the relay node of the upper level, and a relay routing table between the relay nodes of each level is established; and/or, When the relay level is lower than the second level or the second level, query the IP address of the router or relay node of the upper level, and set the IP address of the router or relay node of the upper level to the DNS of the domain name system. Gateway address.
  • it also includes:
  • the step of sending the data packet to the router or relay node of the upper level by using the station node according to the communication configuration parameter includes:
  • the data packet When the data packet has a uniform resource locator URL, query the gateway address of the domain name system DNS, and send the data packet to the router or relay node of the upper level according to the gateway address by the station node; or,
  • the relay level When the relay level is the first level, converting the source address in the data packet from the IP address of the application terminal to the IP address of the mobile terminal, and masquerading from the station node through the station node
  • the data packet of the IP address of the mobile terminal is sent to the router of the upper level; or,
  • the data packet is sent to the relay node of the upper level by the station node.
  • it also includes:
  • the step of sending the data packet to the relay node of the next level by using the softAP node includes:
  • the relay level When the relay level is the first level, converting the destination address in the data packet from an IP address of the mobile terminal to an IP address of the application terminal;
  • the source address is queried in the data packet, and the IP address of the application terminal is obtained;
  • the data is sent by the softAP node to the application terminal or the relay node of the next level according to the IP address of the application terminal or the relay node of the next level.
  • a configuration apparatus for relay communication of a mobile terminal the mobile terminal being configured with a Wi-Fi module, the apparatus comprising:
  • a superordinate device connection module configured to connect to a router or a relay node of a higher level through a station node of the Wi-Fi module
  • a relay level detection module configured to detect a relay level as a relay node
  • a target channel selection module configured to select a target channel according to the relay level
  • a lower-level device connection module configured to start a softAP node of the Wi-Fi module according to the relay level, to connect an application terminal and/or a relay node of a lower level on the target channel;
  • a relay communication parameter configuration module configured to configure a relay communication parameter according to the relay level to support communication between the station node and the softAP node.
  • the target channel selection module includes:
  • An uplink channel setting submodule configured to query a channel where the router or the relay node of the upper level is located, as an uplink channel;
  • a frequency band type determining submodule configured to determine a frequency band type of the uplink channel
  • a first target channel calculation submodule configured to calculate, according to the frequency band type, a target channel that does not interfere with the uplink channel according to the frequency band type when the relay level is the first level;
  • An adjacent channel detecting submodule configured to detect, when the relay level is the second level or the second level, a channel where the adjacent relay node is located, as an adjacent channel;
  • a second adjacent channel calculation submodule configured to calculate, according to the frequency band type, a target channel that does not interfere with the uplink channel and the adjacent channel.
  • the first target channel calculation submodule includes:
  • a first channel offset unit configured to: when the channel type is a 2.4G frequency band, offset the uplink channel by N channels as a target channel, where N is an integer greater than or equal to 5;
  • a second channel offset unit configured to: when the channel type is a 5G frequency band, offset the uplink channel by M channels as a target channel, where M is an integer greater than or equal to 1.
  • the adjacent channel detection submodule includes:
  • a relay node searching unit configured to search for a relay node that is the same as a service set identifier of the mobile terminal
  • a node channel detecting unit is configured to detect a channel where the relay node is located as an adjacent channel.
  • the second adjacent channel calculation submodule includes:
  • a third channel offset unit configured to: when the channel type is a 2.4G frequency band, offset the uplink channel by N channels as a candidate channel, where N is an integer greater than or equal to 5;
  • a fourth channel offset unit configured to: when the channel type is a 5G frequency band, offset the uplink channel by M channels as a candidate channel, where M is an integer greater than or equal to 1;
  • the interference coefficient calculation unit is configured to calculate an interference coefficient by using signal information of the relay node to which the adjacent channel belongs when the candidate channel is the same as the adjacent channel;
  • a target channel selecting unit configured to select a target channel from the candidate channels according to the interference coefficient.
  • the second adjacent channel calculation submodule further includes:
  • the candidate channel supplementing unit is configured to set, as the candidate channel, the channel with the smallest number or the channel with the largest number, which is the farthest from the candidate channel, when the number of the candidate channels is one.
  • the interference coefficient calculation unit includes:
  • a node information detecting subunit configured to detect a quantity and/or a signal strength of a relay node to which the adjacent channel belongs
  • the relay level detection module includes:
  • the default level setting submodule is used to set the relay level as the relay node to the first level
  • a relay configuration information requesting submodule configured to request relay configuration information from a router or a relay node at a higher level
  • the upper level extraction submodule is configured to calculate, according to a relay level of the relay node of the upper level, a relay level that is a relay node, to replace the first level;
  • the current level calculation submodule is configured to determine that the relay level to be the relay node is the first level when the request fails.
  • the subordinate device connection module includes:
  • a login information receiving submodule configured to receive login information input by the user when the relay level is the first level
  • a login information extraction submodule configured to: when the relay level is the second level or the second level, extract login information from the relay configuration information of the relay node of the upper level, where the login information includes Service set identifier and password;
  • a softAP node activation submodule configured to start a softAP node of the Wi-Fi module according to the target channel, the service set identifier, and the password, to broadcast the service set identifier on the target channel.
  • the relay communication parameter configuration module includes:
  • the packet forwarding function enables the sub-module to enable the packet forwarding function.
  • the address conversion function setting submodule is configured to set configuration information of the address translation function NAT when the relay level is the first level;
  • An IP address allocation submodule configured to allocate an IP address from a relay node of a higher level when the relay level is lower than the second level or the second level, and establish a relay route between the relay nodes at each level table.
  • the relay communication parameter configuration module further includes:
  • An IP address query submodule configured to query an IP address of a router or a relay node of a higher level when the relay level is lower than a second level or a second level;
  • the DNS system setting sub-module of the domain name system is used to set the IP address of the router or relay node of the upper level to the gateway address of the DNS of the domain name system.
  • the relay communication parameter configuration module includes:
  • the packet forwarding function enables the sub-module to enable the packet forwarding function.
  • the address conversion function setting submodule is configured to set configuration information of the address translation function NAT when the relay level is the first level;
  • An IP address query submodule configured to query an IP address of a router or a relay node of a higher level when the relay level is lower than a second level or a second level;
  • the DNS system setting sub-module of the domain name system is used to set the IP address of the router or relay node of the upper level to the gateway address of the DNS of the domain name system.
  • it also includes:
  • An uplink data packet receiving module configured to receive, by using the softAP node, a data packet sent by an application terminal and/or a relay node of a next level;
  • An uplink relay communication module configured to forward the data packet from the softAP node to the station node;
  • an uplink data packet sending module configured to send, by using the station node, the data packet to a router or a relay node of a higher level according to the communication configuration parameter.
  • the uplink data packet sending module includes:
  • a gateway address query sub-module configured to query a gateway address of the domain name system DNS when the data packet has a uniform resource locator URL, and a gateway address sending sub-module, configured to use the station node according to the gateway address Sending the data packet to a router or relay node of a higher level;
  • the uplink data packet sending module includes:
  • a first IP address translation submodule configured to convert a source address in the data packet from an IP address of the application terminal to an IP address of the mobile terminal when the relay level is a first level
  • a first packet forwarding submodule configured to send, by the station node, a data packet masquerading from an IP address of the mobile terminal to a router of a higher level
  • the uplink data packet sending module includes:
  • a second data packet forwarding submodule configured to send the data packet to the relay node of the upper level by using the station node when the relay level is lower than the second level or the second level.
  • it also includes:
  • a downlink data packet receiving module configured to receive, by using the station node, a data packet sent by a router or a relay node of a higher level;
  • a downlink relay communication module configured to forward the data packet from the station node to the softAP node
  • a downlink data packet sending module configured to send, by using the softAP node, the data packet to an application terminal or a relay node of a next level according to the communication configuration parameter.
  • the downlink data packet sending module includes:
  • a second IP address translation sub-module configured to: when the relay level is the first level, convert the destination address in the data packet from an IP address of the mobile terminal to an IP address of the application terminal;
  • a source address query sub-module configured to query a source address in the data packet to obtain an IP address of the application terminal, when the relay level is lower than a second level or a second level;
  • a target path query sub-module configured to query, by using a relay routing table between the relay nodes of each level, a target path that is routed from the IP address of the mobile terminal to an IP address of the application terminal;
  • a sub-address query sub-module configured to query, in the target path, an IP address of an application terminal or a relay node of a next level
  • a third data packet forwarding submodule configured to send, by the soft AP node, the data to an application terminal or a relay node of a next level according to an IP address of an application terminal or a relay node of a next level.
  • a computer readable storage medium storing executable program code for implementing the method of any of the first aspects.
  • a mobile terminal includes a transceiver, a processor connected to the transceiver, and a memory, wherein: the processor is configured to read a program in the memory, and execute the foregoing The method of any of the preceding aspects; the transceiver for receiving and transmitting data under control of the processor.
  • FIG. 1 is a flow chart showing the steps of a method for configuring relay communication according to an embodiment of the present invention
  • 2 is a channel distribution diagram of a 2.4G channel
  • Figure 3 is a channel distribution diagram of a 5G channel
  • FIG. 4 is a topological diagram of a relay network according to an embodiment of the present invention.
  • FIG. 5 is a flow chart showing the steps of another method for configuring relay communication according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram of an embodiment of a configuration apparatus for relay communication according to an embodiment of the present invention.
  • FIG. 7 is a structural block diagram of another embodiment of a configuration apparatus for relay communication according to an embodiment of the present invention.
  • FIG. 8 is a structural block diagram of a mobile terminal according to an embodiment of the present invention.
  • the discarded mobile terminal is attached to the router as a repeater, and the received wireless will be received.
  • the signal is transmitted out to increase the coverage of the wireless signal to expand the communication distance and wireless signal coverage, and the wireless weak signal is enhanced.
  • the number of devices that a router can connect to is limited, and the number of devices that can be relayed is limited.
  • an embodiment of the present invention provides a relay communication configuration method and apparatus for a mobile terminal.
  • FIG. 1 is a flow chart showing the steps of a method for configuring a relay communication according to an embodiment of the present invention. Specifically, the method may include the following steps:
  • Step 101 Connect a router or a relay node of a higher level through a station node of the Wi-Fi module.
  • embodiments of the present invention may be applied to mobile terminals, such as mobile phones, tablet computers, smart wearable devices (such as smart watches), and the like.
  • These mobile terminals can be installed with Windows Phone, Android (Android), IOS or Windows operating systems, and are equipped with Wi-Fi (WIreless-Fidelity) modules, which can be connected to wireless nodes as relay nodes to forward wireless signals.
  • Wi-Fi Wi-Fi
  • the Wi-Fi module also known as the serial Wi-Fi module, belongs to the IoT transport layer and can convert serial or TTL (transistor transistor logic) signals into embedded devices that conform to Wi-Fi wireless network communication standards.
  • Module built-in wireless network protocol IEEE802.11b.gn protocol stack and TCP/IP (Transmission Control Protocol/Internet Protocol) protocol stack.
  • a Wi-Fi module usually has three functions: station, softAP, and P2P.
  • station means the devices connected to the wireless network, these devices can communicate with other internal devices or wireless networks through wireless APs (Wireless Access Points, wireless access nodes).
  • wireless APs Wireless Access Points, wireless access nodes
  • softAP indicates that the application implements the AP function, so that the mobile terminal can be used as a route to link other sites.
  • P2P Peer-to-Peer
  • Wi-Fi Direct Also known as Wi-Fi Direct, it can support two Wi-Fi devices directly connected and communicate without an AP.
  • the mobile terminal may be connected to the device of the upper level as a relay node, and the device may be a router or a relay node, that is, after the relay node, the relay node may be connected to form a tree. Shaped relay network.
  • the router of the upper level can be connected through the station node of the Wi-Fi module.
  • the relay node of the upper level can be connected through the station node of the Wi-Fi module.
  • the getWifiState() method in the WifiManager may be invoked to detect whether the mobile terminal has turned on the Wi-Fi station node.
  • the API Application Programming Interface
  • the ConnectivityManager can be used to pass the ConnectivityManager.TYPE_WIFI as a parameter to detect whether the station node is connected to the wireless node.
  • a prompt message for connecting the wireless node such as "Please open Wi-Fi and connect to the router or relay" is generated.
  • Step 102 Detect a relay level at which the relay node is located.
  • the current relay level can be identified.
  • the relay node of the first level may be referred to as a root node, a two-level relay node connected to each other, and the relay node of the upper level is a parent node of the relay node of the next level, relatively speaking, in the next level
  • the node is a child node of the relay node of the upper level.
  • each level of the relay node may maintain a relay configuration information, in which the routing path, the relay level, and the login information (such as an SSID (Service Set Identifier) may be recorded. ) and password) and other information.
  • the login information such as an SSID (Service Set Identifier) may be recorded.
  • password password
  • the relay level at which the relay node is located can be set to the first level.
  • the router or relay node of the upper level requests the relay configuration information.
  • the device of the upper level is a router and the router does not set the specification, the request of the mobile terminal is ignored.
  • the relay node has set the specification, and responds to the request of the mobile terminal, and returns the relay configuration information.
  • the relay level of the relay node of the upper level is extracted from the relay configuration information.
  • the relay level at which the relay node is located is calculated to replace the first level.
  • the mobile terminal may add one to the relay level of the relay node of the upper level, and then obtain the relay level at which the mobile terminal is currently acting as the relay node.
  • the relay level of the relay node of the upper level is the second level
  • the relay level of the mobile terminal as the relay node is the third level
  • the default first level is modified to the third level.
  • the foregoing detection method of the relay level is only an example.
  • other detection methods of the relay level may be set according to actual conditions, for example, the router or the relay node of the upper level requests the relay level. If the request fails, it is set to the first level. If the request is successful, the current relay level is calculated based on the relay level of the relay node of the upper level, and the like, which is not used in the embodiment of the present invention. limit.
  • the detection method of the other relay level may be adopted by a person skilled in the art according to actual needs, which is not limited by the embodiment of the present invention.
  • Step 103 Select a target channel according to the relay level.
  • the electromagnetic waves of non-self-devices are all interference sources.
  • the interference source emits electromagnetic energy.
  • the electromagnetic energy is transmitted to sensitive equipment through a certain propagation path, and the sensitive equipment generates some form of response to the interference and produces interference effects. .
  • the Wi-Fi antennas in the mobile terminal are closely spaced, and the distance between the mobile terminal and the mobile terminal is also very close, and the maximum interference is from the electromagnetic coupling of the antenna or the surrounding antenna, possibly This can lead to problems of low data forwarding capability and poor relay performance.
  • the target channel can be selected according to the relay level to select the frequency range that does not interfere with each other, and the relay function is solved. The problem of low forwarding capability and poor relay performance due to channel interference caused by channel setting.
  • step 103 may comprise the following sub-steps:
  • Sub-step S11 querying the channel where the router or relay node of the upper level is located as the uplink channel.
  • the WifiService is the core service responsible for the WiFi function
  • the WifiStateMachine subsystem is responsible for maintaining various status information of the WiFi.
  • the status information includes channel information of the router or relay node of the upper level. Therefore, the first channel of the router or relay node of the upper level can be obtained by calling the mWifiStateMachine.fetchFrequencyNative() function of the system.
  • Sub-step S12 determining the frequency band type of the uplink channel.
  • the working frequency band of the first channel of the router or the relay node is different, mainly including the 2.4G frequency band (2.412GHz-2.484GHz) and the 5G frequency band (5.735GHz-5.835GHz), among which most routers or
  • the relay node generally uses the wireless technology running on 2.4Ghz, adopts the (fourth generation) 802.11n standard, and the fifth generation Wi-Fi technology running on the 5Ghz high frequency band adopts the 802.11ac protocol standard.
  • Sub-step S13 when the relay level is the first level, calculate a target channel that does not interfere with the uplink channel according to the frequency band type.
  • the mobile terminal connects to the router, and can directly set the target channel according to the frequency band type of the uplink channel of the router.
  • the uplink channel is offset by N channels as a target channel, where N is a positive integer and N ⁇ 5.
  • the spectrum of 1-14 channels in the 2.4G frequency band is a gradient matrix. From the perspective of the frequency band, there are three independent frequency bands. The range of each independent frequency band is approximately 22MHz, because adjacent frequency bands have equal crossings. The frequency value, there is interference in the channels in each independent frequency band, the specific frequency bands are as follows:
  • the frequency shared by channel 1 and channel 2 is 2406-2423.
  • the channel of the uplink channel of the router or relay node of the upper level is set to 1
  • the target channel of the relay node is set to 2
  • the uplink channel can be offset by at least 5 channels as the target channel.
  • X is the upstream channel of the router or relay node of the upper level
  • Y is the target channel of the relay node (ie, the mobile terminal)
  • X and Y are positive integers, and when Y ⁇ 1 or Y>13, Y is invalid and needs to be discarded.
  • the uplink channel is offset by M channels as the target channel, where M is a positive integer, such as 1, 2.
  • the uplink channel of the router or relay node of the upper level is not the same channel as the target channel of the current relay node, that is, interference can be substantially avoided.
  • Sub-step S14 when the relay level is lower than the second level or the second level, detecting a channel in which the adjacent relay node is located as an adjacent channel.
  • the relay node may find a relay node that is the same as the service set identifier of the mobile terminal, and detects the relay node.
  • Sub-step S15 calculating a target channel that does not interfere with the uplink channel and the adjacent channel according to the frequency band type.
  • the mobile terminal connects to the relay node, and the target channel can be set according to the frequency band type of the uplink channel of the nearby relay node.
  • the uplink channel is offset by N channels as a candidate channel, where N is a positive integer and N ⁇ 5.
  • the uplink channel is offset by M channels as a candidate channel, where M is a positive integer, such as 1, 2.
  • the candidate channel 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 belongs to the same relay network as the current relay node, and there may be interference. Therefore, the relay node to which the adjacent channel belongs may be used.
  • the signal information calculates the interference coefficient.
  • the adjacent channel can be ignored.
  • the number and/or signal strength of the relay nodes to which the adjacent channels belong may be detected, and the interference coefficients may be calculated using the number and/or the signal strength by configuring weight summation or the like.
  • the quantity and / or signal strength is positively correlated with the interference coefficient, that is, the more the number, the stronger the signal strength, the larger the interference coefficient, and conversely, the smaller the number, the lower the signal strength, and the smaller the interference coefficient.
  • the target channel is selected from the candidate channels according to the interference coefficient.
  • the target channel is selected from the candidate channels with the smallest interference coefficient.
  • the channel with the smallest number or the channel with the largest number, which is the farthest from the candidate channel is set as the candidate channel.
  • Y is the upstream channel of the router or relay node of the upper level
  • Z is the target channel of the relay node (ie, the mobile terminal)
  • Step 104 Start a softAP node of the Wi-Fi module according to the relay level, to connect an application terminal and/or a relay node of a next level to the target channel.
  • the relay instruction may be sent to the Wi-Fi module according to the relay level, and the softAP node is started, and the soft AP node is connected.
  • Level 1 application terminal and/or relay node may be sent to the Wi-Fi module according to the relay level, and the softAP node is started, and the soft AP node is connected.
  • the application terminal may refer to a terminal that implements its own functions, for example, a smart rice cooker, a smart air conditioner, a smart water heater, and the like.
  • the mobile terminal in addition to being a relay node, can also be used as an application terminal to implement functions such as browsing a webpage, playing a game, and playing a network video.
  • the channel of the softAP node may be determined, and the channel generally has no interference with the router and other relay nodes, and therefore, the relay instruction may be sent and received on the channel.
  • the frequency corresponding to different channels is:
  • the login information input by the user is received, and the login information includes a service set identifier and a password.
  • the UI User Interface
  • the relay ie, the mobile terminal
  • the SSID and password are used. Otherwise, the default SSID and password are used.
  • the login information is extracted from the relay configuration information of the relay node of the upper level, and the same login information between the parent node and the child node is maintained, and the invalid network signal is compared.
  • a difference eg less than -90 DB
  • roaming can be initiated, and the same login information is used to automatically connect to other adjacent relay nodes.
  • the softAP node of the Wi-Fi module can be activated according to the target channel, the service set identifier, and the password to broadcast the service set identifier on the target channel.
  • the freq (channel), SSID, and password are written into the hostapd.conf configuration file, and the relay instruction that enables the softAP node service is:
  • the freq, SSID, and password can be validated.
  • the broadcast frame sent by the relay node (that is, the mobile terminal) carries the SSID, and other terminals can connect with the SSID and password after scanning.
  • the relay node ie, the mobile terminal
  • the relay node can be regarded as an AP, which periodically broadcasts the Beacon frame, and other station devices scan the Beacon frame to obtain the SSID of the relay node (ie, the mobile terminal).
  • a response message challenge text is returned to the one or more electronic devices.
  • connection request When receiving a connection request sent by one or more electronic devices, it is verified whether the password in the connection request is the same as the preset password, and if so, accessing one or more electronic devices.
  • Step 105 Configure a relay communication parameter according to the relay level to support communication between the station node and the softAP node.
  • the relay nodes of different relay levels have different relay communication parameters, so that the station between the station node and the softAP node can communicate, because the station node is connected to the wireless node of the upper level, and the soft AP node is connected.
  • the application terminal and/or the relay node of the next level enable the router or relay node of the upper level to communicate with the application terminal and/or the relay node of the next level to implement the relay function.
  • step 105 may include the following sub-steps:
  • Sub-step S21 the packet forwarding function is enabled.
  • the packet forwarding function may be enabled by using an echo attribute value to support forwarding of the data packet between the station node and the softAP node:
  • Packet forwarding is the process of allowing packets to be forwarded from one terminal to another.
  • the packet forwarding function is opened, and the data packet is supported between the station node and the softAP node.
  • Sub-step S22 when the relay level is the first level, setting configuration information of the network address translation function.
  • the configuration information of the NAT (Network Address Translation) function can be sent to the Wi-Fi module through the system address table service iptables.
  • the NAT will automatically modify the source IP address and destination IP address of the IP packet. To camouflage the IP address of the application terminal.
  • previous routing table can be cleared before sending the routing table and NAT.
  • the configuration information of Iptables and NAT configuration is as follows:
  • IP segment of the relay ie, the mobile terminal
  • the Bring up NAT rules can be used to re-encapsulate and unpack the data packets with the 192.168.49.0/24 network segment as the source address, and pretend to be 0.0. Source address of 0.0/0.
  • Sub-step S23 when the relay level is lower than the second level or the second level, an IP address is allocated from the relay node of the upper level, and a routing path between the relay nodes of each level is established.
  • an IP address can be dynamically assigned to it.
  • the total address space may be divided into multiple segments or multiple sub-domains, and each relay node may further allocate the address assigned to itself to the child node, and the application terminal has no child nodes, so Need to assign an address.
  • the mobile terminal as the relay node has an address pool, that is, a set of addresses, and the address pool capacity of the relay node below the second level or the second level is determined by the parent node, and the parent node calculates the address pool capacity by the following formula:
  • C skip (d) represents the offset determined by the parent node with the relay level d when assigning the address, the address pool capacity of the corresponding child node, and C m represents the maximum number of child nodes that the relay node can receive
  • L m represents the maximum depth of the network (relay level)
  • R m represents the maximum number of child nodes that the relay node can receive
  • d represents the node depth (relay level).
  • the depth d increases the depth of the parent node when entering the network, and the depth of the coordinator is defined as 0.
  • the three parameters C m , L m , and R m can be provided by the user to describe the scale and general form of the network.
  • the parent node After calculating the offset C skip (d), the parent node determines its network address according to the type of the incoming child node.
  • the address can be calculated using the following formula:
  • a n A p +C skip (d) ⁇ (n-1)+1 1 ⁇ n ⁇ R m
  • a p is the network address of the parent node
  • n is the node that applies for network access is the first child relay node
  • a n is the network address obtained by the nth incoming network relay node.
  • a relay routing table may be maintained in each relay node, and in the relay routing table, each of the relay nodes may record its assigned address when entering the network, and Following the parent-child relationship between the node and other relay nodes, each relay node deletes its assigned address when it quits, so that the parent-child relationship and address between the relays of each level can be composed in all levels. Following the routing path.
  • Sub-step S24 querying the IP address of the router or relay node of the upper level.
  • Sub-step S25 setting the IP address of the router or relay node of the upper level to the gateway address of the domain name system.
  • sub-step S24-S25 are optional steps.
  • sub-step S23 is an optional step, that is, when the relay level is the second level or lower, the sub-steps S24-S25 are performed.
  • the address table service iptable in the system may be called to send a gateway address of a DNS (Domain Name System) based on a TCP (Transmission Control Protocol) to a Wi-Fi module. ;
  • the command format is:
  • Iptables-t nat-I PREROUTING-i (relay device name)-p tcp--dport 53-j DNAT--to-destination (gateway)
  • the address table service iptable in the system can be called to send the gateway address of the DNS based on UDP (Open System Interconnection) to the Wi-Fi module.
  • UDP Open System Interconnection
  • the command format is:
  • Iptables-t nat-I PREROUTING-i (relay device name)-p udp--dport 53-j DNAT--to-destination (gateway)
  • the gateway address of the DNS is set as the gateway address of the router.
  • the gateway address of the DNS is set to the IP address of the relay node of the upper level.
  • the DNS gateway address of the TCP and UDP is added to the relay device (that is, the mobile terminal).
  • the input URL Uniform Resource Locator
  • the DNS server parsed by the DNS server.
  • a Wi-Fi module is configured in the mobile terminal, and a soft AP node of the Wi-Fi module is started by using a router or a relay node of the upper node of the station node of the Wi-Fi module to connect to the next level.
  • the application terminal and/or the relay node configure the relay communication parameter according to the current relay level to support communication between the station node and the softAP node, and implement the mobile terminal as a relay node in the relay node.
  • a multi-level relay network is formed, which expands the structure level of the network, increases the number of relay nodes, thereby increasing the number of connections, and ensuring new devices in the case of increased number of devices such as smart home appliances and handheld terminals.
  • the added device can be connected to the relay to use the wireless signal normally.
  • the target channel adaptive relay level is adjusted, and the channels do not interfere with each other, thereby improving the forwarding function capability of the relay function and improving the relay performance.
  • router 42 is placed in the living room, router 42 is connected to base station 41, and as a wireless node, the Wi-Fi signal is broadcast.
  • the mobile terminal 432 can be placed in the living room, and the mobile terminal 431 is placed near the master bedroom, and placed near the study room.
  • the mobile terminal 4313 places the mobile terminal 4321 in the vicinity of the second bedroom and the kitchen, the mobile terminal 43213 in the vicinity of the kitchen, and the mobile terminal 43211 in the vicinity of the second bedroom.
  • the mobile terminal 431 accesses the route 42 through the station node and activates the softAP node as a relay node of the first level to relay the Wi-Fi signal to the master bedroom.
  • the mobile terminal 432 accesses the route 42 through the station node, respectively, and activates the softAP node as a relay node of the first level to relay Wi-Fi signals to other parts of the living room, such as a balcony.
  • the portable computer 433 serves as an application terminal access route 42 for the user to perform work, entertainment, and the like in the living room.
  • the mobile terminal 4321 accesses the mobile terminal 432 through the station node, and activates the softAP node as a relay node of the second level to relay the Wi-Fi signal to the secondary bedroom and the kitchen.
  • the smart coffee machine 4322 and the smart water dispenser 4323 are connected to the mobile terminal 432 as application terminals.
  • the tablet 4311, the PDA 4312, and the mobile terminal 4314 are used as application terminals to access the mobile terminal 431 for the user to perform work, entertainment, and the like in the master bedroom.
  • the mobile terminal 4313 accesses the mobile terminal 431 through the station node, and activates the softAP node as a relay node of the second level to relay the Wi-Fi signal to the study.
  • the PC 43131 and the mobile terminal 43132 access the mobile terminal 4313 as an application terminal for the user to perform work, entertainment, and the like in the study.
  • the mobile terminal 43211 accesses the mobile terminal 4321 through the station node, and activates the softAP node as a relay node of the third level to relay the Wi-Fi signal to the secondary bedroom.
  • the electronic game machine 432111, the television 432112, and the mobile terminal 432113 are used as application terminals to access the mobile terminal 43111 for the user to perform work, entertainment, and the like in the study.
  • the mobile terminal 4322 accesses the mobile terminal 4321 through the station node and activates the softAP node as a relay node of the third level to relay the Wi-Fi signal to the kitchen.
  • the smart refrigerator 432121, the smart microwave oven 432122, and the smart kitchen oven 432123 are used as application terminals to access the mobile terminal 43112.
  • FIG. 5 a flow chart of a step of a method for configuring a relay communication according to an embodiment of the present invention is shown.
  • the mobile terminal is configured with a Wi-Fi module, and the method may be specifically implemented by using a Wi-Fi module. Including the following steps:
  • Step 501 Receive, by the soft AP node, a data packet sent by an application terminal and/or a relay node of a next level.
  • the application terminal communicates with a target device (such as a web server) of the external network
  • a target device such as a web server
  • Step 502 Forward the data packet from the softAP node to the station node.
  • the data packet can be forwarded from the softAP node to the station node, and the internal data packet of the relay node is forwarded.
  • Step 503 Send the data packet to the router or relay node of the upper level by using the station node according to the communication configuration parameter.
  • data packets can be processed according to communication configuration parameters of different relay levels to implement relay communication.
  • step 503 may comprise the following sub-steps:
  • Sub-step S31 when the data packet has a uniform resource locator URL, query the gateway address of the domain name system DNS.
  • Sub-step S32 the data packet is sent to the router or relay node of the upper level by the station node according to the gateway address.
  • the application terminal accesses a webpage or the like
  • the URL is parsed.
  • the gateway address of the DNS of the mobile terminal is the IP address of the relay node of the previous level
  • the data packet parsing the URL may be forwarded to the relay node of the upper level.
  • the gateway address of the DNS of the current level relay node is the IP address of the relay node of the previous level
  • the data packet parsing the URL may be forwarded to the relay node of the upper level.
  • the gateway address of the D NS is the IP address of the router, then the data packet parsing the URL can be forwarded to the router, and the router sends the server to the external network to provide domain name resolution, and maps the URL to IP. address.
  • step 503 can include the following sub-steps:
  • Sub-step S33 when the relay level is the first level, converting the source address in the data packet from the IP address of the application terminal to the IP address of the mobile terminal.
  • Sub-step S34 the data packet masquerading from the IP address of the mobile terminal is sent to the router of the upper level by the station node.
  • the source address (ie, the IP address of the mobile terminal) in the data 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, then forwarded to the router.
  • step 503 can include the following sub-steps:
  • Sub-step S35 when the relay level is lower than the second level or the second level, the data packet is sent to the relay node of the upper level by the station node.
  • the data packet can be directly forwarded to the relay node of the upper level.
  • Step 504 Receive, by the station node, a data packet sent by a router or a relay node of a higher level.
  • the data packet generated by the target device is transmitted hop by hop to the relay node (ie, the mobile terminal) until it is sent to the application terminal.
  • the relay node ie, the mobile terminal
  • Step 505 Forward the data packet from the station node to the softAP node.
  • the data packet can be forwarded from the node station point to the soft AP node, and the data packet of the relay node is forwarded.
  • Step 506 Send the data packet to the application terminal or the relay node of the next level by using the softAP node according to the communication configuration parameter.
  • steps 501-503 are data uplink transmission processes
  • steps 504-506 are data downlink transmission processes.
  • only data uplink transmission may be performed, or only data downlink transmission may be performed, and data uplink transmission and data downlink transmission may be performed.
  • data packets can be processed according to communication configuration parameters of different relay levels to implement relay communication.
  • step 506 can include the following sub-steps:
  • Sub-step S41 when the relay level is the 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.
  • Sub-step S42 when the relay level is lower than the second level or the second level, the source address is queried in the data packet, and the IP address of the application terminal is obtained.
  • Sub-step S43 the target path of the IP address routed from the IP address of the mobile terminal to the IP address of the application terminal is queried by a relay routing table between the relay nodes at each level.
  • Sub-step S44 querying, in the target path, an IP address of an application terminal or a relay node of a next level.
  • Sub-step S45 the data is sent by the softAP node to the application terminal or the relay node of the next level according to the IP address of the application terminal or the relay node of the next level.
  • the second IP address of the station node from which the data packet is sourced can be confirmed, and the first IP address corresponding to the second IP address is searched in the routing table, and the data packet can be forwarded to the first IP address.
  • the softAP node to which it belongs can be confirmed, and the first IP address corresponding to the second IP address is searched in the routing table, and the data packet can be forwarded to the first IP address.
  • the destination address in the data packet ie, the IP address of the mobile terminal itself
  • the IP address of the application terminal such as 192.168. 49.0.
  • the target address in the data packet can be queried to determine the data packet transmission.
  • the relay routing table learn the target path that can be routed to the application terminal, query the IP address of the mobile terminal or relay node of the next level from the path, and forward the data packet to the IP address.
  • the data packet is sent to the application terminal through the softAP node, and the application terminal performs corresponding processing, for example, loading a webpage, playing a video, and the like.
  • next level is a relay node
  • the data packet is sent to the relay node through the softAP node, and the relay node can continue to perform relay communication downward.
  • FIG. 6 is a structural block diagram of an embodiment of a configuration apparatus for relay communication according to an embodiment of the present invention.
  • the mobile terminal is configured with a Wi-Fi module, and the apparatus may specifically include The following modules:
  • the upper device connection module 601 is configured to connect the router or the relay node of the upper level through the station node of the Wi-Fi module;
  • a relay level detecting module 602 configured to detect a relay level that is a relay node
  • a target channel selection module 603, configured to select a target channel according to the relay level
  • a lower-level device connection module 604 configured to start a softAP node of the Wi-Fi module according to the relay level, to connect an application terminal and/or a relay node of a next level on the target channel;
  • the relay communication parameter configuration module 605 is configured to configure a relay communication parameter according to the relay level to support communication between the station node and the softAP node.
  • the target channel selection module 603 includes:
  • An uplink channel setting submodule configured to query a channel where the router or the relay node of the upper level is located, as an uplink channel;
  • a frequency band type determining submodule configured to determine a frequency band type of the uplink channel
  • a first target channel calculation submodule configured to calculate, according to the frequency band type, a target channel that does not interfere with the uplink channel according to the frequency band type when the relay level is the first level;
  • An adjacent channel detecting submodule configured to detect, when the relay level is the second level or the second level, a channel where the adjacent relay node is located, as an adjacent channel;
  • a second adjacent channel calculation submodule configured to calculate, according to the frequency band type, a target channel that does not interfere with the uplink channel and the adjacent channel.
  • the first target channel calculation submodule includes:
  • a first channel offset unit configured to: when the channel type is a 2.4G frequency band, offset the uplink channel by N channels as a target channel, where N is an integer greater than or equal to 5;
  • a second channel offset unit configured to: when the channel type is a 5G frequency band, offset the uplink channel by M channels as a target channel, where M is an integer greater than or equal to 1.
  • the adjacent channel detection submodule includes:
  • a relay node searching unit configured to search for a relay node that is the same as a service set identifier of the mobile terminal
  • a node channel detecting unit is configured to detect a channel where the relay node is located as an adjacent channel.
  • the second adjacent channel calculation submodule includes:
  • a third channel offset unit configured to: when the channel type is a 2.4G frequency band, offset the uplink channel by N channels as a candidate channel, where N is an integer greater than or equal to 5;
  • a fourth channel offset unit configured to: when the channel type is a 5G frequency band, offset the uplink channel by M channels as a candidate channel, where M is an integer greater than or equal to 1;
  • the interference coefficient calculation unit is configured to calculate an interference coefficient by using signal information of the relay node to which the adjacent channel belongs when the candidate channel is the same as the adjacent channel;
  • a target channel selecting unit configured to select a target channel from the candidate channels according to the interference coefficient.
  • the second adjacent channel calculation submodule further includes:
  • the candidate channel supplementing unit is configured to set, as the candidate channel, the channel with the smallest number or the channel with the largest number, which is the farthest from the candidate channel, when the number of the candidate channels is one.
  • the interference coefficient calculation unit includes:
  • a node information detecting subunit configured to detect a quantity and/or a signal strength of a relay node to which the adjacent channel belongs
  • the relay level detection module 602 includes:
  • the default level setting submodule is used to set the relay level as the relay node to the first level
  • a relay configuration information requesting submodule configured to request relay configuration information from a router or a relay node at a higher level
  • the upper level extraction submodule is configured to calculate, according to a relay level of the relay node of the upper level, a relay level that is a relay node, to replace the first level;
  • the current level calculation submodule is configured to determine that the relay level to be the relay node is the first level when the request fails.
  • the subordinate device connection module 604 includes:
  • a login information receiving submodule configured to receive login information input by the user when the relay level is the first level
  • a login information extraction submodule configured to: when the relay level is the second level or the second level, extract login information from the relay configuration information of the relay node of the upper level, where the login information includes Service set identifier and password;
  • a softAP node activation submodule configured to start a softAP node of the Wi-Fi module according to the target channel, the service set identifier, and the password, to broadcast the service set identifier on the target channel.
  • the relay communication parameter configuration module 605 includes:
  • the packet forwarding function enables the sub-module to enable the packet forwarding function.
  • the address conversion function setting submodule is configured to set configuration information of the address translation function NAT when the relay level is the first level;
  • An IP address allocation submodule configured to allocate an IP address from a relay node of a higher level when the relay level is lower than the second level or the second level, and establish a relay route between the relay nodes at each level table.
  • the relay communication parameter configuration module further includes:
  • An IP address query submodule configured to query an IP address of a router or a relay node of a higher level when the relay level is lower than a second level or a second level;
  • the DNS system setting sub-module of the domain name system is used to set the IP address of the router or relay node of the upper level to the gateway address of the DNS of the domain name system.
  • the relay communication parameter configuration module includes:
  • the packet forwarding function enables the sub-module to enable the packet forwarding function.
  • the address conversion function setting submodule is configured to set configuration information of the address translation function NAT when the relay level is the first level;
  • An IP address query submodule configured to query an IP address of a router or a relay node of a higher level when the relay level is lower than a second level or a second level;
  • the DNS system setting sub-module of the domain name system is used to set the IP address of the router or relay node of the upper level to the gateway address of the DNS of the domain name system.
  • FIG. 7 is a structural block diagram of another embodiment of a configuration apparatus for relay communication according to an embodiment of the present invention.
  • the mobile terminal is configured with a Wi-Fi module, and the device is specifically configured.
  • Can include the following modules:
  • the uplink data packet receiving module 701 is configured to receive, by using the softAP node, a data packet sent by an application terminal and/or a relay node of a next level;
  • the uplink relay communication module 702 is configured to forward the data packet from the softAP node to the station node;
  • the uplink data packet sending module 703 is configured to send, by using the station node, the data packet to a router or a relay node of a higher level according to the communication configuration parameter.
  • it also includes:
  • the downlink data packet receiving module 704 is configured to receive, by using the station node, a data packet sent by a router or a relay node of a higher level;
  • a downlink relay communication module 705, configured to forward the data packet from the station node to the softAP node;
  • the downlink data packet sending module 706 is configured to send the data packet to the application terminal or the relay node of the next level by using the softAP node according to the communication configuration parameter.
  • the uplink data packet sending module 703 includes:
  • a gateway address query sub-module configured to query a gateway address of the domain name system DNS when the data packet has a uniform resource locator URL, and a gateway address sending sub-module, configured to use the station node according to the gateway address Sending the data packet to a router or relay node of a higher level;
  • the uplink data packet sending module 703 includes:
  • a first IP address translation submodule configured to convert a source address in the data packet from an IP address of the application terminal to an IP address of the mobile terminal when the relay level is a first level
  • a first packet forwarding submodule configured to send, by the station node, a data packet masquerading from an IP address of the mobile terminal to a router of a higher level
  • the uplink data packet sending module 703 includes:
  • a second data packet forwarding submodule configured to send the data packet to the relay node of the upper level by using the station node when the relay level is lower than the second level or the second level.
  • the downlink data packet sending module 706 includes:
  • a second IP address translation sub-module configured to: when the relay level is the first level, convert the destination address in the data packet from an IP address of the mobile terminal to an IP address of the application terminal;
  • a source address query sub-module configured to query a source address in the data packet to obtain an IP address of the application terminal, when the relay level is lower than a second level or a second level;
  • a target path query sub-module configured to query, by using a relay routing table between the relay nodes of each level, a target path that is routed from the IP address of the mobile terminal to an IP address of the application terminal;
  • a sub-address query sub-module configured to query, in the target path, an IP address of an application terminal or a relay node of a next level
  • a third data packet forwarding submodule configured to send, by the soft AP node, the data to an application terminal or a relay node of a next level according to an IP address of an application terminal or a relay node of a next level.
  • a mobile terminal that can perform the above method is provided, which includes a transceiver 810, a processor 800 connected to the transceiver 810, and a memory 820, where:
  • the processor 800 is configured to read a program in the memory 820 and perform the following process:
  • a relay communication parameter is configured according to the relay level to support communication between the station node and the softAP node.
  • the transceiver 810 is configured to receive and transmit data under the control of the processor 800.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 800 and various circuits of memory represented by memory 820.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • Bus interface 830 provides an interface.
  • Transceiver 810 can be an element or a plurality of elements, such as multiple receivers and transmitters, providing means for communicating with various other devices on a transmission medium.
  • the processor 800 is responsible for managing the bus architecture and general processing, as well as providing various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 820 can store data used by the processor 800 when performing operations.
  • the processor 800 can be a central embedded device (CPU), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a complex programmable logic.
  • CPU central embedded device
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • CPLD complex programmable logic
  • the processor 800 reads the program in the memory 820, and performs the method in the embodiment shown in FIG. 1 or FIG. 5.
  • the processor 800 reads the program in the memory 820, and performs the method in the embodiment shown in FIG. 1 or FIG. 5.
  • the embodiment of the invention further provides a computer readable storage medium, wherein executable program code is stored, the program code is used to implement the method described in the foregoing embodiments.
  • embodiments of the embodiments of the invention may be provided as a method, apparatus, or computer program product.
  • embodiments of the invention may be in the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • embodiments of the 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, etc.) including computer usable program code.
  • Embodiments of the 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 flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
  • Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明实施例提供了一种中继通信的配置方法和装置,应用在移动终端中,所述移动终端配置有Wi-Fi模组,所述方法包括:通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;检测作为中继节点所处的中继级别;根据所述中继级别选择目标信道;根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。本发明实施例形成多级的中继网络,拓宽了网络的结构层级,增加了中继节点的数量,从而提高了连接的数量,并且,信道之间互不干扰。

Description

一种中继通信的配置方法和装置
本申请要求在2017年4月18日提交中国专利局、申请号为201710254564.1、发明名称为“一种中继通信的配置方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信的技术领域,特别是涉及一种中继通信的配置方法和一种中继通信的配置装置。
背景技术
随着生活水平的提高,无线信号,如Wi-Fi(WIreless-Fidelity,无线保真),由于无线的便捷性,已经广泛应用于生活的各个方面。
随着智能家电、手持终端等设备的增多,由于路由器能够连接的设备数量有限,导致新增的设备可能无法连接路由器或中继,无法使用无线信号。
发明内容
本发明实施例提出了一种中继通信的配置方法和相应的一种中继通信的配置装置。
依据第一方面,提供了一种用于移动终端的中继通信的配置方法,其中,所述移动终端配置有Wi-Fi模组,所述方法包括:
通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;
检测作为中继节点所处的中继级别;
根据所述中继级别选择目标信道;
根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;
根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
可选地,所述根据所述中继级别选择目标信道的步骤包括:
查询上一级的路由器或中继节点所处的信道,作为上行信道;
确定所述上行信道的频段类型;
当所述中继级别为第一级时,按照所述频段类型计算与所述上行信道互不干扰的目标信道;
当所述中继级别为第二级或第二级以下时,检测相邻的中继节点所处的信道,作为相邻信道,并按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道。
可选地,所述按照所述频段类型计算与所述上行信道互不干扰的目标信道的步骤包括:
当所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为目标信道,N为大于或等于5的整数;
当所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为目标信道,M为大于或等于1的整数。
可选地,所述检测相邻的中继节点所处的信道,作为相邻信道的步骤包括:
查找与移动终端的服务集标识相同的中继节点;
检测所述中继节点所处的信道,作为相邻信道。
可选地,所述按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道的步骤包括:
当所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为候选信道,N为大于或等于5的整数;
当所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为候选信道,M为大于或等于1的整数;
当所述候选信道与所述相邻信道相同时,采用所述相邻信道所属中继节点的信号信息计算干扰系数,并按照所述干扰系数从所述候选信道中选取目标信道。
可选地,所述按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道的步骤还包括:
当所述候选信道的数量为一个时,将距离所述候选信道最远的、编号最小的信道或编号最大的信道设置为候选信道。
可选地,所述采用所述相邻信道所属中继节点的信号信息计算干扰系数的步骤包括:
检测所述相邻信道所属中继节点的数量和/或信号强度;
采用所述数量和/或所述信号强度计算干扰系数,其中,所述数量和/或所述信号强度与所述干扰系数正相关。
可选地,所述检测作为中继节点所处的中继级别的步骤包括:
将作为中继节点所处的中继级别设置为第一级;
向上一级的路由器或中继节点请求中继配置信息;
当请求成功时,从所述中继配置信息中提取上一级的中继节点的中继级别;
在上一级的中继节点的中继级别的基础上,计算作为中继节点所处的中继级别,以对所述第一级进行替换;
当请求失败时,确定作为中继节点所处的中继级别为第一级。
可选地,所述根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点的步骤包括:
当所述中继级别为第一级时,接收用户输入的登录信息;
当所述中继级别为第二级或第二级以上时,从上一级的中继节点的中继配置信息中提取登录信息,其中,所述登录信息包括服务集标识和密码;
根据所述目标信道、所述服务集标识和所述密码启动所述Wi-Fi模组的softAP节点,以在所述目标信道广播所述服务集标识。
可选地,所述根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信的步骤包括:
开启包转发功能;
当所述中继级别为第一级时,设置地址转换功能NAT的配置信息;
当所述中继级别为第二级或第二级以下时,从上一级的中继节点分配IP地址,并建立各级中继节点之间的中继路由表;和/或,当所述中继级别为第二级或第二级以下时,查询上一级的路由器或中继节点的IP地址,并将上一级的路由器或中继节点的IP地址,设置为域名***DNS的网关地址。
可选地,还包括:
通过所述softAP节点接收下一级的应用终端和/或中继节点发送的数据包;
将所述数据包从softAP节点转发至station节点;
根据所述通信配置参数通过所述station节点将所述数据包发送至上一级的路由器或中继节点。
可选地,所述根据所述通信配置参数通过所述station节点将所述数据包发送至上一级的路由器或中继节点的步骤包括:
当所述数据包中具有统一资源定位符URL时,查询域名***DNS的网关地址,并通过所述station节点按照所述网关地址,将所述数据包发送至上一级的路由器或中继节点;或者,
当所述中继级别为第一级时,将所述数据包中的源地址,从所述应用终端的IP地址转 换为所述移动终端的IP地址,并通过所述station节点将伪装来自所述移动终端的IP地址的数据包发送至上一级的路由器;或者,
当所述中继级别为第二级或第二级以下时,通过所述station节点将所述数据包发送至上一级的中继节点。
可选地,还包括:
通过所述station节点接收上一级的路由器或中继节点发送的数据包;
将所述数据包从所述station节点转发至所述softAP节点;
根据所述通信配置参数通过所述softAP节点将所述数据包发送至下一级的应用终端或中继节点。
可选地,所述通过所述softAP节点将所述数据包发送至下一级的中继节点的步骤包括:
当所述中继级别为第一级时,将所述数据包中的目的地址从所述移动终端的IP地址转换为所述应用终端的IP地址;
当所述中继级别为第二级或第二级以下时,在所述数据包中查询源地址,获知所述应用终端的IP地址;
通过各级中继节点之间的中继路由表查询从所述移动终端的IP地址路由至所述应用终端的IP地址的目标路径;在所述目标路径中查询下一级的应用终端或中继节点的IP地址;
通过所述softAP节点按照下一级的应用终端或中继节点的IP地址将所述数据发送至下一级的应用终端或中继节点。
依据第二方面,提供了一种用于移动终端的中继通信的配置装置,所述移动终端配置有Wi-Fi模组,所述装置包括:
上级设备连接模块,用于通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;
中继级别检测模块,用于检测作为中继节点所处的中继级别;
目标信道选择模块,用于根据所述中继级别选择目标信道;
下级设备连接模块,用于根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;
中继通信参数配置模块,用于根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
可选地,所述目标信道选择模块包括:
上行信道设置子模块,用于查询上一级的路由器或中继节点所处的信道,作为上行信道;
频段类型确定子模块,用于确定所述上行信道的频段类型;
第一目标信道计算子模块,用于在所述中继级别为第一级时,按照所述频段类型计算与所述上行信道互不干扰的目标信道;
相邻信道检测子模块,用于在所述中继级别为第二级或第二级以下时,检测相邻的中继节点所处的信道,作为相邻信道;
第二相邻信道计算子模块,用于按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道。
可选地,所述第一目标信道计算子模块包括:
第一信道偏移单元,用于在所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为目标信道,N为大于或等于5的整数;
第二信道偏移单元,用于在所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为目标信道,M为大于或等于1的整数。
可选地,所述相邻信道检测子模块包括:
中继节点查找单元,用于查找与移动终端的服务集标识相同的中继节点;
节点信道检测单元,用于检测所述中继节点所处的信道,作为相邻信道。
可选地,所述第二相邻信道计算子模块包括:
第三信道偏移单元,用于在所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为候选信道,N为大于或等于5的整数;
第四信道偏移单元,用于在所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为候选信道,M为大于或等于1的整数;
干扰系数计算单元,用于在所述候选信道与所述相邻信道相同时,采用所述相邻信道所属中继节点的信号信息计算干扰系数;
目标信道选取单元,用于按照所述干扰系数从所述候选信道中选取目标信道。
可选地,所述第二相邻信道计算子模块还包括:
候选信道增补单元,用于在所述候选信道的数量为一个时,将距离所述候选信道最远的、编号最小的信道或编号最大的信道设置为候选信道。
可选地,所述干扰系数计算单元包括:
节点信息检测子单元,用于检测所述相邻信道所属中继节点的数量和/或信号强度;
节点信息计算子单元,用于采用所述数量和/或所述信号强度计算干扰系数,其中,所 述数量和/或所述信号强度与所述干扰系数正相关。
可选地,所述中继级别检测模块包括:
默认级别设置子模块,用于将作为中继节点所处的中继级别设置为第一级;
中继配置信息请求子模块,用于向上一级的路由器或中继节点请求中继配置信息;
当请求成功时,从所述中继配置信息中提取上一级的中继节点的中继级别;
上级级别提取子模块,用于在上一级的中继节点的中继级别的基础上,计算作为中继节点所处的中继级别,以对所述第一级进行替换;
当前级别计算子模块,用于在请求失败时,确定作为中继节点所处的中继级别为第一级。
可选地,所述下级设备连接模块包括:
登录信息接收子模块,用于在所述中继级别为第一级时,接收用户输入的登录信息;
登录信息提取子模块,用于在所述中继级别为第二级或第二级以上时,从上一级的中继节点的中继配置信息中提取登录信息,其中,所述登录信息包括服务集标识和密码;
softAP节点启动子模块,用于根据所述目标信道、所述服务集标识和所述密码启动所述Wi-Fi模组的softAP节点,以在所述目标信道广播所述服务集标识。
可选地,所述中继通信参数配置模块包括:
包转发功能开启子模块,用于开启包转发功能;
地址转换功能设置子模块,用于在所述中继级别为第一级时,设置地址转换功能NAT的配置信息;
IP地址分配子模块,用于在所述中继级别为第二级或第二级以下时,从上一级的中继节点分配IP地址,并建立各级中继节点之间的中继路由表。
可选地,所述中继通信参数配置模块还包括:
IP地址查询子模块,用于在所述中继级别为第二级或第二级以下时,查询上一级的路由器或中继节点的IP地址;
域名***DNS设置子模块,用于将上一级的路由器或中继节点的IP地址,设置为域名***DNS的网关地址。
可选地,所述中继通信参数配置模块包括:
包转发功能开启子模块,用于开启包转发功能;
地址转换功能设置子模块,用于在所述中继级别为第一级时,设置地址转换功能NAT的配置信息;
IP地址查询子模块,用于在所述中继级别为第二级或第二级以下时,查询上一级的路 由器或中继节点的IP地址;
域名***DNS设置子模块,用于将上一级的路由器或中继节点的IP地址,设置为域名***DNS的网关地址。
可选地,还包括:
上行数据包接收模块,用于通过所述softAP节点接收下一级的应用终端和/或中继节点发送的数据包;
上行中继通信模块,用于将所述数据包从softAP节点转发至station节点;
上行数据包发送模块,用于根据所述通信配置参数通过所述station节点将所述数据包发送至上一级的路由器或中继节点。
可选地,所述上行数据包发送模块包括:
网关地址查询子模块,用于在所述数据包中具有统一资源定位符URL时,查询域名***DNS的网关地址;网关地址发送子模块,用于通过所述station节点按照所述网关地址,将所述数据包发送至上一级的路由器或中继节点;
或者,所述上行数据包发送模块包括:
第一IP地址转换子模块,用于在所述中继级别为第一级时,将所述数据包中的源地址,从所述应用终端的IP地址转换为所述移动终端的IP地址;第一数据包转发子模块,用于通过所述station节点将伪装来自所述移动终端的IP地址的数据包发送至上一级的路由器;
或者,所述上行数据包发送模块包括:
第二数据包转发子模块,用于在所述中继级别为第二级或第二级以下时,通过所述station节点将所述数据包发送至上一级的中继节点。
可选地,还包括:
下行数据包接收模块,用于通过所述station节点接收上一级的路由器或中继节点发送的数据包;
下行中继通信模块,用于将所述数据包从所述station节点转发至所述softAP节点;
下行数据包发送模块,用于根据所述通信配置参数通过所述softAP节点将所述数据包发送至下一级的应用终端或中继节点。
可选地,所述下行数据包发送模块包括:
第二IP地址转换子模块,用于在所述中继级别为第一级时,将所述数据包中的目的地址从所述移动终端的IP地址转换为所述应用终端的IP地址;
源地址查询子模块,用于当所述中继级别为第二级或第二级以下时,在所述数据包中查询源地址,获知所述应用终端的IP地址;
目标路径查询子模块,用于通过各级中继节点之间的中继路由表查询从所述移动终端的IP地址路由至所述应用终端的IP地址的目标路径;
下级地址查询子模块,用于在所述目标路径中查询下一级的应用终端或中继节点的IP地址;
第三数据包转发子模块,用于通过所述softAP节点按照下一级的应用终端或中继节点的IP地址将所述数据发送至下一级的应用终端或中继节点。
依据第三方面,提供了一种计算机可读存储介质,其中存储有可执行的程序代码,该程序代码用以实现第一方面中任一项所述的方法。
依据第四方面,提供了一种移动终端,所述移动终端包括收发机、与该收发机连接的处理器以及存储器,其中:所述处理器,用于读取存储器中的程序,执行如上述第一方面中任一项所述的方法;所述收发机,用于在所述处理器的控制下接收和发送数据。
附图说明
图1是本发明一个实施例的一种中继通信的配置方法的步骤流程图;
图2是一种2.4G频道的信道分布图;
图3是一种5G频道的信道分布图;
图4是本发明一个实施例的一种中继网络的拓扑图;
图5是本发明一个实施例的另一种中继通信的配置方法的步骤流程图;
图6是本发明一个实施例的一种中继通信的配置装置实施例的结构框图;
图7是本发明一个实施例的另一种中继通信的配置装置实施例的结构框图;
图8为本发明一个实施例的一种移动终端的结构框图。
具体实施方式
为了增强无线信号的强度和增大无线信号的覆盖范围,保证无线信号的正常使用,目前,处于节省成本的考虑,使用废弃的移动终端挂接在路由器下作为中继器,将接收到的无线信号发射出去,增大无线信号的覆盖范围,以扩大通信距离和无线信号覆盖范围,无线衰弱的信号得到增强。但是,路由器能够连接的设备数量有限,可以使用中继的设备的数量有限。
为解决上述问题,本发明实施例提供了一种用于移动终端的中继通信配置方法和装置。
为使上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发 明作进一步详细的说明。
参照图1,示出了本发明一个实施例的一种中继通信的配置方法实施例的步骤流程图,具体可以包括如下步骤:
步骤101,通过Wi-Fi模组的station节点连接上一级的路由器或中继节点。
在具体实现中,本发明实施例可以应用于移动终端,例如,手机、平板电脑、智能可穿戴设备(如智能手表),等等。
这些移动终端可以安装WindowsPhone、Android(安卓)、IOS或Windows等操作***,配置有Wi-Fi(WIreless-Fidelity,无线保真)模组,可以连接无线节点,作为中继节点,转发无线信号。
Wi-Fi模组又名串口Wi-Fi模块,属于物联网传输层,可以将串口或TTL(transistor transistor logic,晶体管-晶体管逻辑电平)信号转为符合Wi-Fi无线网络通信标准的嵌入式模块,内置无线网络协议IEEE802.11b.g.n协议栈以及TCP/IP(Transmission Control Protocol/Internet Protocol,传输控制协议/互联网络协议)协议栈。
在具体实现中,Wi-Fi模组通常有三种功能:station、softAP、P2P。
其中,station(工作站):表示连接到无线网络中的设备,这些设备通过无线AP(WirelessAccessPoint,无线访问节点),可以和内部其它设备或者无线网络外部通信。
softAP:表示使用应用实现AP的功能,让移动终端可以作为一个路由,让别的站点链接。
P2P(Peer-to-Peer):又称Wi-Fi Direct,可以支持在没有AP的情况下,两个Wi-Fi设备直连并通信。
在本发明实施例中,移动终端可以作为中继节点连接上一级的设备,该设备可以为路由器,也可以为中继节点,即可以在中继节点后,挂接中继节点,形成树状的中继网络。
若移动终端为第一级的中继节点,则可以通过Wi-Fi模组的station节点连接上一级的路由器。
若移动终端为第二级或第二级以下的中继节点,则可以通过Wi-Fi模组的station节点连接上一级的中继节点。
在一种实施方式中,可以调用WifiManager中的getWifiState()方法,检测移动终端是否开启过Wi-Fi的station节点。
当检测到station节点已开启时,则可以通过调用ConnectivityManager提供的API(Application Programming Interface,应用程序编程接口)getNetworkInfo(),将ConnectivityManager.TYPE_WIFI作为参数传入,检测station节点是否连接无线节点。
如果返回的NetworkInfo对象不为null,并且isConnected()为true,确认已连接无线节点。
当检测到station节点未开启或未连接无线节点时,生成连接无线节点的提示信息,如“请打开Wi-Fi并连接路由器或中继”。
步骤102,检测作为中继节点所处的中继级别。
在具体实现中,移动终端作为中继节点接入网络之后,可以识别当前所处的中继级别。
第一级的中继节点可以称为根节点,相互连接的两级中继节点,上一级的中继节点为下一级的中继节点的父节点,相对而言,下一级的中继节点为上一级的中继节点的子节点。
在一种实施方式中,每级中继节点可以维护一个中继配置信息,在该中继配置信息中,可以记录路由路径、中继级别、登录信息(如SSID(Service Set Identifier,服务集标识)和密码)等信息。
在此实施方式中,可以将作为中继节点所处的中继级别设置为第一级。
按照预设的规范,向上一级的路由器或中继节点请求中继配置信息。
如果上一级的设备为路由器,该路由器并未设定该规范,则忽略移动终端的请求。
如果上一级的设备为中继节点,该中继节点已设定该规范,则对移动终端的请求进行响应,返回中继配置信息。
当请求成功时,从中继配置信息中提取上一级的中继节点的中继级别。
在上一级的中继节点的中继级别的基础上,计算作为中继节点所处的中继级别,以对第一级进行替换。
进一步而言,移动终端可以在上一级的中继节点的中继级别的基础上加一,则可以得到移动终端当前作为中继节点所处的中继级别。
例如,如果上一级的中继节点的中继级别为第二级,则移动终端作为中继节点的中继级别为第三级,进而将默认的第一级修改为第三级。
当请求失败时,确定作为中继节点所处的中继级别为第一级。当然,上述中继级别的检测方法只是作为示例,在实施本发明实施例时,可以根据实际情况设置其他中继级别的检测方法,例如,向上一级的路由器或中继节点请求中继等级,如果请求失败,则设置为第一级,如果请求成功,则在上一级的中继节点的中继级别的基础上,计算当前的中继级别,等等,本发明实施例对此不加以限制。另外,除了上述中继级别的检测方法外,本领域技术人员还可以根据实际需要采用其它中继级别的检测方法,本发明实施例对此也不加以限制。
步骤103,根据所述中继级别选择目标信道。
根据电磁干扰理论,非自身设备的电磁波,均为干扰源,干扰源发出电磁能,电磁能经某传播途径传输到敏感设备,敏感设备又对干扰产生某种形式的响应,并产生干扰的效果。
在本发明实施例中,移动终端中的Wi-Fi天线相隔很近、移动终端与移动中之间相距也很近,最大的干扰是来自于自身的天线或周围的天线的辐射电磁耦合,可能会导致转发数据能力较低、中继性能较差的问题。
当信号源与干扰频率相隔越近,耦合值越大,干扰则越大,因此,为降低电磁干扰,可以根据中继级别选择目标信道,以选择互不干扰的频率范围,解决了中继功能因信道设置引起的信道干扰而导致的转发数据能力较低、中继性能较差的问题。
在本发明的一个实施例中,步骤103可以包括如下子步骤:
子步骤S11,查询上一级的路由器或中继节点所处的信道,作为上行信道。
在Android***中,WifiService是负责WiFi功能的核心服务,而其中的WifiStateMachine子***则负责维护WiFi的各类状态信息。
该状态信息包括上一级的路由器或中继节点信道信息,因此,可以通过调用***的mWifiStateMachine.fetchFrequencyNative()函数来获取上一级的路由器或中继节点的第一信道。
子步骤S12,确定所述上行信道的频段类型。
在实际应用中,路由器或中继节点的第一信道的工作频段有所不同,主要包括2.4G频段(2.412GHz-2.484GHz)和5G频段(5.735GHz-5.835GHz),其中,大多数路由器或中继节点普遍使用的是运行在2.4Ghz上的无线技术,采用(***)802.11n标准,而运行在5Ghz高频段上的第五代Wi-Fi技术,采用802.11ac协议标准。
子步骤S13,当所述中继级别为第一级时,按照所述频段类型计算与所述上行信道互不干扰的目标信道。
若移动终端作为中继节点所处的中继级别为第一级,则移动终端连接路由器,可以直接依据路由器的上行信道的频段类型设置目标信道。
当频道类型为2.4G频段时,将上行信道偏移N个信道,作为目标信道,其中,N为正整数,且N≥5。
如图2所示,2.4G频段中的1-14信道的图谱为梯度矩阵,从频段角度,共分3个独立频段,每个独立频段的范围大致为22MHz,因为相邻的频段有交叉相等的频率值,每个独立频段内的信道均存在干扰,具体频段如下:
一区:1-5信道
二区:6-10信道
三区:11-14信道
例如,信道1和信道2共有的频率为2406-2423,此时,如果上一级的路由器或中继节点的上行信道的信道设置为1,中继节点的目标信道设置为2时,则存在频率相同区间,存在干扰。
从频段隔离的角度,共分5个隔离区间,隔离区间内的信道不存在干扰,具体区间如下:
一类:1、6、11
二类:2、7、12
三类:3、8、13
四类:4、9
五类:5、10
因此,当频道类型为2.4G频段时,可以将上行信道偏移至少5个信道,作为目标信道。
假设X为上一级的路由器或中继节点的上行信道,Y为中继节点(即移动终端)的目标信道,两者满足以下关系式:
Y≥X+5,或,Y≤X-5
其中,X、Y为正整数,当Y<1或Y>13时,Y无效,需要丢弃。
当频道类型为5G频段时,将上行信道偏移M个信道,作为目标信道,其中,M为正整数,如1、2。
如图3所示,因为5G频段不存在交叉,因此,上一级的路由器或中继节点的上行信道与当前中继节点的目标信道不为同一信道,即可以基本避免干扰。
子步骤S14,当所述中继级别为第二级或第二级以下时,检测相邻的中继节点所处的信道,作为相邻信道。
在本发明的一个实施例中,如果中继节点设置相同的服务集标识和密码,以便于进行漫游,则可以查找与移动终端的服务集标识相同的中继节点,检测所述中继节点所处的信道,作为相邻信道。
子步骤S15,按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道。
若移动终端作为中继节点所处的中继级别为第二级或第二级以下,则移动终端连接中继节点,可以依据附近中继节点的上行信道的频段类型设置目标信道。
当频道类型为2.4G频段时,将上行信道偏移N个信道,作为候选信道,其中,N为 正整数,且N≥5。
当频道类型为5G频段时,将上行信道偏移M个信道,作为候选信道,其中,M为正整数,如1、2。
当候选信道与相邻信道相同时,则可以表示当前相邻信道所属的中继节点与当前的中继节点属于同一个中继网络,可能存在干扰,因此,可以采用相邻信道所属中继节点的信号信息计算干扰系数。
对于候选信道与相邻信道不同的情况,则可以忽略该相邻信道。
在一个示例中,可以检测相邻信道所属中继节点的数量和/或信号强度,通过配置权重求和等方式,采用数量和/或所述信号强度计算干扰系数。
其中,数量和/或信号强度与干扰系数正相关,即数量越多、信号强度越强,干扰系数越大,反之,数量越少、信号强度越低,干扰系数越小。
此后,按照干扰系数从候选信道中选取目标信道,一般情况下,选择干扰系数最小的候选信道中选取目标信道。
需要说明的是,当候选信道的数量为一个时,将距离候选信道最远的、编号最小的信道或编号最大的信道设置为候选信道。
因此,从频段隔离的角度,共分5个隔离区间,隔离区间内的信道不存在干扰,具体区间如下:
一类:1、6、11
二类:2、7、12
三类:3、8、13
四类:4、9、13
五类:1、5、10
对于第四类和第五类,假设上行信道为9,5,上行信道偏移5个信道,分别得到4、14(丢弃),0(丢弃)、10信道,则可以添加13,1信道作为候选信道。
假设Y为上一级的路由器或中继节点的上行信道,Z为中继节点(即移动终端)的目标信道,两者满足以下关系式:
Z≥Y+5,或,Z≤Y-5
其中,Y、Z为正整数,当Z<1或Z>13时,Z无效,需要丢弃。
步骤104,根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点。
如果移动终端的Wi-Fi模组的station节点已连接到上一级的路由器或中继节点,则可 以按照中继级别向Wi-Fi模块发送中继指令,启动softAP节点,通过softAP节点连接下一级的应用终端和/或中继节点。
其中,应用终端可以指实现自身功能的终端,例如,智能电饭煲、智能空调、智能热水器,等等。
需要说明的是,移动终端除了可以作为中继节点之外,也可以作为应用终端,实现浏览网页、游戏、播放网络视频等功能。
在本发明的一个实施例中,可以确定softAP节点的信道,该信道一般与路由器、其他中继节点不存在干扰,因此,可以在该信道上下发中继指令。
在具体实现中,不同信道对应的频率为:
Freq=2412(信道1)  Freq=2417(信道2)  Freq=2422(信道3)
Freq=2427(信道4)  Freq=2432(信道5)  Freq=2437(信道6)
Freq=2442(信道7)  Freq=2447(信道8)  Freq=2452(信道9)
Freq=2457(信道10) Freq=2462(信道11) Freq=2467(信道12)
Freq=2472(信道13)
当中继级别为第一级时,接收用户输入的登录信息,该登录信息包括服务集标识和密码。
在此情况下,可以在UI(User Interface,用户界面)提示用户输入中继(即移动终端)的SSID和密码。
若用户在UI输入了SSID和密码,则使用该SSID和密码,否则,使用默认的SSID和密码。
当中继级别为第二级或第二级以上时,从上一级的中继节点的中继配置信息中提取登录信息,保持父节点与子节点之间登录信息的相同,在无效网络信号较差(如小于-90DB)的情况下,可以启动漫游,采用相同的登录信息自动连接相邻的其他中继节点。
若获取了登录信息,则可以根据目标信道、服务集标识和密码启动Wi-Fi模组的softAP节点,以在目标信道广播服务集标识。
在具体实现中,将freq(信道)、SSID和密码写入到hostapd.conf配置文件中,启用softAP节点服务的中继指令为:
hostapd-d hostapd.conf
即可将freq、SSID和密码生效。
中继指令发送后,中继节点(即移动终端)发出的广播帧就会携带SSID,其它终端扫描到以后就可以用SSID和密码进行连接了。
在具体实现中,中继节点(即移动终端)可以视为一个AP,它周期性地广播Beacon帧,其他station设备扫描到该Beacon帧就可以得到中继节点(即移动终端)的SSID。
当接收到一个或多个电子设备(下一级的应用终端和/或中继节点)针对SSID发送的申请请求时,向一个或多个电子设备返回应答消息challenge text。
当接收到一个或多个电子设备发送的连接请求时,验证连接请求中密码与预设的密码是否相同,若是,则接入一个或多个电子设备。
步骤105,根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
在本发明实施例中,不同中继级别的中继节点,具有不同的中继通信参数,使得station节点与softAP节点之间可以进行通信,由于station节点连接上一级的无线节点,softAP节点连接下一级的应用终端和/或中继节点,使得上一级的路由器或中继节点与下一级的应用终端和/或中继节点可以进行通信,实现中继功能。
在本发明的一个实施例中,步骤105可以包括如下子步骤:
子步骤S21,开启包转发功能。
在具体实现中,可以通过echo属性值开启包转发功能,以支持在station节点与softAP节点之间转发数据包:
echo 1>/proc/sys/net/ipv4/ip_forward
包转发,是允许数据包从一个终端转发到另一个终端。
在本发明实施例中,打开包转发功能,支持数据包在station节点与softAP节点之间相互转发数据包。
子步骤S22,当所述中继级别为第一级时,设置网络地址转换功能的配置信息。
在实际应用中,可以调用通过***地址表服务iptables发送NAT(Network Address Translation,网络地址转换功能)的配置信息至Wi-Fi模组,NAT将自动修改IP报文的源IP地址和目的IP地址,以对应用终端的IP地址进行伪装。
当然,在发送路由表和NAT之前,还可以清除在先的路由表。
Iptables、NAT配置的配置信息如下:
#remove old rules(清理在先的路由表)
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-j MASQUERADE
其中,假设中继(即移动终端)的IP段是192.168.49.0,发送Bring up NAT rules可以将192.168.49.0/24网段为源地址的数据包进行重新封包、解包处理,伪装为0.0.0.0/0的源地址。
子步骤S23,当所述中继级别为第二级或第二级以下时,从上一级的中继节点分配IP地址,并建立各级中继节点之间的路由路径。
在具体实现中,对于第二级或第二级以下的中继节点,可以动态对其分配IP地址。
在一种实施方式中,可以将总共的地址空间分割成多段或者多个子域,每个中继节点又可以将分配给自己的地址继续从中分配给子节点,而应用终端没有子节点,所以不需要分配地址。
作为中继节点的移动终端具有地址池,即地址的集合,第二级或第二级以下的中继节点的地址池容量由从其父节点决定,父节点通过如下公式计算出地址池容量:
C skip(d)=1+C m×(L m-d-1)  R m=1
C skip(d)=(1+C m-R m-C m×R m Lm-d-1)/(1-R m)  R m≠1
其中,C skip(d)表示中继级别为d的父节点在分配地址时确定的偏移量,对应子节点的地址池容量,C m表示中继节点所能接收的最大子结点数,L m表示网络的最大深度(中继级别),R m表示中继节点所能接收的最大子节点数,d表示节点深度(中继级别)。
深度d在入网时父节点深度增加1,协调器的深度规定为0,C m、L m、R m这三个参数可以有用户提供,描述网络的规模和大致形态。
计算出偏移量C skip(d)后,父节点根据入网子节点的类型确定其网络地址。
若子节点为中继节点,可以采用如下公式计算地址:
A n=A p+C skip(d)×(n-1)+1  1≤n≤R m
其中,A p为父节点的网络地址,n为申请入网的节点是第几个子中继节点,A n为第n个入网子中继节点获得的网络地址。
在本发明实施例中,可以在各个中继节点中维护一个中继路由表,在该中继路由表中,可以在每个中继节点在入网时记录其所分配的地址,以及,该中继节点与其他中继节点之间的父子节点关系,每个中继节点在退网时删除其所分配的地址,这样,各级别的中继之间的父子节点关系、地址可以组成各级中继的路由路径。
子步骤S24,查询上一级的路由器或中继节点的IP地址。
子步骤S25,将上一级的路由器或中继节点的IP地址,设置为域名***的网关地址。
上述子步骤S24~S25是可选步骤。在另外的例子中,上述子步骤S23为可选步骤,即,当所述中继级别为第二级或第二级以下时,执行子步骤S24~S25。
在本发明实施例中,一方面,可以调用***中的地址表服务iptable发送基于TCP(Transmission Control Protocol,传输控制协议)的DNS(Domain Name System,域名***)的网关地址至Wi-Fi模组;
命令格式为:
iptables-t nat-I PREROUTING-i(中继设备名)-p tcp--dport 53-j DNAT--to-destination(网关)
另一方面可以调用***中的地址表服务iptable,发送基于UDP(Open System Interconnection,开放式***互联)的DNS的网关地址至Wi-Fi模组。
命令格式为:
iptables-t nat-I PREROUTING-i(中继设备名)-p udp--dport 53-j DNAT--to-destination(网关)
当中继级别为第一级的中继节点时,将DNS的网关地址设置为路由器的网关地址。
当中继级别为第二级或第二级以下的中继节点时,将DNS的网关地址为设置为上一级的中继节点的IP地址。
如上,给中继设备(即移动终端)添加TCP和UDP的DNS网关地址,在配置DNS后,输入的URL(Uniform Resource Locator,统一资源定位符)会被逐级传递,最终被DNS服务器解析,实现网络通信。
本发明实施例在移动终端配置有Wi-Fi模组,通过Wi-Fi模组的station节点上一级的路由器或中继节点,启动Wi-Fi模组的softAP节点,以连接下一级的应用终端和/或中继节点,根据当前所处的中继级别配置中继通信参数,以支持在station节点与softAP节点之间进行通信,将移动终端实现为中继节点,在中继节点中后挂中继节点,形成多级的中继网络,拓宽了网络的结构层级,增加了中继节点的数量,从而提高了连接的数量,在智能家电、手持终端等设备增多的情况,保证新增的设备可以连接中继,正常使用无线信号。
并且,目标信道自适应中继级别进行调整,信道之间互不干扰,提高了中继功能的转发数据能力、提升了中继性能。
为使本领域技术人员更好地理解本发明实施例,以下通过具体的示例来说明本发明实施例中的中继网络。
如图4所示,假设在一间房子中,具有一间客厅、一间厨房、两间卧室(包括主卧、次卧)和一个书房,其中,主卧和书房相近,次卧与厨房相近。
在本示例中,将路由器42摆放在客厅中,路由器42接入基站41,并作为无线节点,广播Wi-Fi信号。
由于客厅面积较大、墙壁阻挡,主卧、次卧、书房和厨房中Wi-Fi信号较弱,因此,可以在客厅中放置移动终端432,在主卧附近放置移动终端431,在书房附近放置移动终端4313,在次卧和厨房附近放置移动终端4321,在厨房附近放置移动终端43213,在次卧附近放置移动终端43211。
在客厅中:
移动终端431通过station节点接入路由42,并启动softAP节点,作为第一级的中继节点,以向主卧中继Wi-Fi信号。
移动终端432分别通过station节点接入路由42,并启动softAP节点,作为第一级的中继节点,以向客厅的其他部分(如阳台)中继Wi-Fi信号。
便携电脑433作为应用终端接入路由42,以供用户在客厅进行工作、娱乐等处理。
移动终端4321通过station节点接入移动终端432,并启动softAP节点,作为第二级的中继节点,以向次卧、厨房中继Wi-Fi信号。
智能咖啡机4322、智能饮水机4323作为应用终端接入移动终端432。
在主卧中:
平板电脑4311、PDA 4312、移动终端4314作为应用终端接入移动终端431,以供用户在主卧进行工作、娱乐等处理。
移动终端4313通过station节点接入移动终端431,并启动softAP节点,作为第二级的中继节点,以向书房中继Wi-Fi信号。
在书房中:
PC 43131、移动终端43132作为应用终端接入移动终端4313,以供用户在书房进行工作、娱乐等处理。
在次卧中:
移动终端43211通过station节点接入移动终端4321,并启动softAP节点,作为第三级的中继节点,以向次卧中继Wi-Fi信号。
电子游戏机432111、电视机432112、移动终端432113作为应用终端接入移动终端43111,以供用户在书房进行工作、娱乐等处理。
在厨房中:
移动终端4322通过station节点接入移动终端4321,并启动softAP节点,作为第三级的中继节点,以向厨房中继Wi-Fi信号。
智能冰箱432121、智能微波炉432122、智能厨炉432123作为应用终端接入移动终端43112。
参照图5,示出了本发明一个实施例的另一种中继通信的配置方法实施例的步骤流程图,应用在移动终端中,该移动终端配置有Wi-Fi模组,该方法具体可以包括如下步骤:
步骤501,通过所述softAP节点接收下一级的应用终端和/或中继节点发送的数据包。
当应用终端与外部网路的目标设备(如网页服务器)进行通信时,应用终端所生成的数据包,通过中继节点逐级传输,直至发送至目标设备。
步骤502,将所述数据包从softAP节点转发至station节点。
在具体实现中,由于开启了包转发功能,因此,可以将数据包从softAP节点转发至station节点,实现中继节点内部数据包的转发。
步骤503,根据所述通信配置参数通过所述station节点将所述数据包发送至上一级的路由器或中继节点。
在实际应用中,可以按照不同中继级别的通信配置参数,对数据包进行处理,以实现中继通信。
在本发明的一个实施例中,步骤503可以包括如下子步骤:
子步骤S31,当所述数据包中具有统一资源定位符URL时,查询域名***DNS的网关地址。
子步骤S32,通过所述station节点按照所述网关地址,将所述数据包发送至上一级的路由器或中继节点。
在本发明实施例中,在应用终端访问网页等情况下,进行URL的解析。
移动终端的DNS的网关地址为上一级的中继节点的IP地址,则可以将解析URL的数据包转发至上一级的中继节点。
而当前级别的中继节点的DNS的网关地址为上一级的中继节点的IP地址,则可以将解析URL的数据包转发至上一级的中继节点。
直至到达第一级的中继节点,其D NS的网关地址为路由器的IP地址,则可以将解析URL的数据包转发至路由器,路由器发送至外网提供域名解析的服务器,将URL映射为IP地址。
在本发明的另一个实施例中,步骤503可以包括如下子步骤:
子步骤S33,当所述中继级别为第一级时,将所述数据包中的源地址,从所述应用终端的IP地址转换为所述移动终端的IP地址。
子步骤S34,通过所述station节点将伪装来自所述移动终端的IP地址的数据包发送至上一级的路由器。
对于第一级的中继节点,可以将数据包中的源地址(即移动终端的IP地址),如 192.168.49.0,则基于NAT的配置信息,伪装成移动终端本身的IP地址,如0.0.0.0,再转发至路由器。
在本发明的另一个实施例中,步骤503可以包括如下子步骤:
子步骤S35,当所述中继级别为第二级或第二级以下时,通过所述station节点将所述数据包发送至上一级的中继节点。
在本发明实施例中,对于第二级或第二级以下的中继节点,则可以直接将数据包转发至上一级的中继节点。
步骤504,通过所述station节点接收上一级的路由器或中继节点发送的数据包。
当外部网络的目标设备与应用终端进行通信时,目标设备生成的数据包,逐跳向中继节点(即移动终端)传输,直至发送至应用终端。
步骤505,将所述数据包从所述station节点转发至所述softAP节点。
在具体实现中,由于开启了包转发功能,因此,可以将数据包从节station点转发至softAP节点,实现中继节点内部数据包的转发。
步骤506,根据所述通信配置参数通过所述softAP节点将所述数据包发送至下一级的应用终端或中继节点。
上述图5所示的流程中,步骤501~503为数据上行传输过程,步骤504~506为数据下行传输过程。在实际应用中,可能仅进行数据上行传输,也可能仅进行数据下行传输,还可能既进行数据上行传输也进行数据下行传输。
在实际应用中,可以按照不同中继级别的通信配置参数,对数据包进行处理,以实现中继通信。
在本发明的一个实施例中,步骤506可以包括如下子步骤:
子步骤S41,当所述中继级别为第一级时,将所述数据包中的目的地址从所述移动终端的IP地址转换为所述应用终端的IP地址。
子步骤S42,当所述中继级别为第二级或第二级以下时,在所述数据包中查询源地址,获知所述应用终端的IP地址。
子步骤S43,通过各级中继节点之间的中继路由表查询从所述移动终端的IP地址路由至所述应用终端的IP地址的目标路径。
子步骤S44,在所述目标路径中查询下一级的应用终端或中继节点的IP地址。
子步骤S45,通过所述softAP节点按照下一级的应用终端或中继节点的IP地址将所述数据发送至下一级的应用终端或中继节点。
对于第一级的中继节点,可以确认数据包来源的station节点的第二IP地址,在路由 表中查找第二IP地址对应的第一IP地址,则可以将数据包转发至第一IP地址所属的softAP节点。
对于第一级的中继节点,可以将数据包中的目标地址(即移动终端本身的IP地址),如0.0.0.0,则基于NAT的配置信息,转换为应用终端的IP地址,如192.168.49.0。对于每一级的中继节点,由于可以连接多个中继节点,即具有多条路由至应用终端的路径,因此,在下发数据包时,可以查询数据包中的目标地址,确定数据包发送的应用终端。
查询中继路由表,获知可路由至该应用终端的目标路径,从该路径中查询下一级的移动终端或中继节点的IP地址,将数据包转发至该IP地址。
如果下一级为应用终端,则通过softAP节点将数据包发送至该应用终端,应用终端进行相应的处理,例如,加载网页、播放视频等。
如果下一级为中继节点,则通过softAP节点将数据包发送至该中继节点,该中继节点可以继续进行向下进行中继通信。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。
参照图6,示出了根据本发明一个实施例的中继通信的配置装置实施例的结构框图,应用在移动终端中,所述移动终端配置有Wi-Fi模组,所述装置具体可以包括如下模块:
上级设备连接模块601,用于通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;
中继级别检测模块602,用于检测作为中继节点所处的中继级别;
目标信道选择模块603,用于根据所述中继级别选择目标信道;
下级设备连接模块604,用于根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;
中继通信参数配置模块605,用于根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
在本发明的一个实施例中,所述目标信道选择模块603包括:
上行信道设置子模块,用于查询上一级的路由器或中继节点所处的信道,作为上行信道;
频段类型确定子模块,用于确定所述上行信道的频段类型;
第一目标信道计算子模块,用于在所述中继级别为第一级时,按照所述频段类型计算与所述上行信道互不干扰的目标信道;
相邻信道检测子模块,用于在所述中继级别为第二级或第二级以下时,检测相邻的中继节点所处的信道,作为相邻信道;
第二相邻信道计算子模块,用于按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道。
在本发明的一个实施例中,所述第一目标信道计算子模块包括:
第一信道偏移单元,用于在所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为目标信道,N为大于或等于5的整数;
第二信道偏移单元,用于在所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为目标信道,M为大于或等于1的整数。
在本发明的一个实施例中,所述相邻信道检测子模块包括:
中继节点查找单元,用于查找与移动终端的服务集标识相同的中继节点;
节点信道检测单元,用于检测所述中继节点所处的信道,作为相邻信道。
在本发明的一个实施例中,所述第二相邻信道计算子模块包括:
第三信道偏移单元,用于在所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为候选信道,N为大于或等于5的整数;
第四信道偏移单元,用于在所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为候选信道,M为大于或等于1的整数;
干扰系数计算单元,用于在所述候选信道与所述相邻信道相同时,采用所述相邻信道所属中继节点的信号信息计算干扰系数;
目标信道选取单元,用于按照所述干扰系数从所述候选信道中选取目标信道。
在本发明的一个实施例中,所述第二相邻信道计算子模块还包括:
候选信道增补单元,用于在所述候选信道的数量为一个时,将距离所述候选信道最远的、编号最小的信道或编号最大的信道设置为候选信道。
在本发明的一个实施例中,所述干扰系数计算单元包括:
节点信息检测子单元,用于检测所述相邻信道所属中继节点的数量和/或信号强度;
节点信息计算子单元,用于采用所述数量和/或所述信号强度计算干扰系数,其中,所述数量和/或所述信号强度与所述干扰系数正相关。
在本发明的一个实施例中,所述中继级别检测模块602包括:
默认级别设置子模块,用于将作为中继节点所处的中继级别设置为第一级;
中继配置信息请求子模块,用于向上一级的路由器或中继节点请求中继配置信息;
当请求成功时,从所述中继配置信息中提取上一级的中继节点的中继级别;
上级级别提取子模块,用于在上一级的中继节点的中继级别的基础上,计算作为中继节点所处的中继级别,以对所述第一级进行替换;
当前级别计算子模块,用于在请求失败时,确定作为中继节点所处的中继级别为第一级。
在本发明的一个实施例中,所述下级设备连接模块604包括:
登录信息接收子模块,用于在所述中继级别为第一级时,接收用户输入的登录信息;
登录信息提取子模块,用于在所述中继级别为第二级或第二级以上时,从上一级的中继节点的中继配置信息中提取登录信息,其中,所述登录信息包括服务集标识和密码;
softAP节点启动子模块,用于根据所述目标信道、所述服务集标识和所述密码启动所述Wi-Fi模组的softAP节点,以在所述目标信道广播所述服务集标识。
在本发明的一个实施例中,所述中继通信参数配置模块605包括:
包转发功能开启子模块,用于开启包转发功能;
地址转换功能设置子模块,用于在所述中继级别为第一级时,设置地址转换功能NAT的配置信息;
IP地址分配子模块,用于在所述中继级别为第二级或第二级以下时,从上一级的中继节点分配IP地址,并建立各级中继节点之间的中继路由表。
可选地,所述中继通信参数配置模块还包括:
IP地址查询子模块,用于在所述中继级别为第二级或第二级以下时,查询上一级的路由器或中继节点的IP地址;
域名***DNS设置子模块,用于将上一级的路由器或中继节点的IP地址,设置为域名***DNS的网关地址。
可选地,所述中继通信参数配置模块包括:
包转发功能开启子模块,用于开启包转发功能;
地址转换功能设置子模块,用于在所述中继级别为第一级时,设置地址转换功能NAT的配置信息;
IP地址查询子模块,用于在所述中继级别为第二级或第二级以下时,查询上一级的路由器或中继节点的IP地址;
域名***DNS设置子模块,用于将上一级的路由器或中继节点的IP地址,设置为域名***DNS的网关地址。
参照图7,示出了本发明一个实施例的另一种中继通信的配置装置实施例的结构框图,应用在移动终端中,所述移动终端配置有Wi-Fi模组,所述装置具体可以包括如下模块:
上行数据包接收模块701,用于通过所述softAP节点接收下一级的应用终端和/或中继节点发送的数据包;
上行中继通信模块702,用于将所述数据包从softAP节点转发至station节点;
上行数据包发送模块703,用于根据所述通信配置参数通过所述station节点将所述数据包发送至上一级的路由器或中继节点。
可选地,还包括:
下行数据包接收模块704,用于通过所述station节点接收上一级的路由器或中继节点发送的数据包;
下行中继通信模块705,用于将所述数据包从所述station节点转发至所述softAP节点;
下行数据包发送模块706,用于根据所述通信配置参数通过所述softAP节点将所述数据包发送至下一级的应用终端或中继节点。
在本发明的一个实施例中,所述上行数据包发送模块703包括:
网关地址查询子模块,用于在所述数据包中具有统一资源定位符URL时,查询域名***DNS的网关地址;网关地址发送子模块,用于通过所述station节点按照所述网关地址,将所述数据包发送至上一级的路由器或中继节点;
或者,所述上行数据包发送模块703包括:
第一IP地址转换子模块,用于在所述中继级别为第一级时,将所述数据包中的源地址,从所述应用终端的IP地址转换为所述移动终端的IP地址;第一数据包转发子模块,用于通过所述station节点将伪装来自所述移动终端的IP地址的数据包发送至上一级的路由器;
或者,所述上行数据包发送模块703包括:
第二数据包转发子模块,用于在所述中继级别为第二级或第二级以下时,通过所述station节点将所述数据包发送至上一级的中继节点。
在本发明的一个实施例中,所述下行数据包发送模块706包括:
第二IP地址转换子模块,用于在所述中继级别为第一级时,将所述数据包中的目的地址从所述移动终端的IP地址转换为所述应用终端的IP地址;
源地址查询子模块,用于当所述中继级别为第二级或第二级以下时,在所述数据包中查询源地址,获知所述应用终端的IP地址;
目标路径查询子模块,用于通过各级中继节点之间的中继路由表查询从所述移动终端的IP地址路由至所述应用终端的IP地址的目标路径;
下级地址查询子模块,用于在所述目标路径中查询下一级的应用终端或中继节点的IP地址;
第三数据包转发子模块,用于通过所述softAP节点按照下一级的应用终端或中继节点的IP地址将所述数据发送至下一级的应用终端或中继节点。
参见图8,示出了本发明实施例提供的一种可执行上述方法的移动终端,包括收发机810、与该收发机810连接的处理器800以及存储器820,其中:
处理器800,用于读取存储器820中的程序,执行下列过程:
通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;
检测作为中继节点所处的中继级别;
根据所述中继级别选择目标信道;
根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;
根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
收发机810,用于在处理器800的控制下接收和发送数据。
在图8中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器800代表的一个或多个处理器和存储器820代表的存储器的各种电路链接在一起。总线架构还可以将诸如***设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口830提供接口。收发机810可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。处理器800负责管理总线架构和通常的处理,还可以提供各种功能,包括定时,***接口,电压调节、电源管理以及其他控制功能。存储器820可以存储处理器800在执行操作时所使用的数据。
可选的,处理器800可以是中央处埋器(CPU)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或复杂可编程逻辑器件(Complex Programmable Logic Device,简称CPLD)。
本发明实施例中,处理器800读取存储器820中的程序,执行图1或图5所示实施例中的方法,具体参见前述实施例中的相关描述,此处不再赘述。
本本发明实施例还提供了一种计算机可读存储介质,其中存储有可执行的程序代码,该程序代码用以实现前述实施例描述的方法。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他 实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明实施例是参照根据本发明实施例的方法、终端设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同 要素。
以上对本发明所提供的一种中继通信的配置方法和一种中继通信的配置装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (12)

  1. 一种用于移动终端的中继通信的配置方法,其中,所述移动终端配置有Wi-Fi模组,所述方法包括:
    通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;
    检测作为中继节点所处的中继级别;
    根据所述中继级别选择目标信道;
    根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;
    根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述中继级别选择目标信道的步骤包括:
    查询上一级的路由器或中继节点所处的信道,作为上行信道;
    确定所述上行信道的频段类型;
    当所述中继级别为第一级时,按照所述频段类型计算与所述上行信道互不干扰的目标信道;
    当所述中继级别为第二级或第二级以下时,检测相邻的中继节点所处的信道,作为相邻信道,并按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道。
  3. 根据权利要求2所述的方法,其特征在于,所述按照所述频段类型计算与所述上行信道互不干扰的目标信道的步骤包括:
    当所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为目标信道,N为大于或等于5的整数;
    当所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为目标信道,M为大于或等于1的整数。
  4. 根据权利要求2所述的方法,其特征在于,所述检测相邻的中继节点所处的信道,作为相邻信道的步骤包括:
    查找与移动终端的服务集标识相同的中继节点;
    检测所述中继节点所处的信道,作为相邻信道。
  5. 根据权利要求2所述的方法,其特征在于,所述按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道的步骤包括:
    当所述频道类型为2.4G频段时,将所述上行信道偏移N个信道,作为候选信道,N 为大于或等于5的整数;
    当所述频道类型为5G频段时,将所述上行信道偏移M个信道,作为候选信道,M为大于或等于1的整数;
    当所述候选信道与所述相邻信道相同时,采用所述相邻信道所属中继节点的信号信息计算干扰系数,并按照所述干扰系数从所述候选信道中选取目标信道。
  6. 根据权利要求5所述的方法,其特征在于,所述按照所述频段类型计算与所述上行信道和所述相邻信道互不干扰的目标信道的步骤还包括:
    当所述候选信道的数量为一个时,将距离所述候选信道最远的、编号最小的信道或编号最大的信道设置为候选信道。
  7. 根据权利要求5所述的方法,其特征在于,所述采用所述相邻信道所属中继节点的信号信息计算干扰系数的步骤包括:
    检测所述相邻信道所属中继节点的数量和/或信号强度;
    采用所述数量和/或所述信号强度计算干扰系数,其中,所述数量和/或所述信号强度与所述干扰系数正相关。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述检测作为中继节点所处的中继级别的步骤包括:
    将作为中继节点所处的中继级别设置为第一级;
    向上一级的路由器或中继节点请求中继配置信息;
    当请求成功时,从所述中继配置信息中提取上一级的中继节点的中继级别;
    在上一级的中继节点的中继级别的基础上,计算作为中继节点所处的中继级别,以对所述第一级进行替换;
    当请求失败时,确定作为中继节点所处的中继级别为第一级。
  9. 根据权利要求1-7任一项所述的方法,其特征在于,所述根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点的步骤包括:
    当所述中继级别为第一级时,接收用户输入的登录信息;
    当所述中继级别为第二级或第二级以上时,从上一级的中继节点的中继配置信息中提取登录信息,其中,所述登录信息包括服务集标识和密码;
    根据所述目标信道、所述服务集标识和所述密码启动所述Wi-Fi模组的softAP节点,以在所述目标信道广播所述服务集标识。
  10. 一种用于移动终端的中继通信的配置装置,其中,所述移动终端配置有Wi-Fi模 组,所述装置包括:
    上级设备连接模块,用于通过所述Wi-Fi模组的station节点连接上一级的路由器或中继节点;
    中继级别检测模块,用于检测作为中继节点所处的中继级别;
    目标信道选择模块,用于根据所述中继级别选择目标信道;
    下级设备连接模块,用于根据所述中继级别启动所述Wi-Fi模组的softAP节点,以在所述目标信道连接下一级的应用终端和/或中继节点;
    中继通信参数配置模块,用于根据所述中继级别配置中继通信参数,以支持在所述station节点与所述softAP节点之间进行通信。
  11. 一种移动终端,其特征在于,包括:处理器、收发机和存储器;
    所述处理器,用于读取所述存储器中的程序,执行如权利要求1至9中任一项所述的方法;
    所述收发机,用于在所述处理器的控制下接收和发送数据。
  12. 一种计算机存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使所述计算机执行权利要求1至9任一项所述的方法。
PCT/CN2017/119921 2017-04-18 2017-12-29 一种中继通信的配置方法和装置 WO2018192265A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710254564.1A CN107040302B (zh) 2017-04-18 2017-04-18 一种中继通信的配置方法和装置
CN201710254564.1 2017-04-18

Publications (1)

Publication Number Publication Date
WO2018192265A1 true WO2018192265A1 (zh) 2018-10-25

Family

ID=59534936

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/119921 WO2018192265A1 (zh) 2017-04-18 2017-12-29 一种中继通信的配置方法和装置

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3914035A1 (en) * 2020-05-20 2021-11-24 Arcadyan Technology Corporation Wireless network bridging method and wireless network transmission device using the same

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040302B (zh) * 2017-04-18 2020-06-12 青岛海信移动通信技术股份有限公司 一种中继通信的配置方法和装置
CN107257561B (zh) * 2017-04-18 2021-04-06 青岛海信移动通信技术股份有限公司 一种中继通信的配置方法和装置
CN113163339B (zh) * 2020-01-22 2022-05-13 深圳市云海物联科技有限公司 一种搜索设备的方法、装置及终端设备
CN112533200B (zh) * 2020-11-23 2021-10-08 广州技象科技有限公司 基于***变更的数据跳传链路管理方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140086139A1 (en) * 2012-09-21 2014-03-27 Samsung Electronics Co., Ltd. Repeater for selecting channel in local communication system, and method thereof
CN105307290A (zh) * 2015-09-30 2016-02-03 青岛海信移动通信技术股份有限公司 一种移动设备的中继信道的配置方法和装置
CN107040302A (zh) * 2017-04-18 2017-08-11 青岛海信移动通信技术股份有限公司 一种中继通信的配置方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212762B (zh) * 2006-12-25 2011-03-16 华为技术有限公司 给中继节点分配无线信道的方法和***
CN101577969A (zh) * 2008-05-09 2009-11-11 中兴通讯股份有限公司 资源配置方法及资源调整方法
WO2010084775A1 (ja) * 2009-01-26 2010-07-29 パナソニック株式会社 中継装置、制御方法、およびプログラム
CN105228150A (zh) * 2015-09-30 2016-01-06 青岛海信移动通信技术股份有限公司 一种移动设备进行中继的方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140086139A1 (en) * 2012-09-21 2014-03-27 Samsung Electronics Co., Ltd. Repeater for selecting channel in local communication system, and method thereof
CN105307290A (zh) * 2015-09-30 2016-02-03 青岛海信移动通信技术股份有限公司 一种移动设备的中继信道的配置方法和装置
CN107040302A (zh) * 2017-04-18 2017-08-11 青岛海信移动通信技术股份有限公司 一种中继通信的配置方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3914035A1 (en) * 2020-05-20 2021-11-24 Arcadyan Technology Corporation Wireless network bridging method and wireless network transmission device using the same

Also Published As

Publication number Publication date
CN107040302B (zh) 2020-06-12
CN107040302A (zh) 2017-08-11

Similar Documents

Publication Publication Date Title
WO2018192265A1 (zh) 一种中继通信的配置方法和装置
WO2018192264A1 (zh) 一种中继通信的配置方法和装置
CN108028802B (zh) 使用802.11ad技术来构建自组织网状网络
WO2023011210A1 (zh) 一种获取边缘服务的方法和装置
WO2023284584A1 (zh) 通信方法和装置
US9237590B2 (en) Inter-device session connectivity enhancement
CN105228213A (zh) 一种移动设备进行中继的方法和装置
CN105375970B (zh) 一种移动设备进行中继的方法和装置
CN103260214B (zh) 一种设备接入方法、接入点和接入设备
US10291695B2 (en) Method and apparatus and computer readable record media for communication on wi-fi direct multi-group network
CN105307290B (zh) 一种移动设备的中继信道的配置方法和装置
CN105228150A (zh) 一种移动设备进行中继的方法和装置
CN106953673B (zh) Ieee 802.11ad网络中的回程优化的波束形成
CN107113892B (zh) 一种网关设备自动组网的方法及装置
KR101750038B1 (ko) 무선 통신의 범위 확장을 위한 시스템들, 장치 및 방법들
CN105375969A (zh) 一种移动设备进行中继的方法和装置
CN105376357A (zh) 一种移动设备的天线设置方法和装置
CN103068065A (zh) 用于桥接至lte无线通信网络的***和方法
CN105227693A (zh) 一种移动设备的dns的配置方法和装置
CN104918302B (zh) 一种构建无线网格网络的方法及无线音箱
US8369355B2 (en) Communication control device, communication control method, program and communication system
CN107249204B (zh) 一种中继通信的天线设置方法和装置
CN104879894B (zh) 远程控制空调的方法、装置及***
JP5922957B2 (ja) 無線通信システム、及び干渉抑制方法
CN103167509A (zh) 无线局域网信号延伸设备及方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17905948

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18/02/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17905948

Country of ref document: EP

Kind code of ref document: A1