Channel selection method, device and terminal device for WiFi hotspot
By acquiring and sorting the signal strength and connection quality of multiple channels in the terminal device, eliminating busy channels and selecting the best channel to create WiFi hotspots, the channel interference and congestion caused by using the default channel is solved, and the data transmission quality is improved.
Patent Information
- Application Number
- CN202411904118.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, terminal devices usually use default channels when creating WiFi hotspots, resulting in multiple terminal devices in the same area using the same channel, which easily causes channel interference and channel congestion, thereby reducing the quality of data transmission.
Create WiFi hotspots by obtaining the signal strength, power values and power adjustment thresholds for multiple channels, sorting and eliminating busy channels, and selecting candidate channels with high signal strength and the highest connection quality.
It effectively avoids channel interference and channel congestion, and improves the data transmission quality of terminal equipment.
Smart Images

Figure CN119789168A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of firmware security technology, and in particular, relates to a channel selection method, device and terminal device for a WiFi hotspot. Background Art
[0002] With the development of information technology, terminal devices can establish connections with other terminal devices based on communication protocols such as WiFi (Wireless Fidelity) and Bluetooth, so the space is filled with a large number of frequency band signals. There may be multiple WiFi hotspots covering the same area. When the user's terminal device enters the area and turns on in the area, it will detect the WiFi hotspots in the area and select one WiFi hotspot from multiple WiFi hotspots for connection.
[0003] At present, when creating a WiFi hotspot, a terminal device often uses a default channel according to the WiFi hotspot configuration information. This may result in a large number of terminal devices using the same channel to create WiFi hotspots in the same area, which may easily cause channel interference and channel congestion, thereby affecting the data transmission quality of the terminal device.
[0004] Currently, no effective solution has been proposed for the problem that using default channels to create WiFi hotspots in related technologies will reduce the data transmission quality of terminal devices. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, terminal device and computer program product for selecting a channel of a WiFi hotspot, so as to at least solve the problem in the related art that using a default channel to create a WiFi hotspot will reduce the data transmission quality of the terminal device.
[0006] In a first aspect, an embodiment of the present application provides a channel selection method for a WiFi hotspot, which is applied to create a WiFi hotspot for a terminal device, the method comprising: obtaining signal strength, power value and power adjustment threshold value of multiple channels; sorting the multiple channels in order from high to low according to the signal strength to obtain a first sorting result; eliminating the first channel whose power value is greater than the power adjustment threshold value from the first sorting result to obtain a second sorting result; when the second sorting result is not an empty set, selecting a preset number of candidate channels from the second sorting result in order from high to low; detecting the connection quality of each candidate channel in turn, and selecting the candidate channel with the highest connection quality to create a WiFi hotspot.
[0007] In some embodiments, after eliminating the first channel whose power value is greater than the power adjustment threshold value from the first sorting result to obtain the second sorting result, the method also includes: when the second sorting result is an empty set, selecting a preset number of channels from the first sorting result in descending order as the third sorting result; eliminating the second channel from the third sorting result to obtain multiple candidate channels, wherein the absolute value difference between the channel number of the second channel and the channel number of the channel with the highest signal strength is less than or equal to a first preset threshold; detecting the connection quality of each candidate channel in turn, and selecting the candidate channel with the highest connection quality to create a WiFi hotspot.
[0008] In some embodiments, detecting the connection quality of each candidate channel and selecting the candidate channel with the highest connection quality to create a WiFi hotspot includes: obtaining connection feature information of each candidate channel, wherein the connection feature information includes at least one of the following items: signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate; based on the connection feature information of each candidate channel, calculating the connection quality score of each candidate channel, and selecting the candidate channel with the highest connection quality score to create a WiFi hotspot.
[0009] In some embodiments, the connection feature information includes signal strength, signal-to-noise ratio, throughput, delay and packet loss rate; based on the connection feature information of each candidate channel, calculating the connection quality score of each candidate channel includes: based on the connection feature information of each candidate channel, calculating the signal strength score, signal-to-noise ratio score, throughput score, delay score and packet loss rate score of each candidate channel; performing weighted summation of the signal strength score, signal-to-noise ratio score, throughput score, delay score and packet loss rate score of each candidate channel to obtain the connection quality score of each candidate channel.
[0010] In some embodiments, sorting multiple channels in order of signal strength from high to low to obtain a first sorting result includes: adding the signal strength of each channel to a second preset threshold to obtain a corrected signal strength of each channel, wherein the minimum corrected signal strength among the corrected signal strengths of each channel is greater than or equal to zero; sorting multiple channels in order of corrected signal strength from high to low to obtain a first sorting result.
[0011] In some embodiments, after detecting the connection quality of each candidate channel and selecting the candidate channel with the highest connection quality to create a WiFi hotspot, the method also includes: obtaining environmental characteristic information of the terminal device; based on the environmental characteristic information, determining an update time interval corresponding to the terminal device; based on the update time interval, regularly changing the channel for the WiFi hotspot of the terminal device.
[0012] In some embodiments, the environmental characteristic information includes at least one of the following: area information where the terminal device is located, network load information corresponding to the area information, signal strength information of the channel of the WiFi hotspot, and network interference information corresponding to the area information.
[0013] In a second aspect, an embodiment of the present application provides a channel selection device for a WiFi hotspot, which is used to create a WiFi hotspot for a terminal device, and the device includes: an acquisition module, which is used to obtain signal strength, power value and power adjustment threshold value of multiple channels; a sorting module, which is used to sort the multiple channels in order from high to low according to the signal strength to obtain a first sorting result; a determination module, which is used to eliminate the first channel whose power value is greater than the power adjustment threshold value from the first sorting result; a selection module, which is used to select a preset number of candidate channels from the second sorting result in order from high to low when the second sorting result is not an empty set; a creation module, which is used to detect the connection quality of each candidate channel, and select the candidate channel with the highest connection quality to create a WiFi hotspot.
[0014] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the channel selection method for the WiFi hotspot of any one of the above-mentioned first aspects is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed, the channel selection method for the WiFi hotspot described in any one of the above-mentioned first aspects is executed.
[0016] Compared with the related art, the channel selection method, device, terminal device and computer program product of the WiFi hotspot provided by the embodiment of the present application sort multiple channels in order from high to low based on signal strength to obtain a first sorting result, and remove busy channels whose power values are greater than the power adjustment threshold value from the first sorting result to obtain a second sorting result. When the second sorting result is not an empty set, a preset number of candidate channels are selected from the second sorting result in order from high to low, and then the connection quality of each candidate channel is detected, and finally the candidate channel with the highest connection quality is selected to create a WiFi hotspot. In this way, when creating a WiFi hotspot, the terminal device will not use the default channel according to the WiFi hotspot configuration information, but will select the idle channel with higher signal strength and the highest connection quality to create a WiFi hotspot according to the signal strength and connection quality of the idle channel in the current network environment, thereby avoiding channel interference and channel congestion to reduce the data transmission quality of the terminal device. Through this application, the problem that using the default channel to create a WiFi hotspot in the related art will reduce the data transmission quality of the terminal device is solved, and the technical effect of improving the data transmission quality of the terminal device is achieved.
[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 is a flow chart of a method for selecting a channel of a WiFi hotspot according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for selecting a channel of a WiFi hotspot according to another embodiment of the present application;
[0021] Figure 3 It is a structural schematic diagram of a channel selection device for a WiFi hotspot according to an embodiment of the present application;
[0022] Figure 4 It is a structural diagram of a terminal device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0025] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0027] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0028] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0029] With the development of information technology, terminal devices can establish connections with other terminal devices based on communication protocols such as WiFi (Wireless Fidelity) and Bluetooth, so the space is filled with a large number of frequency band signals. There may be multiple WiFi hotspots (also called wireless access points (AP)) covering the same area. When the user's terminal device enters the area and turns on in the area, it will detect the WiFi hotspots in the area and select one WiFi hotspot from multiple WiFi hotspots for connection.
[0030] At present, when creating a WiFi hotspot, a terminal device often uses a default channel according to the WiFi hotspot configuration information. This may result in a large number of terminal devices using the same channel to create WiFi hotspots in the same area, which may easily cause channel interference and channel congestion, thereby affecting the data transmission quality of the terminal device.
[0031] For example, the working frequency band of the channel where the WiFi hotspot is located includes a working frequency band of 2.4 gigahertz (GHz) and a working frequency band of 5.0 GHz. Among them, each working frequency band corresponds to a plurality of channels pre-divided. For example, when the working frequency band is 2.4 GHz, it is generally divided into 14 channels, and the effective frequency width of each channel is 20 MHz, and each channel corresponds to a channel number (also called a channel identifier), and the channel number can be represented by a natural number. For example, the channel identifiers of the 14 channels can be represented by natural numbers 1 to 14, respectively, wherein the preset channel corresponding to the channel number 14 is generally not used.
[0032] The channel set by the terminal device in the related technology is the default channel. For example, the default channel of the 2.4GHz frequency band is 6. This will cause a large number of terminal devices to use channel 6 by default to create WiFi hotspots, resulting in too many WiFi hotspots used on channel 6. The bandwidth of the channel is fixed, which will cause channel congestion and channel interference, thereby reducing the data transmission quality of the terminal device.
[0033] Currently, no effective solution has been proposed for the problem that using default channels to create WiFi hotspots in related technologies will reduce the data transmission quality of terminal devices.
[0034] In view of this, an embodiment of the present application provides a channel selection method for a WiFi hotspot, wherein a plurality of channels are sorted in order from high to low based on signal strength to obtain a first sorting result, and busy channels whose power values are greater than a power adjustment threshold value are eliminated from the first sorting result to obtain a second sorting result. When the second sorting result is not an empty set, a preset number of candidate channels are selected from the second sorting result in order from high to low, and then the connection quality of each candidate channel is detected, and finally the candidate channel with the highest connection quality is selected to create a WiFi hotspot. In this way, when creating a WiFi hotspot, the terminal device will not use the default channel according to the WiFi hotspot configuration information, but will select an idle channel with higher signal strength and the highest connection quality to create a WiFi hotspot according to the signal strength and connection quality of the idle channel in the current network environment, thereby avoiding channel interference and channel congestion from reducing the data transmission quality of the terminal device. Through the present application, the problem that using the default channel to create a WiFi hotspot in the related art will reduce the data transmission quality of the terminal device is solved, and the technical effect of improving the data transmission quality of the terminal device is achieved.
[0035] The channel selection method of the WiFi hotspot provided in the embodiment of the present application can be applied to create a WiFi hotspot for a terminal device. Among them, the terminal device can be a mobile phone, a tablet computer, a handheld computer, a laptop computer, an ultra mobile personal computer (ultra mobile personal computer, UMPC), a netbook, and a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device, etc., which can install and use content community applications. The present application does not limit the specific implementation method of the terminal device. It can interact with the user through one or more methods such as a keyboard, a touchpad, a touch screen, a remote control, voice interaction or a handwriting device.
[0036] In specific implementation, the terminal device can use Figure 4 The composition results shown or include Figure 4 Parts shown.
[0037] The following will be combined Figure 1 The channel selection method of the WiFi hotspot provided by an embodiment of the present application is described, see Figure 1 , Figure 1 is a flow chart of a method for selecting a channel of a WiFi hotspot according to an embodiment of the present application. Figure 1 As shown, the method includes:
[0038] Step S101: Acquire signal strengths, power values, and power adjustment thresholds of multiple channels.
[0039] In this embodiment, the channel is also called a channel or a frequency band, which is a data signal transmission channel using a wireless signal as a transmission carrier; the signal strength is also called the received signal strength (RSSI), which refers to the signal strength at a certain location within the coverage of the wireless network, and is the value transmitted from the antenna end after a period of transmission path loss and obstacle attenuation.
[0040] In this embodiment, after the terminal device enters a certain area for a period of time, the terminal device can scan the WiFi hotspots in the area and the WiFi channels they use through the wireless network card. In WiFi, different channels represent different frequency ranges. For example, the WiFi 2.4GHz band has 1 to 13 (or 11, depending on the country / region) channels, and China uses 13 channels from 2.412GHz to 2.472GHz. Among them, the effective width of each channel is 20 megahertz (MHz), and there is also a mandatory isolation band of 2MHz, which is similar to the isolation band on the road. In addition to the three channels (1, 6, 11) that do not interfere with each other, there are also three groups of channels (2, 7, 12), (3, 8, 13), and (4, 9, 14) that do not interfere with each other.
[0041] In addition, the terminal device in the above embodiment can measure the signal strength received on each channel through a WiFi interface (e.g., 802.11 protocol stack). For example, the terminal device can measure all WiFi hotspots of each channel in the area and record their RSSI values. Since each WiFi hotspot broadcasts signals with a certain transmission power, the terminal device can also detect the power value and power adjustment threshold value of each channel.
[0042] Step S102: sort the multiple channels in descending order of signal strength to obtain a first sorting result.
[0043] In this embodiment, in order to avoid various problems caused by negative numbers in the subsequent data processing process, the signal strength of each channel may be added to a preset threshold so that the signal strength of each channel becomes a positive value.
[0044] Specifically, sorting the multiple channels in descending order of signal strength to obtain a first sorting result may include the following steps:
[0045] Step 1: Add the signal strength of each channel to the second preset threshold to obtain the corrected signal strength of each channel, wherein the minimum corrected signal strength among the corrected signal strengths of each channel is greater than or equal to zero.
[0046] Step 2: sort the multiple channels in descending order of correction signal strength to obtain a first sorting result.
[0047] As an example, the second preset threshold can be set to 150 decibel milliwatts (dBm), or the minimum signal strength among the signal strengths of each channel can be selected and the absolute value of the minimum signal strength can be used as the second preset threshold so that the minimum corrected signal strength among the corrected signal strengths of each channel is greater than or equal to zero.
[0048] Step S103: remove the first channel whose power value is greater than the power adjustment threshold value from the first sorting result to obtain a second sorting result.
[0049] In this embodiment, based on the power value and power adjustment threshold value of each channel obtained in step S101, it can be determined whether each channel is in an idle state. For example, if the power value of the channel is greater than the power adjustment threshold value, it can be considered that the channel is not in an idle state, and the channel can be removed from the first sorting result as the first channel; if the power value of the channel is less than the power adjustment threshold value, it can be considered that the channel is in an idle state and the channel is retained. After the power values of all channels in the first sorting result are compared with the power adjustment threshold value, the second sorting result can be obtained.
[0050] Among them, the power adjustment threshold value corresponding to each channel can be the same or different. For example, the power adjustment threshold value corresponding to each channel can be -85dBm or different values. This application does not limit the specific values of the power adjustment threshold values corresponding to different channels.
[0051] In this way, by eliminating the first channel in a non-idle state, the channels subsequently selected for creating a WiFi hotspot can all be channels in an idle state. This can prevent busy channels used by a large number of terminal devices in the area from becoming channels used by the terminal devices provided in the embodiments of the present application to create WiFi hotspots, thereby avoiding the problem of decreased data transmission quality caused by channel congestion and channel interference.
[0052] Step S104: when the second sorting result is not an empty set, select a preset number of candidate channels from the second sorting result in descending order.
[0053] In this embodiment, when the number of channels in the second sorting result is greater than zero, a preset number of candidate channels may be selected from the second sorting result in descending order. For example, when the number of channels in the second sorting result is greater than or equal to 2, the preset number may be set to 2, so that the channel with the highest signal strength and the channel with the second highest signal strength may be selected from the second sorting result as candidate channels.
[0054] It should be noted that the preset number in step S104 can be set according to user expectations and the specific number of channels in the second sorting result (the preset number is generally less than or equal to the specific number), and this application does not impose any limitation on this.
[0055] In this way, multiple channels in the second sorting result that are idle and have high signal strength can be screened out as candidate channels. When the terminal device creates a WiFi hotspot, it will not use the default channel according to the WiFi hotspot configuration information, but will select an idle channel with higher signal strength to create a WiFi hotspot based on whether the channel is idle in the current network environment and the signal strength of the channel, thereby avoiding channel interference and channel congestion that reduce the data transmission quality of the terminal device.
[0056] Step S105 , detecting the connection quality of each candidate channel, and selecting the candidate channel with the highest connection quality to create a WiFi hotspot.
[0057] In this embodiment, the terminal device can establish a connection with each candidate channel respectively, so as to test and feedback the connection quality of each candidate channel in real time. The terminal device can adjust the selection priority of the candidate channels according to the connection quality of each candidate channel, taking high signal strength, high signal-to-noise ratio, low packet loss rate, high throughput and low delay as the priority consideration factors.
[0058] Specifically, detecting the connection quality of each candidate channel and selecting the candidate channel with the highest connection quality to create a WiFi hotspot may include the following steps:
[0059] Step 1: Obtain connection feature information of each candidate channel, wherein the connection feature information includes at least one of the following items: signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate.
[0060] Step 2: Based on the connection feature information of each candidate channel, the connection quality score of each candidate channel is calculated, and the candidate channel with the highest connection quality score is selected to create a WiFi hotspot.
[0061] In this embodiment, the connection feature information includes five items: signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate. It may also include only any one of signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate, or any combination thereof.
[0062] As an example, in the case where the connection feature information includes signal strength, signal-to-noise ratio, throughput, delay and packet loss rate, calculating the connection quality score of each candidate channel based on the connection feature information of each candidate channel may include: calculating the signal strength score, signal-to-noise ratio score, throughput score, delay score and packet loss rate score of each candidate channel based on the connection feature information of each candidate channel; and performing weighted summation of the signal strength score, signal-to-noise ratio score, throughput score, delay score and packet loss rate score of each candidate channel to obtain the connection quality score of each candidate channel.
[0063] In this embodiment, the full score of the signal strength score can be determined based on the maximum signal strength in each candidate channel. For example, if the maximum signal strength in each candidate channel is (-50+150)=100dBm, then 100dBm can be used as the full score of 100 points. If the signal strength of a candidate channel is (-60+150)=90dBm, the signal strength score corresponding to the candidate channel is 90 points.
[0064] In addition, the signal-to-noise ratio score, throughput score, delay score, and packet loss rate score in the above embodiments can all be set in a similar manner to the signal strength score. For example, the full score of the signal-to-noise ratio score is determined based on the highest signal-to-noise ratio in each candidate channel; the full score of the packet loss rate score is determined based on the minimum packet loss rate in each candidate channel; the full score of the throughput score is determined based on the maximum throughput in each candidate channel; and the full score of the delay score is determined based on the minimum delay in each candidate channel.
[0065] In this way, when creating a WiFi hotspot, the terminal device will not use the default channel according to the WiFi hotspot configuration information, but will select the candidate channel with the highest connection quality to create the WiFi hotspot based on the connection quality of the screened candidate channels, thereby preventing the channel used by a large number of terminal devices in the area from becoming the channel used by the terminal devices provided in the embodiments of the present application to create a WiFi hotspot, thereby avoiding the problem of decreased data transmission quality caused by channel congestion and channel interference on the channel.
[0066] The following will be combined Figure 2 Another embodiment of the present invention provides a method for selecting a channel of a WiFi hotspot. Figure 2 , Figure 2 is a flow chart of a method for selecting a channel of a WiFi hotspot according to another embodiment of the present application. Figure 2 As shown, the method includes:
[0067] Step S201: Acquire signal strengths, power values, and power adjustment thresholds of multiple channels.
[0068] Step S202: sort the multiple channels in descending order of signal strength to obtain a first sorting result.
[0069] Step S203: remove the first channel whose power value is greater than the power adjustment threshold value from the first sorting result to obtain a second sorting result.
[0070] Step S204, determine whether the second sorting result is an empty set. If yes, proceed to step S205; if no, proceed to step S207.
[0071] Step S205 : selecting a preset number of channels from the first sorting result in descending order as a third sorting result.
[0072] Step S206: Eliminate the second channel from the third sorting result to obtain multiple candidate channels, wherein the absolute value difference between the channel number of the second channel and the channel number of the channel with the highest signal strength is less than or equal to a first preset threshold.
[0073] Step S207: Select a preset number of candidate channels from the second sorting result in descending order.
[0074] Step S208: Detect the connection quality of each candidate channel, and select the candidate channel with the highest connection quality to create a WiFi hotspot.
[0075] In this embodiment, the difference from steps S101 to S105 is that the channels in the first sorting result are all channels that are not in an idle state, that is, the number of channels in the second sorting result is zero, and the second sorting result is an empty set.
[0076] In this case, a preset number of channels may be selected from the first sorting result in descending order, thereby screening out multiple channels in the first sorting result that are not idle but have high signal strengths to obtain a third sorting result.
[0077] Then, the interference channel (ie, the second channel) is eliminated from the third sorting result, and the absolute value difference between the channel number of the second channel and the channel number of the channel with the highest signal strength is less than or equal to the first preset threshold.
[0078] As an example, assuming that the channel number of the channel with the highest signal strength is 6, and the first preset threshold is set to 4, then the second channel in the second sorting result whose absolute value difference with 6 is less than or equal to 4 can be eliminated, that is, channel 2, channel 3, channel 4, channel 5, channel 7, channel 8, channel 9, and channel 10 are eliminated, because these channels may interfere with channel 6. After eliminating them, it can be ensured that all candidate channels will not interfere with the channel with the highest signal strength, thereby avoiding mutual interference between channels as much as possible and improving the data transmission quality of the terminal device.
[0079] It should be noted that the first preset threshold can be set by oneself. For example, using 4 as the first preset threshold will result in the number of candidate channels being zero. In this case, the first preset threshold can be set smaller, for example, to 3 or 2. In addition, the preset number in step S205 can be set according to user expectations. This application does not limit the specific values of the first preset threshold and the preset number.
[0080] In addition, since the network conditions in the area where the terminal device is located may change, it is also necessary to re-evaluate the channel selection periodically or according to the network conditions to adapt to the changes in the network environment.
[0081] Specifically, after detecting the connection quality of each candidate channel and selecting the candidate channel with the highest connection quality to create a WiFi hotspot, the method further includes the following steps:
[0082] Step 1: Obtain environmental characteristic information of the terminal device.
[0083] In this embodiment, the environmental characteristic information includes at least one of the following items: area information where the terminal device is located, network load information corresponding to the area information, signal strength information of the channel of the WiFi hotspot, and network interference information corresponding to the area information.
[0084] Step 2: Determine the update time interval corresponding to the terminal device based on the environmental characteristic information.
[0085] In this embodiment, the regional information of the terminal device can reveal whether the network environment of the terminal device is stable. For example, if the regional information of the terminal device indicates that it is in an environment with a relatively stable network environment such as home or school, the update time interval can be set to a longer time, for example, it can be set to 30 minutes, 60 minutes or 120 minutes, etc.; and if the regional information of the terminal device indicates that it is in a public place (such as a supermarket, park, etc.) or office area, etc., where the network environment changes rapidly, the update time interval can be set to a shorter time, for example, it can be set to 10 minutes, 5 minutes, 2 minutes, etc.
[0086] The network load information corresponding to the area information can reveal the number of other devices connected to the network in the area where the terminal device is located; if there are many other devices connected to the network (for example, the network load information is greater than a certain threshold, and the certain threshold can be set according to the area information and user expectations, and the present application does not impose any restrictions on this), the interference between devices may increase, and therefore, it is necessary to re-evaluate the channel selection more frequently. Therefore, the update time interval can be set shorter, for example, to 15 minutes, 10 minutes, 5 minutes, etc.; if there are fewer other devices connected to the network (for example, the network load information is less than a certain threshold), the update time interval can be set longer, for example, to 30 minutes, 60 minutes or 120 minutes, etc.
[0087] The signal strength information of the channel of the WiFi hotspot can reveal the stability of the channel. If the signal strength information indicates that the signal strength of the channel is high and relatively stable (for example, the signal strength is greater than a certain threshold and the fluctuation of the signal strength is within a preset range. The certain threshold and the preset range can be set according to the regional information and user expectations, and the present application does not impose any restrictions on this), then the update time interval can be set longer, for example, set to 30 minutes, 60 minutes or 120 minutes, etc.; if the signal strength information indicates that the signal strength of the channel is low or unstable (for example, the signal strength is less than a certain threshold or the fluctuation of the signal strength is not within the preset range), it is necessary to re-evaluate the channel selection more frequently to ensure the quality of data transmission. Therefore, the update time interval can be set shorter, for example, set to 15 minutes, 10 minutes, 5 minutes, etc.
[0088] The network interference information corresponding to the area information can reveal the number of interference sources (for example, other wireless devices, electromagnetic interference, etc.) in the network in the area where the terminal device is located. If the network interference information indicates that there are fewer interference sources in the network (for example, the number of interference sources is less than a certain threshold, and the certain threshold can be set according to the area information and user expectations, and the present application does not limit this), then the update time interval can be set longer, for example, set to 30 minutes, 60 minutes or 120 minutes, etc.; if the network interference information indicates that there are more interference sources in the network (for example, the number of interference sources is greater than a certain threshold), it is necessary to re-evaluate the channel selection more frequently to ensure the quality of data transmission. Therefore, the update time interval can be set shorter, for example, set to 15 minutes, 10 minutes, 5 minutes, etc.
[0089] Step 3: Based on the update time interval, regularly change the channel of the WiFi hotspot of the terminal device.
[0090] In this embodiment, the channel of the WiFi hotspot of the terminal device can be changed regularly based on the update time interval, that is, the above steps S101 to S105 are repeated. In this way, the channel selection method of the WiFi hotspot provided in the embodiment of the present application can be improved to resist the risk of environmental changes and network interference. The WiFi hotspot created by the terminal device provided in the embodiment of the present application can timely re-evaluate the channel selection when facing network interference and network environment changes, avoiding the situation of long-term channel congestion and channel interference when the network environment changes or interference occurs.
[0091] Through the above steps S101 to S105 and S201 to S208, multiple channels are sorted in order from high to low based on signal strength to obtain a first sorting result, and busy channels with power values greater than the power adjustment threshold value are eliminated from the first sorting result to obtain a second sorting result. When the second sorting result is not an empty set, a preset number of candidate channels are selected from the second sorting result in order from high to low; or when the second sorting result is an empty set, a preset number of channels are selected from the first sorting result in order from high to low as a third sorting result, and the second channel is eliminated from the third sorting result to obtain multiple candidate channels, wherein the absolute value difference between the channel number of the second channel and the channel number of the channel with the highest signal strength is less than or equal to the first preset threshold, and then the connection quality of each candidate channel is detected, and finally the candidate channel with the highest connection quality is selected to create a WiFi hotspot. In this way, when creating a WiFi hotspot, the terminal device will not use the default channel according to the WiFi hotspot configuration information, but will select an idle channel with higher signal strength and the highest connection quality to create a WiFi hotspot according to the signal strength and connection quality of the idle channel in the current network environment, thereby avoiding channel interference and channel congestion that reduce the data transmission quality of the terminal device. Through this application, the problem that using the default channel to create a WiFi hotspot in the related art will reduce the data transmission quality of the terminal device is solved, and the technical effect of improving the data transmission quality of the terminal device is achieved.
[0092] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0093] Corresponding to the channel selection method of the WiFi hotspot described in the above embodiment, Figure 3 A schematic structural diagram of a channel selection device for a WiFi hotspot according to an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0094] See also Figure 3The channel selection device 3 of the WiFi hotspot is used to create a WiFi hotspot for a terminal device. The channel selection device 3 of the WiFi hotspot includes: an acquisition module 30, which is used to obtain the signal strength, power value and power adjustment threshold value of multiple channels; a sorting module 31, which is used to sort the multiple channels in order from high to low according to the signal strength, and obtain a first sorting result; a determination module 32, which is used to remove the first channel whose power value is greater than the power adjustment threshold value from the first sorting result, and obtain a second sorting result; a selection module 33, which is used to select a preset number of candidate channels from the second sorting result in order from high to low when the second sorting result is not an empty set; a creation module 34, which is used to detect the connection quality of each candidate channel, and select the candidate channel with the highest connection quality to create a WiFi hotspot.
[0095] In one embodiment, the selection module 33 is also used to select a preset number of channels from the first sorting result in descending order as the third sorting result when the second sorting result is an empty set; eliminate the second channel from the third sorting result to obtain multiple candidate channels, wherein the absolute value difference between the channel number of the second channel and the channel number of the channel with the highest signal strength is less than or equal to a first preset threshold; detect the connection quality of each candidate channel, and select the candidate channel with the highest connection quality to create a WiFi hotspot.
[0096] In one embodiment, the creation module 34 is also used to obtain connection feature information of each candidate channel, wherein the connection feature information includes at least one of the following items: signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate; based on the connection feature information of each candidate channel, a connection quality score of each candidate channel is calculated, and the candidate channel with the highest connection quality score is selected to create a WiFi hotspot.
[0097] In one embodiment, the connection feature information includes signal strength, signal-to-noise ratio, throughput, delay and packet loss rate; the creation module 34 is also used to calculate the signal strength score, signal-to-noise ratio score, throughput score, delay score and packet loss rate score of each candidate channel based on the connection feature information of each candidate channel; and perform weighted summation of the signal strength score, signal-to-noise ratio score, throughput score, delay score and packet loss rate score of each candidate channel to obtain a connection quality score for each candidate channel.
[0098] In one embodiment, the sorting module 31 is also used to add the signal strength of each channel to a second preset threshold to obtain the corrected signal strength of each channel, wherein the minimum corrected signal strength among the corrected signal strengths of each channel is greater than or equal to zero; and sort the multiple channels in descending order of the corrected signal strength to obtain a first sorting result.
[0099] In one embodiment, the channel selection device 3 of the WiFi hotspot also includes an update module, which is used to obtain environmental characteristic information of the terminal device; based on the environmental characteristic information, determine the update time interval corresponding to the terminal device; based on the update time interval, regularly change the channel of the WiFi hotspot of the terminal device.
[0100] In one embodiment, the environmental characteristic information includes at least one of the following: area information where the terminal device is located, network load information corresponding to the area information, signal strength information of the channel of the WiFi hotspot, and network interference information corresponding to the area information.
[0101] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0102] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0103] Figure 4 is a schematic diagram of the structure of a terminal device according to an embodiment of the present application. Figure 4 As shown, the terminal device 4 includes: at least one processor 40 ( Figure 4 Only one is shown in the figure) a processor, a memory 41, and a computer program 42 stored in the memory 41 and executable on at least one processor 40. When the processor 40 executes the computer program 42, the steps in the above-mentioned channel selection method embodiment of any WiFi hotspot are implemented.
[0104] The terminal device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 4 may include but is not limited to a processor 40 and a memory 41. It is understood by those skilled in the art that Figure 4It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0105] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0106] In some embodiments, the memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 4. In other embodiments, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program 42. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0107] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the channel selection method embodiments of the above-mentioned various WiFi hotspots can be implemented.
[0108] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal implements the steps in the channel selection method embodiments of the above-mentioned various WiFi hotspots when executing the computer program product.
[0109] The present application implements all or part of the processes in the above-mentioned embodiment method, and can instruct the relevant hardware to complete through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0111] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for selecting a channel of a WiFi hotspot, characterized in that: Applied to creating a WiFi hotspot for a terminal device, the method comprises: Obtain signal strength, power value and power adjustment threshold value of multiple channels; Sorting the multiple channels in descending order of signal strength to obtain a first sorting result; Eliminate the first channel whose power value is greater than the power adjustment threshold value from the first sorting result to obtain a second sorting result; When the second sorting result is not an empty set, selecting a preset number of candidate channels from the second sorting result in descending order; The connection quality of each candidate channel is detected, and the candidate channel with the highest connection quality is selected to create the WiFi hotspot.
2. The method according to claim 1, characterized in that After removing the first channel whose power value is greater than the power adjustment threshold value from the first sorting result to obtain a second sorting result, the method further includes: When the second sorting result is an empty set, selecting a preset number of channels from the first sorting result in descending order as a third sorting result; Eliminate the second channel from the third sorting result to obtain multiple candidate channels, wherein the absolute value difference between the channel number of the second channel and the channel number of the channel with the highest signal strength is less than or equal to a first preset threshold; The connection quality of each candidate channel is detected, and the candidate channel with the highest connection quality is selected to create the WiFi hotspot.
3. The method according to claim 1 or 2, characterized in that: Detecting the connection quality of each candidate channel and selecting the candidate channel with the highest connection quality to create the WiFi hotspot includes: Acquire connection characteristic information of each candidate channel, wherein the connection characteristic information includes at least one of the following items: signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate; Based on the connection feature information of each candidate channel, a connection quality score of each candidate channel is calculated, and the candidate channel with the highest connection quality score is selected to create the WiFi hotspot.
4. The method according to claim 3, characterized in that The connection feature information includes signal strength, signal-to-noise ratio, throughput, delay, and packet loss rate; based on the connection feature information of each candidate channel, the connection quality score of each candidate channel is calculated, including: Based on the connection feature information of each candidate channel, a signal strength score, a signal-to-noise ratio score, a throughput score, a delay score, and a packet loss rate score of each candidate channel are calculated; The signal strength score, the signal-to-noise ratio score, the throughput score, the delay score, and the packet loss rate score of each candidate channel are weightedly summed to obtain the connection quality score of each candidate channel.
5. The method according to claim 1 or 2, characterized in that: Sorting the multiple channels in descending order of the signal strength to obtain a first sorting result includes: Adding the signal strength of each of the channels to a second preset threshold value to obtain a corrected signal strength of each of the channels, wherein a minimum corrected signal strength among the corrected signal strengths of each of the channels is greater than or equal to zero; The multiple channels are sorted in descending order of the correction signal strength to obtain the first sorting result.
6. The method according to claim 1 or 2, characterized in that: After detecting the connection quality of each candidate channel and selecting the candidate channel with the highest connection quality to create the WiFi hotspot, the method further includes: Acquiring environmental characteristic information of the terminal device; Based on the environmental characteristic information, determining an update time interval corresponding to the terminal device; Based on the update time interval, the channel of the WiFi hotspot of the terminal device is changed regularly.
7. The method according to claim 6, characterized in that The environmental characteristic information includes at least one of the following items: area information where the terminal device is located, network load information corresponding to the area information, signal strength information of the channel of the WiFi hotspot, and network interference information corresponding to the area information.
8. A channel selection device for a WiFi hotspot, characterized in that: Applicable to creating a WiFi hotspot for a terminal device, the device comprises: An acquisition module, used to acquire signal strength, power value and power adjustment threshold value of multiple channels; A sorting module, used to sort the multiple channels in descending order of the signal strength to obtain a first sorting result; A determination module, configured to remove the first channel whose power value is greater than the power adjustment threshold value from the first sorting result, to obtain a second sorting result; A selection module, configured to select a preset number of candidate channels from the second sorting result in a descending order when the second sorting result is not an empty set; The creation module is used to detect the connection quality of each candidate channel in turn, and select the candidate channel with the highest connection quality to create the WiFi hotspot.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the channel selection method for the WiFi hotspot according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that The invention comprises a computer program, and when the computer program is executed, the channel selection method for the WiFi hotspot according to any one of claims 1 to 7 is executed.