CN107249204B - Antenna setting method and device for relay communication - Google Patents

Antenna setting method and device for relay communication Download PDF

Info

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

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/22Communication route or path selection, e.g. power-based or shortest path routing using selective relaying for reaching a BTS [Base Transceiver Station] or an access point
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the invention provides a method and a device for setting an antenna of relay communication, which are applied to a mobile terminal, wherein the mobile terminal is provided with a Wi-Fi module, a transmitting antenna and a receiving antenna, and the method comprises the following steps: when a station node of the Wi-Fi module is connected with a router or a relay node at the upper stage, detecting the relay level of the relay node; starting a softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect an application terminal and/or a relay node of the next level; determining the communication type of communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level; and adjusting the number of the transmitting antenna and the receiving antenna according to the communication type. The embodiment of the invention forms a multi-stage relay network, and increases the number of relay nodes, thereby improving the number of connections and reducing the power consumption of the mobile terminal.

Description

Antenna setting method and device for relay communication
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an antenna setting method and an antenna setting apparatus for relay communications.
Background
With the improvement of living standards, wireless signals, such as Wi-Fi (wireless fidelity), have been widely used in various aspects of life due to the convenience of wireless.
At present, in order to save cost, a waste mobile terminal can be used to be hung under a router and used as a repeater to transmit a received wireless signal, so that the coverage range of the wireless signal is enlarged, the communication distance and the coverage range of the wireless signal are enlarged, and a wireless weak signal is enhanced.
However, the number of router connections is limited, and the number of devices that can use relays is limited, and with the increase in devices such as smart home appliances and handheld terminals, newly added devices cannot be connected to relays and cannot use wireless signals.
In order to use the Wi-Fi module, the mobile terminal generally sets the number of antennas to receive and transmit data.
If a large number of antennas are provided, a high Wi-Fi performance is maintained, which may cause waste of antenna resources and power in many cases.
In addition, the high-power Wi-Fi signals have certain electromagnetic radiation on human bodies and cause damage to the human bodies.
If a smaller number of antennas is provided, the Wi-Fi performance is kept low, and in some cases, data reception and transmission are limited.
Disclosure of Invention
In view of the above problems, in order to solve the problem that the newly added devices cannot be connected to relays and use wireless signals due to the limited number of router connections, embodiments of the present invention provide a method and a device for configuring relay communications.
According to an aspect of the present invention, there is provided an antenna setting method for relay communication, applied in a mobile terminal, wherein the mobile terminal is configured with a Wi-Fi module, a transmitting antenna and a receiving antenna, the method comprising:
when a station node of the Wi-Fi module is connected with a router or a relay node at the upper stage, detecting the relay level of the relay node;
starting a softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect an application terminal and/or a relay node of the next level;
determining the communication type of communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level;
and adjusting the number of the transmitting antenna and the receiving antenna according to the communication type.
Optionally, the step of determining a communication type of communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level includes:
counting protocol types of data packets transmitted between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage;
and when the number of the data packets belonging to the protocol type exceeds a preset number threshold, determining that the protocol type is the communication type of communication between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage.
Optionally, the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type includes:
judging whether the communication flow between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage is larger than a preset flow threshold value or not; and if so, adjusting the number of the transmitting antenna and the receiving antenna by adopting the communication type.
Optionally, the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type includes:
when the communication type is a first type, setting the number of the receiving antennas to be a first number, and setting the number of the transmitting antennas to be a first number;
the first number is greater than or equal to a preset first number threshold, and the first type comprises a downloading type or an uploading type.
Optionally, the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type includes:
when the communication type is a second type, judging whether the downloaded flow is larger than a preset downloading threshold value;
if yes, setting the number of the receiving antennas to be a first number, and setting the number of the transmitting antennas to be a second number;
if not, setting the number of the receiving antennas to be a second number, and setting the number of the transmitting antennas to be the second number;
wherein the first number is greater than or equal to a preset first number threshold, the second number is less than or equal to a preset second number threshold, and the first number threshold is greater than the second number threshold;
the second type includes a video browsing type.
Optionally, the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type includes:
when the communication type is a third type, setting the number of the receiving antennas to be a second number, and setting the number of the transmitting antennas to be a second number;
and the second quantity is less than or equal to a preset second quantity threshold, and the third type comprises a webpage browsing type.
Optionally, the step of detecting the relay level as the relay node includes:
setting a relay level as a first level, wherein the relay level is the relay node;
requesting relay configuration information from a router or a relay node at the upper level;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
on the basis of the relay level of the relay node at the upper stage, calculating the relay level where the relay node is located to replace the first stage;
when the request fails, the relay level as the relay node is determined to be the first level.
Optionally, the step of starting the softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters to connect to the application terminal and/or the relay node of the next level includes:
determining a channel of the softAP node;
when the relay level is a first level, receiving login information input by a user;
when the relay level is the second level or more, extracting login information from relay configuration information of a relay node of the previous level, wherein the login information comprises a service set identifier and a password;
starting a softAP node of the Wi-Fi module according to the channel, the service set identification and the password so as to broadcast the service set identification on the channel.
Optionally, the step of starting the softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters to connect to the application terminal and/or the relay node of the next level includes:
opening a packet forwarding function;
when the relay level is a first level, setting configuration information of an address translation function NAT;
when the relay level is the second level or below, an IP address is distributed from the relay node of the upper level, and a relay routing table between the relay nodes of all levels is established;
and/or the presence of a gas in the gas,
inquiring the IP address of the router or the relay node at the upper stage;
and setting the IP address of the router or the relay node at the upper stage as the gateway address of the Domain Name System (DNS).
Optionally, the method further comprises:
receiving a data packet sent by an application terminal and/or a relay node of a next stage through the softAP node;
forwarding the data packet from the softAP node to a station node;
and sending the data packet to a router or a relay node at the upper stage through the station node according to the communication configuration parameters.
Optionally, the step of sending the data packet to a router or a relay node at an upper stage through the station node according to the communication configuration parameter includes:
when the data packet has a Uniform Resource Locator (URL), inquiring a gateway address of a Domain Name System (DNS);
sending the data packet to a router or a relay node at the upper stage through the station node according to the gateway address;
alternatively, the first and second electrodes may be,
when the relay level is a first level, converting a source address in the data packet from the IP address of the application terminal to the IP address of the mobile terminal;
sending the data packet disguising the IP address from the mobile terminal to a router at the upper level through the station node;
alternatively, the first and second electrodes may be,
when the relay level is at or below the second level,
and sending the data packet to a relay node at the upper stage through the station node.
Optionally, the method further comprises:
receiving a data packet sent by a router or a relay node of the upper stage through the station node;
forwarding the data packet from the station node to the softAP node;
and sending the data packet to a next-level application terminal or a relay node through the softAP node according to the communication configuration parameters.
Optionally, the step of sending the data packet to a relay node at an upper stage by the station node includes:
when the relay level is a first level, converting the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal;
when the relay level is the second level or below, inquiring a source address in the data packet to acquire the IP address of the application terminal;
inquiring a target path from the IP address route of the mobile terminal to the IP address of the application terminal through a relay routing table between each level of relay nodes; inquiring the IP address of the next-level application terminal or the relay node in the target path;
and sending the data to the application terminal or the relay node of the next level through the softAP node according to the IP address of the application terminal or the relay node of the next level.
According to another aspect of the present invention, there is provided an antenna setting apparatus for relay communication, which is applied in a mobile terminal configured with a Wi-Fi module, a transmitting antenna, and a receiving antenna, the apparatus including:
the relay level detection module is used for detecting the relay level of the relay node when the relay node is connected with the upper-level router or the relay node through the station node of the Wi-Fi module;
the relay communication configuration module is used for starting a softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect an application terminal and/or a relay node of the next level;
the communication type determining module is used for determining the communication type of communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level;
and the antenna number adjusting module is used for adjusting the number of the transmitting antenna and the receiving antenna according to the communication type.
Optionally, the communication type determining module includes:
the protocol type counting submodule is used for counting the protocol type of a data packet transmitted between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage;
and the protocol type determining submodule is used for determining the protocol type as the communication type of communication between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage when the number of the data packets belonging to the protocol type exceeds a preset number threshold.
Optionally, the antenna number adjusting module includes:
the flow judgment submodule is used for judging whether the communication flow between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage is larger than a preset flow threshold value or not; if yes, calling a flow control submodule;
and the flow control submodule is used for adjusting the number of the transmitting antenna and the receiving antenna by adopting the communication type.
Optionally, the antenna number adjusting module includes:
the first setting submodule is used for setting the number of the receiving antennas to be a first number and setting the number of the transmitting antennas to be a first number when the communication type is a first type;
the first number is greater than or equal to a preset first number threshold, and the first type comprises a downloading type or an uploading type.
Optionally, the antenna number adjusting module includes:
the download flow judgment submodule is used for judging whether the download flow is larger than a preset download threshold value or not when the communication type is a second type; if yes, calling a second setting submodule, and if not, calling a third setting submodule;
the second setting submodule is used for setting the number of the receiving antennas to be a first number and setting the number of the transmitting antennas to be a second number;
a third setting submodule, configured to set the number of the receiving antennas to a second number, and set the number of the transmitting antennas to the second number;
wherein the first number is greater than or equal to a preset first number threshold, the second number is less than or equal to a preset second number threshold, and the first number threshold is greater than the second number threshold;
the second type includes a video browsing type.
Optionally, the antenna number adjusting module includes:
a fourth setting submodule, configured to set the number of the receiving antennas to a second number and set the number of the transmitting antennas to a second number when the communication type is a third type;
and the second quantity is less than or equal to a preset second quantity threshold, and the third type comprises a webpage browsing type.
Optionally, the relay level detecting module includes:
the default level setting submodule is used for setting the relay level of the relay node as a first level;
the relay configuration information request submodule is used for requesting relay configuration information to an upper-level router or a relay node;
the superior level extraction submodule is used for extracting the relay level of the superior relay node from the relay configuration information when the request is successful;
the current level calculation submodule is used for calculating the relay level of the relay node on the basis of the relay level of the relay node on the upper level so as to replace the first level;
and the default level determining submodule is used for determining the relay level as the relay node as the first level when the request fails.
Optionally, the relay communication configuration module includes:
a channel detection sub-module, configured to determine a channel of the softAP node;
the login information receiving submodule is used for receiving login information input by a user when the relay level is a first level;
the login information extraction submodule is used for extracting login information from relay configuration information of a relay node at the upper level when the relay level is at the second level or above, wherein the login information comprises a service set identifier and a password;
and the softAP node starting sub-module is used for starting the softAP node of the Wi-Fi module according to the channel, the service set identification and the password so as to broadcast the service set identification on the channel.
Optionally, the relay communication configuration module includes:
the packet forwarding function starting submodule is used for starting the packet forwarding function;
the address translation function setting submodule is used for setting the configuration information of the address translation function NAT when the relay level is the first level;
the IP address allocation submodule is used for allocating an IP address from the relay node of the previous stage when the relay level is the second stage or below the second stage and establishing a relay routing table between the relay nodes of each stage;
and/or the presence of a gas in the gas,
the IP address query submodule is used for querying the IP address of the router or the relay node at the upper stage;
and the domain name system DNS setting submodule is used for setting the IP address of the router or the relay node at the upper level as the gateway address of the domain name system DNS.
Optionally, the method further comprises:
an uplink data packet receiving module, configured to receive, by the softAP node, a data packet sent by a next-stage application terminal and/or a relay node;
the uplink relay communication module is used for forwarding the data packet from the softAP node to the station node;
and the uplink data packet sending module is used for sending the data packet to a router or a relay node at the upper stage through the station node according to the communication configuration parameters.
Optionally, the uplink data packet sending module includes:
a gateway address query submodule, configured to query a gateway address of a domain name system DNS when the data packet has a uniform resource locator URL;
the gateway address sending submodule is used for sending the data packet to a router or a relay node at the upper stage through the station node according to the gateway address;
alternatively, the first and second electrodes may be,
a first IP address conversion sub-module, configured to convert, when the relay level is a first level, a source address in the data packet from an IP address of the application terminal to an IP address of the mobile terminal;
a first data packet forwarding sub-module, configured to send, through the station node, a data packet disguised as an IP address from the mobile terminal to a router at an upper level;
alternatively, the first and second electrodes may be,
and the second data packet forwarding submodule is used for sending the data packet to the relay node of the previous stage through the station node when the relay level is the second stage or below the second stage.
Optionally, the method further comprises:
a downlink data packet receiving module, configured to receive, by the station node, a data packet sent by a router or a relay node at an upper stage;
a downlink relay communication module for forwarding the data packet from the station node to the softAP node;
and the downlink data packet sending module is used for sending the data packet to a next-level application terminal or a next-level relay node through the softAP node according to the communication configuration parameters.
Optionally, the downlink data packet sending module includes:
a second IP address conversion sub-module, configured to convert the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal when the relay level is the first level;
a source address query submodule, configured to query a source address in the data packet to obtain an IP address of the application terminal when the relay level is a second level or below;
a target path query submodule, configured to query, through a relay routing table between each stage of relay nodes, a target path from the IP address of the mobile terminal to the IP address of the application terminal;
a lower address query submodule, configured to query an IP address of a next-stage application terminal or a relay node in the target path;
and the third data packet forwarding submodule is used for sending the data to the next-level application terminal or the next-level relay node through the softAP node according to the IP address of the next-level application terminal or the next-level relay node.
The embodiment of the invention has the following advantages:
the embodiment of the invention is characterized in that a mobile terminal is provided with a Wi-Fi module, a softAP node of the Wi-Fi module is started through a router or a relay node at the upper stage of a station node of the Wi-Fi module to connect an application terminal and/or a relay node at the lower stage, relay communication parameters are configured according to the current relay level to support communication between the station node and the softAP node, the mobile terminal is realized as the relay node, the relay node is hung behind the relay node to form a multi-stage relay network, the structure level of the network is widened, the number of the relay nodes is increased, the number of the connection is increased, and under the condition that more devices such as intelligent household appliances and handheld terminals are arranged, the newly-added devices can be connected with a relay and normally use wireless signals; and the number of the transmitting antenna and the receiving antenna is dynamically adjusted according to the flow type, so that the power consumption of the mobile terminal is reduced, the consumption of the electric quantity of a battery is reduced, the working time of the mobile terminal is prolonged under the condition that the normal relay function of the mobile terminal is ensured, and the damage to a human body is reduced due to the reduction of the power consumption.
Drawings
Fig. 1 is a flowchart illustrating steps of an antenna setting method for relay communication according to an embodiment of the present invention;
FIG. 2 is an exemplary diagram of a packet header of an FTP packet;
FIG. 3 is a topology diagram of a relay network of one embodiment of the present invention;
fig. 4 is a flowchart illustrating steps of an antenna setting method for relay communication according to another embodiment of the present invention;
fig. 5 is a block diagram of an embodiment of an antenna setting apparatus for relaying communication according to an embodiment of the present invention;
fig. 6 is a block diagram of another embodiment of an antenna installation apparatus for relaying communication according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an antenna setting method for relay communication according to an embodiment of the present invention is shown, and specifically may include the following steps:
and 101, detecting a relay level of the relay node when the station node of the Wi-Fi module is connected with a router or a relay node at the upper stage.
In a specific implementation, the embodiments of the present invention may be applied to a mobile terminal, for example, a mobile phone, a tablet computer, a smart wearable device (such as a smart watch), and the like.
These mobile terminals may be installed with Windows phone, Android, IOS, Windows, and other operating systems, configured with a Wi-Fi (WIreless-Fidelity) module, and may be connected to a WIreless node as a relay node to forward a WIreless signal.
A Wi-Fi module is also called a serial port Wi-Fi module, belongs to an Internet of things Transmission layer, can convert a serial port or TTL (transistor-transistor logic level) signal into an embedded module which accords with a Wi-Fi wireless network communication standard, and is internally provided with a wireless network Protocol IEEE802.11b.g.n Protocol stack and a TCP/IP (Transmission Control Protocol/Internet Protocol) Protocol stack.
In a particular implementation, Wi-Fi modules typically have three functions: station, softAP, P2P.
Wherein station: which means devices connected to a wireless network, can communicate with other devices inside or outside the wireless network through an AP (wireless access point).
softAP: the function of using the application to realize the AP is shown, so that the mobile terminal can be used as a route to link other stations.
P2P (Peer-to-Peer): also known as Wi-Fi Direct, can support two Wi-Fi devices to connect directly and communicate without an AP.
In the embodiment of the present invention, the mobile terminal may be used as a relay node to connect to a higher-level device, which may be a router or a relay node, that is, the relay node may be hooked after the relay node to form a tree-like relay network.
If the mobile terminal is a relay node of the first level, the mobile terminal can be connected with a router of the first level through a station node of the Wi-Fi module.
If the mobile terminal is a second-level relay node or a relay node below the second level, the mobile terminal can be connected with a first-level relay node through a station node of the Wi-Fi module.
In one embodiment, a getWifiState () method in a WifiManager can be called to detect whether the mobile terminal turns on a station node of Wi-Fi.
When the state node is detected to be started, whether the state node is connected with the wireless node or not can be detected by calling an Application Programming Interface (API) Interface getNetworkInfo () provided by the connectivity manager, and using the connectivity manager.
If the returned NetworkInfo object is not null and isConnected () is true, the wireless node is confirmed to be connected.
When the situation node is detected not to be started or not to be connected with the wireless node, prompt information of the connected wireless node is generated, such as 'please turn on the Wi-Fi and connect a router or a relay'.
If the mobile terminal is accessed to the network as the relay node, the relay level where the mobile terminal is currently located can be identified.
The relay node of the first stage may be referred to as a root node, and two stages of relay nodes are connected with each other, where the relay node of the previous stage is a parent node of the relay node of the next stage, and relatively speaking, the relay node of the next stage is a child node of the relay node of the previous stage.
In one embodiment, each level of relay node may maintain one relay configuration information, in which information such as routing path, relay level, login information (such as service set identification SSID and password) and the like may be recorded.
In this embodiment, the relay level at which the relay node is located may be set as the first level.
And according to a preset specification, requesting relay configuration information to a router or a relay node at the upper stage.
If the device at the upper level is a router, and the router does not set the specification, the request of the mobile terminal is ignored.
And if the equipment at the upper level is the relay node which has set the standard, responding to the request of the mobile terminal and returning the relay configuration information.
And when the request is successful, extracting the relay level of the relay node at the upper stage from the relay configuration information.
And on the basis of the relay level of the relay node at the upper stage, calculating the relay level where the relay node is located to replace the first stage.
Further, the mobile terminal may add one to the relay level of the relay node at the previous stage, so as to obtain the relay level at which the mobile terminal is currently used as the relay node.
For example, if the relay level of the relay node at the previous stage is the second stage, the relay level of the mobile terminal as the relay node is the third stage, and the default first stage is modified to the third stage.
When the request fails, the relay level as the relay node is determined to be the first level. Of course, the above-mentioned detection method of the relay level is only an example, and when implementing the embodiment of the present invention, other detection methods of the relay level may be set according to actual situations, for example, requesting the relay level to the router or the relay node at the previous stage, if the request fails, setting the relay level as the first stage, if the request succeeds, calculating the current relay level on the basis of the relay level of the relay node at the previous stage, and the like, which is not limited in this embodiment of the present invention. In addition, besides the above relay level detection method, a person skilled in the art may also adopt other relay level detection methods according to actual needs, and the embodiment of the present invention is not limited to this.
And 102, starting the softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect the application terminal and/or the relay node of the next level.
If the station node of the Wi-Fi module of the mobile terminal is connected to the router or the relay node of the previous stage, a relay instruction can be sent to the Wi-Fi module according to the relay level, the softAP node is started, and the application terminal and/or the relay node of the next stage are/is connected through the softAP node.
Wherein, the application terminal may refer to a terminal that realizes its own function, for example, an intelligent electric rice cooker, an intelligent air conditioner, an intelligent water heater, and the like.
It should be noted that the mobile terminal may be used as a relay node, and may also be used as an application terminal to implement functions such as browsing a web page, playing a game, and playing a network video.
In one embodiment of the invention, a channel of the softAP node can be determined, which generally has no interference with the router and other relay nodes, and therefore, the relay instruction can be issued on the channel.
In a specific implementation, the frequencies corresponding to different channels are:
Figure BDA0001272761010000121
and when the relay level is the first level, receiving login information input by a user, wherein the login information comprises a service set identifier and a password.
In this case, the User may be prompted at a UI (User Interface) to enter the SSID and password of the relay (i.e., mobile terminal).
And if the user inputs the SSID and the password in the UI, using the SSID and the password, and otherwise, using a default SSID and a default password.
When the relay level is the second level or more, the login information is extracted from the relay configuration information of the relay node at the upper level, the login information between the father node and the son node is kept the same, and under the condition that the invalid network signal is poor (such as less than-90 DB), roaming can be started, and other adjacent relay nodes are automatically connected by adopting the same login information.
If the login information is obtained, the softAP node of the Wi-Fi module can be started according to the channel, the service set identification and the password so as to broadcast the service set identification.
In a specific implementation, freq (channel), SSID, and password are written into a hostapd.
hostapd-d hostapd.conf
The freq, SSID and password can be validated.
After the relay instruction is sent, the broadcast frame sent by the relay node (i.e. the mobile terminal) carries the SSID, and after the SSID is scanned, other terminals can use the SSID and the password for connection.
In a specific implementation, the relay node (i.e., the mobile terminal) may be regarded as an AP, which periodically broadcasts a Beacon frame, and the SSID of the relay node (i.e., the mobile terminal) can be obtained by scanning the Beacon frame by other station devices.
When an application request sent by one or more electronic devices (application terminals and/or relay nodes at the next stage) for the SSID is received, a response message challenge text is returned to the one or more electronic devices.
When a connection request sent by one or more electronic devices is received, whether the password in the connection request is the same as a preset password or not is verified, and if yes, the one or more electronic devices are accessed.
In the embodiment of the invention, the relay nodes of different relay levels have different relay communication parameters, so that the station node and the softAP node can communicate with each other, and the softAP node is connected with the next-level application terminal and/or relay node due to the fact that the station node is connected with the first-level wireless node, so that the previous-level router or relay node can communicate with the next-level application terminal and/or relay node, and the relay function is realized.
In one embodiment of the present invention, step 102 may include the following sub-steps:
and a sub-step S11 of turning on the packet forwarding function.
In a specific implementation, a packet forwarding function may be started through an echo attribute value to support forwarding of a data packet between a station node and a softAP node:
echo 1>/proc/sys/net/ipv4/ip_forward
packet forwarding is the process of allowing packets to be forwarded from one terminal to another.
In the embodiment of the invention, a packet forwarding function is opened, and the data packet is supported to be mutually forwarded between the station node and the softAP node.
And a substep S12, when the relay level is the first level, setting the configuration information of the address translation function NAT.
In practical application, the configuration information of an Address translation function NAT (network Address translation) can be called to the Wi-Fi module through the system Address table service iptables, and the NAT can automatically modify the source IP Address and the destination IP Address of the IP packet to disguise the IP Address of the application terminal.
Of course, prior routing tables may also be purged before sending the routing tables and NAT.
The configuration information of the Iptables and NAT configuration is as follows:
# remove old rules (clear previous routing tables)
iptables-F
iptables-t filter-F
iptables-t nat-F
#Bring up NAT rules
iptables-t nat-A POSTROUTING-s 192.168.49.0/24-d 0.0.0.0/0-j MASQUERADE
Wherein, assuming that the IP segment of the relay (i.e. the mobile terminal) is 192.168.49.0, the sending Bring up NAT rules can repackage and unpack the data packet with 192.168.49.0/24 network segment as the source address, and disguise as the source address of 0.0.0.0/0.
And a substep S13, when the relay level is the second level or below, allocating an IP address from the relay node of the previous level, and establishing a routing path between the relay nodes of each level.
In a specific implementation, an IP address may be dynamically assigned to a relay node at or below the second level.
In one embodiment, the total address space may be divided into multiple segments or multiple sub-domains, each relay node may continue to allocate its assigned address to a sub-node from which the application terminal does not have a sub-node, so no address needs to be allocated.
The mobile terminal as a relay node has an address pool, i.e. a set of addresses, the address pool capacity of a relay node at or below the second level is determined from its parent node, which calculates the address pool capacity by the following formula:
Cskip(d)=1+Cm×(Lm-d-1) Rm=1
Cskip(d)=(1+Cm-Rm-Cm×Rm Lm-d-1)/(1-Rm) Rm≠1
wherein, Cskip(d) An offset value indicating that a parent node having a relay level d determines when assigning an address, an address pool capacity of a corresponding child node, CmIndicating the maximum number of subnodes, L, that the relay node can receivemRepresenting the maximum depth of the network (relay level), RmRepresents the maximum number of subnodes that the relay node can receive, and d represents the node depth (relay level).
The depth d of a father node is increased by 1 when the network is accessed, the depth of a coordinator is defined as 0, Cm、Lm、RmThese three parameters may be provided by the user describing the size and general form of the network.
Calculating the offset Cskip(d) And then, the father node determines the network address according to the type of the network-accessing child node.
If the child node is a relay node, the address can be calculated by adopting the following formula:
An=Ap+Cskip(d)×(n-1)+1 1≤n≤Rm
wherein A ispIs the network address of a father node, n is the node applying for network access and is the second child relay node, AnAnd obtaining the network address for the nth network access sub-relay node.
In the embodiment of the present invention, a relay routing table may be maintained in each relay node, and in the relay routing table, when each relay node enters the network, its assigned address and a parent-child relationship between the relay node and other relay nodes may be recorded, and when each relay node exits the network, its assigned address is deleted, so that the parent-child relationship and addresses between relays at each level may constitute a routing path of relays at each level.
And a substep S14 of inquiring the IP address of the router or the relay node of the previous stage.
Substep S15, setting the IP address of the router or the relay node at the upper stage as the gateway address of the domain name system DNS
In the embodiment of the invention, on one hand, an address table service iptable in the system can be called to send a gateway address of a DNS (Transmission Control Protocol) based on a TCP (Transmission Control Protocol) to a Wi-Fi module;
the command format is:
iptables-tnat-I PREROUTING-I (Relay device name) -p tcp-dport 53-j DNAT-to-destination (gateway)
On the other hand, the address table service iptable in the System can be called, and a gateway address of the DNS based on UDP (Open System Interconnection) is sent to the Wi-Fi module.
The command format is:
iptables-tnat-I PREROUTING-I (Relay device name) -p udp-dport 53-j DNAT-to-destination (gateway)
When the relay node of which the relay level is the first level, the gateway address of the domain name system DNS is set as the gateway address of the router.
When the relay level is the second level or a relay node below the second level, the gateway address of the domain name system DNS is set as the IP address of the relay node at the upper level.
As described above, the DNS gateway addresses of TCP and UDP are added to the relay device (i.e., the mobile terminal), and after the DNS is configured, the input uniform resource locator URL is transferred step by step and is finally resolved by the DNS server, thereby implementing network communication.
And 103, determining the communication type of the communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level.
In a specific implementation, the protocol type of the data packet transmitted between the router or the relay node at the previous stage and the application terminal and/or the relay node at the next stage may be counted.
And when the number of the data packets belonging to the protocol type exceeds a preset number threshold, determining that the protocol type is the communication type of communication between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage.
Further, the packet headers of all data packets accessing the internet through Wi-Fi can be analyzed, the data packets are counted in real time, the proportion of each protocol is counted, and then the proportion is reported to determine the communication type.
The Protocol includes FTP (File Transfer Protocol), RTP (Real-time Transport Protocol), WAP (Wireless Application Protocol), HTTP (Hypertext Transfer Protocol), and the like.
Taking the FTP protocol as an example, the statistical method for processing the data packet header is as follows:
as shown in fig. 2, in the data header format of FTP, the first 12 bytes of a first row are a destination hardware address and a source address in a header of a protocol MAC (media Access Control) frame.
The next two bytes are a type field in the MAC frame header identifying what type of protocol was received from the upper layer and "0806" indicates that an FTP type datagram was received from the upper layer.
The following data represents the contents of the datagram:
"0001" indicates that the hardware type is Ethernet
"0800" indicates that the type of protocol used is IP type
"0604" indicates a hardware address length of 6 bytes and a protocol address length of 4 bytes, respectively
"0001" indicates that the ARP request operation is performed
"0013 d4ae 4426" and "3 b 4f 129 b" indicate the source hardware address, source protocol address (59.79.18.155)
"000000000000", "3 b 4f 12 fe" indicates the destination hardware address and the destination protocol address (59.79.18.254)
The remaining 0 s are padding data.
In summary, the data packet is a request message of the FTP protocol.
And 104, adjusting the number of the transmitting antennas and the receiving antennas according to the communication type.
In the embodiment of the invention, the mobile terminal is provided with at least two Wi-Fi antennas, the Wi-Fi antennas are used for transmitting Wi-Fi data or receiving Wi-Fi data, the Wi-Fi antennas used for transmitting the Wi-Fi data are transmitting antennas, and the Wi-Fi antennas used for receiving the Wi-Fi data are receiving antennas.
In specific implementation, the number of receiving antennas and the number of transmitting antennas may be dynamically adjusted according to the communication type of communication between the router or the relay node at the previous stage and the application terminal and/or the relay node at the next stage, and power consumption may be adaptively adjusted in the process of relay communication.
In an embodiment of the present invention, to reduce system resource consumption, it may be determined whether a traffic volume communicated between the router or the relay node at the previous stage and the application terminal and/or the relay node at the next stage is greater than a preset traffic volume threshold (e.g., 20 KB/s).
If yes, the flow is larger, and the number of the transmitting antennas and the number of the receiving antennas can be adjusted by adopting the communication type.
If not, indicating that the traffic is low, the number of transmit antennas and receive antennas may be set to a second number (e.g., 1) to reduce power consumption.
In one scenario, when the communication type is a first type, the number of receive antennas is set to a first number and the number of transmit antennas is set to a first number.
Wherein the first number is greater than or equal to a preset first number threshold, e.g., 2.
In this scenario, the first type includes a download type or an upload type, and when high-speed uploading or downloading such as FTP is used, 2 (the first number) transmitting antennas and receiving antennas of the relay node are all used to form multiple spatial data streams, and the multiple spatial data streams are forwarded at full speed.
In another scenario, when the communication type is the second type, it is determined whether the downloaded traffic is greater than a preset download threshold.
If yes, the number of the receiving antennas is set to be the first number, and the number of the transmitting antennas is set to be the second number.
If not, the number of the receiving antennas is set to be the second number, and the number of the transmitting antennas is set to be the second number
Wherein the first number is greater than or equal to a preset first number threshold (e.g., 2), the second number is less than or equal to a preset second number threshold (e.g., 1), and the first number threshold is greater than the second number threshold.
In the scene, the second type comprises a video browsing type, when different types of videos are watched by using video streams, due to asymmetry existing in uploading and downloading, the number of antennas can be dynamically adjusted in time according to the video flow, and when the flow is required to be high-speed, the relay node uses 2 (the first number) transmitting antennas and 1 (the second number) receiving antenna to reduce the receiving power consumption; when the required flow is low, 1 (second number) line transmitting antenna and 1 (second number) receiving antenna can be used, and the transmitting power consumption is reduced.
In another scenario, when the communication type is a third type, the number of receive antennas is set to a second number and the number of transmit antennas is set to the second number.
Wherein the second number is less than or equal to a preset second number threshold (e.g., 1).
In such a scenario, the third type includes a web browsing type, and when the user performs low-traffic communication such as web browsing, the relay node uses 1 (second number) of transmitting antennas and 1 (second number) of receiving antennas, so as to reduce power consumption for transmission and reception.
Of course, the above adjustment modes of the antennas are only used as examples, and when implementing the embodiment of the present invention, adjustment modes of other antennas may be set according to actual situations, for example, 3 transmitting antennas and 3 receiving antennas are set, 1, 2, or 3 transmitting antennas are dynamically selected according to the traffic of the video, and the like, which is not limited in the embodiment of the present invention. In addition, besides the above antenna adjustment methods, those skilled in the art may also adopt other antenna adjustment methods according to actual needs, and the embodiment of the present invention is not limited thereto.
In practical applications, the number of transmitting antennas and the number of receiving antennas can be adjusted by wl instructions, which are exemplified as follows:
Figure BDA0001272761010000181
the embodiment of the invention is characterized in that a mobile terminal is provided with a Wi-Fi module, a softAP node of the Wi-Fi module is started through a router or a relay node at the upper stage of a station node of the Wi-Fi module to connect an application terminal and/or a relay node at the lower stage, relay communication parameters are configured according to the current relay level to support communication between the station node and the softAP node, the mobile terminal is realized as the relay node, the relay node is hung behind the relay node to form a multi-stage relay network, the structure level of the network is widened, the number of the relay nodes is increased, the number of the connection is increased, and under the condition that more devices such as intelligent household appliances and handheld terminals are arranged, the newly-added devices can be connected with a relay and normally use wireless signals; and the number of the transmitting antenna and the receiving antenna is dynamically adjusted according to the flow type, so that the power consumption of the mobile terminal is reduced, the consumption of the electric quantity of a battery is reduced, the working time of the mobile terminal is prolonged under the condition that the normal relay function of the mobile terminal is ensured, and the damage to a human body is reduced due to the reduction of the power consumption.
In order to make those skilled in the art better understand the embodiments of the present invention, the relay network in the embodiments of the present invention is described below by way of specific examples.
As shown in fig. 3, it is assumed that there are a living room, a kitchen, two bedrooms (including a main bed and a secondary bed) and a study room in a house, wherein the main bed is close to the study room, and the secondary bed is close to the kitchen.
In this example, the router 32 is placed in the living room, the router 32 accesses the base station 31, and as a wireless node, broadcasts a Wi-Fi signal.
Since the Wi-Fi signal is weak in the main bed, the sub bed, the study room and the kitchen due to a large living room area and wall obstruction, it is possible to place the mobile terminal 332 in the living room, place the mobile terminal 331 near the main bed, place the mobile terminal 3313 near the study room, place the mobile terminal 3321 near the sub bed and the kitchen, place the mobile terminal 33213 near the kitchen, and place the mobile terminal 33211 near the sub bed.
In the living room:
the mobile terminal 331 accesses the route 32 through the station node and starts the softAP node as a relay node of the first stage to relay the Wi-Fi signal to the master-slave.
The mobile terminal 332 accesses the route 32 through the station node and starts the softAP node as a relay node of the first level to relay the Wi-Fi signal to other parts of the living room (e.g., the balcony), respectively.
The laptop 333 is used as an application terminal to access the router 32 for the user to work, entertain, etc. in the living room.
The mobile terminal 3321 accesses the mobile terminal 332 through the station node and starts the softAP node as a relay node of the second level to relay Wi-Fi signals to the secondary-lying, kitchen.
The intelligent coffee machine 3322 and the intelligent water dispenser 3323 are used as application terminals to access the mobile terminal 332.
In the master-lying:
the tablet computer 3311, the PDA 3312, and the mobile terminal 3314 are connected to the mobile terminal 331 as application terminals for the user to work, entertain, and so on in the home position and the bed position.
The mobile terminal 3313 accesses the mobile terminal 331 through the station node and starts the softAP node as a relay node of the second stage to relay the Wi-Fi signal to the study room.
In the study room:
the PC 33131 and the mobile terminal 33132 are connected to the mobile terminal 3313 as application terminals for the user to work, entertain and so on in the study.
In the secondary lying:
the mobile terminal 33211 accesses the mobile terminal 3321 through the station node and starts the softAP node as a relay node of the third level to relay Wi-Fi signals to the second level.
The electronic game machine 332111, the television 332112, and the mobile terminal 332113 are connected to the mobile terminal 33111 as application terminals for the user to perform work, entertainment, and the like in the study.
In the kitchen:
the mobile terminal 3322 accesses the mobile terminal 3321 through the station node and starts the softAP node as a relay node of the third stage to relay Wi-Fi signals to the kitchen.
The intelligent refrigerator 332121, the intelligent microwave oven 332122 and the intelligent kitchen oven 332123 are used as application terminals to access the mobile terminal 33112.
Referring to fig. 4, a flowchart illustrating steps of another configuration method for relay communication according to an embodiment of the present invention is shown, and is applied to a mobile terminal, where the mobile terminal is configured with a Wi-Fi module, where the method specifically includes the following steps:
step 401, receiving, by the softAP node, a data packet sent by the application terminal and/or the relay node of the next stage.
When the application terminal communicates with a target device (such as a web server) of an external network, the data packet generated by the application terminal is transmitted step by step through the relay node until the data packet is sent to the target device.
And 402, forwarding the data packet from the softAP node to the station node.
In specific implementation, as the packet forwarding function is started, the data packet can be forwarded from the softAP node to the station node, so that forwarding of the data packet inside the relay node is realized.
Step 403, sending the data packet to the router or the relay node at the upper stage through the station node according to the communication configuration parameter.
In practical application, the data packet may be processed according to communication configuration parameters of different relay levels, so as to implement relay communication.
In one embodiment of the present invention, step 403 may include the following sub-steps:
and a substep S21, when the data packet has the uniform resource locator URL, inquiring the gateway address of the domain name system DNS.
And a substep S22, sending the data packet to the upper level router or the relay node through the station node according to the gateway address.
In the embodiment of the invention, the URL is analyzed when the application terminal accesses the webpage and the like.
If the gateway address of the DNS of the mobile terminal is the IP address of the relay node at the upper stage, the packet for resolving the URL can be forwarded to the relay node at the upper stage.
And the gateway address of the DNS of the relay node of the current level is the IP address of the relay node of the previous level, the packet for resolving the URL may be forwarded to the relay node of the previous level.
And until the D NS reaches the first-stage relay node, the gateway address of the D NS is the IP address of the router, the data packet for resolving the URL can be forwarded to the router, and the router sends the data packet to a server for providing domain name resolution for the external network and maps the URL to the IP address. In another embodiment of the present invention, step 302 may include the following sub-steps:
and a substep S23, converting the source address in the data packet from the IP address of the application terminal to the IP address of the mobile terminal when the relay level is the first level.
And a substep S24 of transmitting the packet disguised from the IP address of the mobile terminal to the router at the upper stage through the station node.
For the relay node in the first level, the source address (i.e. the IP address of the mobile terminal) in the packet, such as 192.168.49.0, may be disguised as the IP address of the mobile terminal itself, such as 0.0.0.0, based on the NAT configuration information, and forwarded to the router.
In another embodiment of the present invention, step 303 may comprise the sub-steps of:
and a substep S25, when the relay level is at or below the second level,
and sending the data packet to a relay node at the upper stage through the station node.
In the embodiment of the present invention, for the relay node at the second level or below the second level, the data packet may be directly forwarded to the relay node at the upper level.
And step 404, receiving a data packet sent by the router or the relay node at the upper stage through the station node.
When the target device of the external network communicates with the application terminal, the data packet generated by the target device is transmitted to the relay node (i.e. the mobile terminal) hop by hop until the data packet is sent to the application terminal.
Step 405, forwarding the data packet from the station node to the softAP node.
In specific implementation, as the packet forwarding function is started, the data packet can be forwarded to the softAP node from the node station, so as to implement forwarding of the data packet inside the relay node.
And step 306, sending the data packet to a next-level application terminal or a next-level relay node through the softAP node according to the communication configuration parameters.
In practical application, the data packet may be processed according to communication configuration parameters of different relay levels, so as to implement relay communication.
In one embodiment of the present invention, step 406 may include the following sub-steps:
and a substep S31, converting the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal when the relay level is the first level.
And a substep S32, when the relay level is the second level or below, inquiring a source address in the data packet to obtain the IP address of the application terminal.
And a substep S33 of querying a target path from the IP address of the mobile terminal to the IP address of the application terminal through the relay routing tables between the relay nodes at each stage.
And a substep S34, inquiring the IP address of the application terminal or the relay node of the next stage in the target path.
And a substep S35, sending the data to the next-stage application terminal or relay node by the softAP node according to the IP address of the next-stage application terminal or relay node.
For the relay node of the first stage, the second IP address of the station node from which the packet originates may be determined, and the first IP address corresponding to the second IP address is looked up in the routing table, so that the packet may be forwarded to the softAP node to which the first IP address belongs.
For the relay node in the first level, the destination address in the packet (i.e. the IP address of the mobile terminal itself), for example, 0.0.0.0, may be translated into the IP address of the application terminal, for example, 192.168.49.0, based on the configuration information of the NAT. For each stage of relay node, since a plurality of relay nodes can be connected, that is, there are a plurality of routes to the application terminal, when a data packet is sent down, the destination address in the data packet can be queried to determine the application terminal to which the data packet is sent.
And inquiring a relay routing table to obtain a target path which can be routed to the application terminal, inquiring the IP address of the next-stage mobile terminal or the relay node from the path, and forwarding the data packet to the IP address.
If the next level is the application terminal, the data packet is sent to the application terminal through the softAP node, and the application terminal performs corresponding processing, such as loading a webpage, playing a video and the like.
If the next stage is a relay node, the softAP node transmits the packet to the relay node, and the relay node can continue to perform downward relay communication.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a configuration of an antenna setting apparatus for relay communication according to an embodiment of the present invention is shown, and the apparatus is applied to a mobile terminal, where the mobile terminal is configured with a Wi-Fi module, and the apparatus may specifically include the following modules:
a relay level detection module 501, configured to detect a relay level of a relay node when a station node of the Wi-Fi module is connected to a router or a relay node of an upper level;
a relay communication configuration module 502, configured to start a softAP node of the Wi-Fi module according to the relay level and configure a relay communication parameter to connect to an application terminal and/or a relay node of a next level;
a communication type determining module 503, configured to determine a communication type of communication between the router or the relay node at the previous stage and the application terminal and/or the relay node at the next stage;
an antenna number adjusting module 504, configured to adjust the number of the transmitting antennas and the receiving antennas according to the communication type.
In an embodiment of the present invention, the communication type determining module 503 includes:
the protocol type counting submodule is used for counting the protocol type of a data packet transmitted between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage;
and the protocol type determining submodule is used for determining the protocol type as the communication type of communication between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage when the number of the data packets belonging to the protocol type exceeds a preset number threshold.
In an embodiment of the present invention, the antenna number adjusting module 504 includes:
the flow judgment submodule is used for judging whether the communication flow between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage is larger than a preset flow threshold value or not; if yes, calling a flow control submodule;
and the flow control submodule is used for adjusting the number of the transmitting antenna and the receiving antenna by adopting the communication type.
In an embodiment of the present invention, the antenna number adjusting module 504 includes:
the first setting submodule is used for setting the number of the receiving antennas to be a first number and setting the number of the transmitting antennas to be a first number when the communication type is a first type;
the first number is greater than or equal to a preset first number threshold, and the first type comprises a downloading type or an uploading type.
In an embodiment of the present invention, the antenna number adjusting module 504 includes:
the download flow judgment submodule is used for judging whether the download flow is larger than a preset download threshold value or not when the communication type is a second type; if yes, calling a second setting submodule, and if not, calling a third setting submodule;
the second setting submodule is used for setting the number of the receiving antennas to be a first number and setting the number of the transmitting antennas to be a second number;
a third setting submodule, configured to set the number of the receiving antennas to a second number, and set the number of the transmitting antennas to the second number;
wherein the first number is greater than or equal to a preset first number threshold, the second number is less than or equal to a preset second number threshold, and the first number threshold is greater than the second number threshold;
the second type includes a video browsing type.
In an embodiment of the present invention, the antenna number adjusting module 504 includes:
a fourth setting submodule, configured to set the number of the receiving antennas to a second number and set the number of the transmitting antennas to a second number when the communication type is a third type;
and the second quantity is less than or equal to a preset second quantity threshold, and the third type comprises a webpage browsing type.
In an embodiment of the present invention, the relay level detecting module 501 includes:
the default level setting submodule is used for setting the relay level of the relay node as a first level;
the relay configuration information request submodule is used for requesting relay configuration information to an upper-level router or a relay node;
the superior level extraction submodule is used for extracting the relay level of the superior relay node from the relay configuration information when the request is successful;
the current level calculation submodule is used for calculating the relay level of the relay node on the basis of the relay level of the relay node on the upper level so as to replace the first level;
and the default level determining submodule is used for determining the relay level as the relay node as the first level when the request fails.
In one embodiment of the present invention, the relay communication configuration module 502 includes:
a channel detection sub-module, configured to determine a channel of the softAP node;
the login information receiving submodule is used for receiving login information input by a user when the relay level is a first level;
the login information extraction submodule is used for extracting login information from relay configuration information of a relay node at the upper level when the relay level is at the second level or above, wherein the login information comprises a service set identifier and a password;
and the softAP node starting sub-module is used for starting the softAP node of the Wi-Fi module according to the channel, the service set identification and the password so as to broadcast the service set identification on the channel.
In one embodiment of the present invention, the relay communication configuration module 502 includes:
the packet forwarding function starting submodule is used for starting the packet forwarding function;
the address translation function setting submodule is used for setting the configuration information of the address translation function NAT when the relay level is the first level;
the IP address allocation submodule is used for allocating an IP address from the relay node of the previous stage when the relay level is the second stage or below the second stage and establishing a relay routing table between the relay nodes of each stage;
and/or the presence of a gas in the gas,
the IP address query submodule is used for querying the IP address of the router or the relay node at the upper stage;
and the domain name system DNS setting submodule is used for setting the IP address of the router or the relay node at the upper level as the gateway address of the domain name system DNS.
Referring to fig. 6, a block diagram of another antenna setting apparatus for relay communication according to an embodiment of the present invention is shown, and is applied to a mobile terminal, where the mobile terminal is configured with a Wi-Fi module, and the apparatus may specifically include the following modules:
an uplink data packet receiving module 601, configured to receive, by the softAP node, a data packet sent by a next-level application terminal and/or a relay node;
an uplink relay communication module 602, configured to forward the data packet from the softAP node to a station node;
an uplink data packet sending module 603, configured to send the data packet to a router or a relay node at an upper stage through the station node according to the communication configuration parameter.
A downlink data packet receiving module 604, configured to receive, by the station node, a data packet sent by a router or a relay node at an upper stage;
a downlink relay communication module 605 configured to forward the data packet from the station node to the softAP node;
a downlink data packet sending module 606, configured to send the data packet to a next-level application terminal or a relay node through the softAP node according to the communication configuration parameter.
In an embodiment of the present invention, the uplink data packet sending module 603 includes:
a gateway address query submodule, configured to query a gateway address of a domain name system DNS when the data packet has a uniform resource locator URL;
the gateway address sending submodule is used for sending the data packet to a router or a relay node at the upper stage through the station node according to the gateway address;
alternatively, the first and second electrodes may be,
a first IP address conversion sub-module, configured to convert, when the relay level is a first level, a source address in the data packet from an IP address of the application terminal to an IP address of the mobile terminal;
a first data packet forwarding sub-module, configured to send, through the station node, a data packet disguised as an IP address from the mobile terminal to a router at an upper level;
alternatively, the first and second electrodes may be,
and the second data packet forwarding submodule is used for sending the data packet to the relay node of the previous stage through the station node when the relay level is the second stage or below the second stage.
In an embodiment of the present invention, the downlink data packet sending module 606 includes:
a second IP address conversion sub-module, configured to convert the destination address in the data packet from the IP address of the mobile terminal to the IP address of the application terminal when the relay level is the first level;
a source address query submodule, configured to query a source address in the data packet to obtain an IP address of the application terminal when the relay level is a second level or below;
a target path query submodule, configured to query, through a relay routing table between each stage of relay nodes, a target path from the IP address of the mobile terminal to the IP address of the application terminal;
a lower address query submodule, configured to query an IP address of a next-stage application terminal or a relay node in the target path;
and the third data packet forwarding submodule is used for sending the data to the next-level application terminal or the next-level relay node through the softAP node according to the IP address of the next-level application terminal or the next-level relay node.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is made on an antenna setting method and an antenna setting device for relay communication provided by the present invention, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A method for setting an antenna for relay communication is applied to a mobile terminal, wherein the mobile terminal is provided with a Wi-Fi module, a transmitting antenna and a receiving antenna, and the method comprises the following steps:
when a station node of the Wi-Fi module is connected with a router or a relay node at the upper stage, detecting the relay level of the relay node;
starting a softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect an application terminal and/or a relay node of the next level;
determining the communication type of communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level;
adjusting the number of the transmitting antennas and the receiving antennas according to the communication type;
the step of detecting the relay level as the relay node comprises:
setting a relay level as a first level, wherein the relay level is the relay node;
requesting relay configuration information from a router or a relay node at the upper level;
when the request is successful, extracting the relay level of the relay node of the previous level from the relay configuration information;
on the basis of the relay level of the relay node at the upper stage, calculating the relay level where the relay node is located to replace the first stage;
when the request fails, determining the relay level of the relay node as a first level;
the step of starting the softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect the application terminal and/or the relay node of the next level comprises the following steps:
opening a packet forwarding function;
when the relay level is a first level, setting configuration information of an address translation function NAT;
when the relay level is the second level or below, an IP address is distributed from the relay node of the upper level, and a relay routing table between the relay nodes of all levels is established;
and/or the presence of a gas in the gas,
inquiring the IP address of the router or the relay node at the upper stage;
and setting the IP address of the router or the relay node at the upper stage as the gateway address of the Domain Name System (DNS).
2. The method according to claim 1, wherein the step of determining the communication type of the communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level comprises:
counting protocol types of data packets transmitted between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage;
and when the number of the data packets belonging to the protocol type exceeds a preset number threshold, determining that the protocol type is the communication type of communication between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage.
3. The method of claim 1, wherein the step of adjusting the number of the transmit antennas and the receive antennas according to the communication type comprises:
judging whether the communication flow between the router or the relay node at the upper stage and the application terminal and/or the relay node at the lower stage is larger than a preset flow threshold value or not; and if so, adjusting the number of the transmitting antenna and the receiving antenna by adopting the communication type.
4. The method of claim 1, 2 or 3, wherein the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type comprises:
when the communication type is a first type, setting the number of the receiving antennas to be a first number, and setting the number of the transmitting antennas to be a first number;
the first number is greater than or equal to a preset first number threshold, and the first type comprises a downloading type or an uploading type.
5. The method of claim 1, 2 or 3, wherein the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type comprises:
when the communication type is a second type, judging whether the downloaded flow is larger than a preset downloading threshold value;
if yes, setting the number of the receiving antennas to be a first number, and setting the number of the transmitting antennas to be a second number;
if not, setting the number of the receiving antennas to be a second number, and setting the number of the transmitting antennas to be the second number;
wherein the first number is greater than or equal to a preset first number threshold, the second number is less than or equal to a preset second number threshold, and the first number threshold is greater than the second number threshold;
the second type includes a video browsing type.
6. The method of claim 1, 2 or 3, wherein the step of adjusting the number of the transmitting antennas and the receiving antennas according to the communication type comprises:
when the communication type is a third type, setting the number of the receiving antennas to be a second number, and setting the number of the transmitting antennas to be a second number;
and the second quantity is less than or equal to a preset second quantity threshold, and the third type comprises a webpage browsing type.
7. The method according to claim 1, 2 or 3, wherein the step of starting the softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters to connect to the application terminal and/or the relay node of the next level comprises:
determining a channel of the softAP node;
when the relay level is a first level, receiving login information input by a user;
when the relay level is the second level or more, extracting login information from relay configuration information of a relay node of the previous level, wherein the login information comprises a service set identifier and a password;
starting a softAP node of the Wi-Fi module according to the channel, the service set identification and the password so as to broadcast the service set identification on the channel.
8. The utility model provides an antenna setting device of relay communication which characterized in that uses in mobile terminal, mobile terminal disposes Wi-Fi module, transmitting antenna and receiving antenna, the device includes:
the relay level detection module is used for detecting the relay level of the relay node when the relay node is connected with the upper-level router or the relay node through the station node of the Wi-Fi module;
the relay communication configuration module is used for starting a softAP node of the Wi-Fi module according to the relay level and configuring relay communication parameters so as to connect an application terminal and/or a relay node of the next level;
the communication type determining module is used for determining the communication type of communication between the router or the relay node at the upper level and the application terminal and/or the relay node at the lower level;
the antenna number adjusting module is used for adjusting the number of the transmitting antennas and the receiving antennas according to the communication type;
the relay level detection module comprises:
the default level setting submodule is used for setting the relay level of the relay node as a first level;
the relay configuration information request submodule is used for requesting relay configuration information to an upper-level router or a relay node;
the superior level extraction submodule is used for extracting the relay level of the superior relay node from the relay configuration information when the request is successful;
the current level calculation submodule is used for calculating the relay level of the relay node on the basis of the relay level of the relay node on the upper level so as to replace the first level;
the default level determining submodule is used for determining the relay level as the first level when the request fails;
the relay communication configuration module includes:
the packet forwarding function starting submodule is used for starting the packet forwarding function;
the address translation function setting submodule is used for setting the configuration information of the address translation function NAT when the relay level is the first level;
the IP address allocation submodule is used for allocating an IP address from the relay node of the previous stage when the relay level is the second stage or below the second stage and establishing a relay routing table between the relay nodes of each stage;
and/or the presence of a gas in the gas,
the IP address query submodule is used for querying the IP address of the router or the relay node at the upper stage;
and the domain name system DNS setting submodule is used for setting the IP address of the router or the relay node at the upper level as the gateway address of the domain name system DNS.
CN201710253633.7A 2017-04-18 2017-04-18 Antenna setting method and device for relay communication Active CN107249204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710253633.7A CN107249204B (en) 2017-04-18 2017-04-18 Antenna setting method and device for relay communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710253633.7A CN107249204B (en) 2017-04-18 2017-04-18 Antenna setting method and device for relay communication

Publications (2)

Publication Number Publication Date
CN107249204A CN107249204A (en) 2017-10-13
CN107249204B true CN107249204B (en) 2021-01-22

Family

ID=60017221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710253633.7A Active CN107249204B (en) 2017-04-18 2017-04-18 Antenna setting method and device for relay communication

Country Status (1)

Country Link
CN (1) CN107249204B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019136607A1 (en) * 2018-01-09 2019-07-18 Oppo广东移动通信有限公司 Routing method for relay and communication node
CN108989234A (en) * 2018-06-04 2018-12-11 重庆工商职业学院 Gateway of internet of things communication system
CN110691147B (en) * 2018-07-05 2021-07-27 青岛海尔空调电子有限公司 Address competition method of multi-connected control system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1981483A (en) * 2004-05-10 2007-06-13 松下电器产业株式会社 Wireless node apparatus and multihop wireless lan system
CN102137330A (en) * 2010-01-21 2011-07-27 杭州华三通信技术有限公司 Method and system for debugging radio link
CN102368851A (en) * 2011-12-02 2012-03-07 深圳市共进电子股份有限公司 Method for simply configuring wireless relay
EP2481233A2 (en) * 2009-09-21 2012-08-01 Rockstar Bidco, LP Multi-site mimo cooperation in cellular networks
CN105376357A (en) * 2015-09-30 2016-03-02 青岛海信移动通信技术股份有限公司 An antenna setting method and device for a mobile device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1981483A (en) * 2004-05-10 2007-06-13 松下电器产业株式会社 Wireless node apparatus and multihop wireless lan system
EP2481233A2 (en) * 2009-09-21 2012-08-01 Rockstar Bidco, LP Multi-site mimo cooperation in cellular networks
CN102137330A (en) * 2010-01-21 2011-07-27 杭州华三通信技术有限公司 Method and system for debugging radio link
CN102368851A (en) * 2011-12-02 2012-03-07 深圳市共进电子股份有限公司 Method for simply configuring wireless relay
CN105376357A (en) * 2015-09-30 2016-03-02 青岛海信移动通信技术股份有限公司 An antenna setting method and device for a mobile device

Also Published As

Publication number Publication date
CN107249204A (en) 2017-10-13

Similar Documents

Publication Publication Date Title
CN105376357B (en) A kind of antenna installation method and device of mobile device
CN107257561B (en) Relay communication configuration method and device
CN110831112B (en) Network connection method, intelligent household equipment, intelligent gateway and electronic equipment
CN107040302B (en) Relay communication configuration method and device
WO2023284584A1 (en) Communication method and apparatus
CN105375970B (en) A kind of method and apparatus that mobile device is relayed
CN106535238B (en) Link switching method and device
US10291695B2 (en) Method and apparatus and computer readable record media for communication on wi-fi direct multi-group network
CN105227693B (en) A kind of configuration method and device of the DNS of mobile device
CN105228213A (en) A kind of mobile device carries out the method and apparatus of relaying
CN107249204B (en) Antenna setting method and device for relay communication
EP3145161A1 (en) Automatic wireless access network configuration synchronization method and apparatus
CN107113892B (en) Method and device for automatically networking gateway equipment
CN105228150A (en) A kind of mobile device carries out the method and apparatus of relaying
CN105101466A (en) Wireless network configuration method and wireless network configuration system
CN105375969A (en) A method and a device for relaying by a mobile device
CN104202070A (en) Communication system
CN106878182B (en) Data transmission method and equipment
CN108124301A (en) A kind of connection method of wireless aps and its system
CN108174434B (en) Method, terminal and intelligent device for automatically switching communication modes
CN105120371A (en) Control method and control equipment for multicast video transmission in WLAN, and transmission system
CN103701952A (en) Downlink transmission method of business data and grouped data gateway
CN114189497A (en) Address acquisition method and device and computer-readable storage medium
JP2017022556A (en) Communication device and communication method
JP2010041259A (en) Radio base station and mobile communication method

Legal Events

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

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

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

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

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