Channel switching method and device, electronic equipment and storage medium
By scanning the surrounding network environment on the target device, calculating the channel interference degree and automatically switching to the channel with the least interference degree, the problems of inaccurate and low efficiency in the prior art are solved, and more efficient and accurate channel switching is achieved.
Patent Information
- Application Number
- CN202411925872.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, channel handover has problems of inaccuracy and low efficiency, and an automated channel handover method is needed to improve the accuracy and efficiency of channel handover.
When the target device operates on the first channel, the channel information of multiple channels is determined by scanning the surrounding network environment, and the degree of interference of each channel is calculated based on these channel information. Then, the channel with the least interference degree is selected from the multiple channels as the second channel and automatically switches to the channel for operation.
Through the automated channel switching method, the inaccuracy and inefficiency of manual switching are avoided, the accuracy and efficiency of channel switching are improved, and the target device can operate under the optimal channel.
Smart Images

Figure CN119603731A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a channel switching method, device, electronic device and storage medium. Background Art
[0002] In order to improve the wireless network performance of the device, the device is usually set to the best channel. At present, when setting the channel of the device, the wifi module in the device is usually used to scan the surrounding network environment of the device to obtain the channel information of each channel in the surrounding network environment, and then the obtained channel information of each channel is displayed in the device. After the channel information of each channel is displayed in the device, the user can switch the channel based on the information displayed in the device, so that the device works in the best channel. However, the above-mentioned channel switching method is implemented manually, so that the channel switching has the problems of inaccurate channel switching and low efficiency. Summary of the invention
[0003] The present application provides a channel switching method, device, electronic device and storage medium to solve the problems of inaccurate channel switching and low efficiency in the prior art.
[0004] In a first aspect, the present application provides a channel switching method, comprising:
[0005] When the target device operates on the first channel, determining channel information corresponding to a plurality of channels in a network environment around the target device;
[0006] For each of the channels, determining a first interference degree corresponding to the channel according to the channel information corresponding to the channel, where the first interference degree represents an interference degree of the channel to the wireless network of the target device;
[0007] determining a second channel from the plurality of channels according to the first interference levels corresponding to the plurality of channels, the second channel being used for channel switching of the target device;
[0008] The target device is switched from the first channel to the second channel to operate.
[0009] In an optional implementation, the channel information includes access point information corresponding to each wireless access point in the channel;
[0010] The determining, according to the channel information corresponding to the channel, a first interference degree corresponding to the channel includes:
[0011] For each of the wireless access points in the channel, determining a second interference level corresponding to the wireless access point according to access point information corresponding to the wireless access point, where the second interference level represents an interference level of the wireless access point to the wireless network of the target device;
[0012] A first interference level corresponding to the channel is determined according to the second interference levels corresponding to all the wireless access points in the channel.
[0013] In an optional implementation, the access point information includes the signal strength of the wireless access point;
[0014] Determining, according to the access point information corresponding to the wireless access point, a second interference level corresponding to the wireless access point, includes:
[0015] Obtaining a preset signal strength threshold, where the preset signal strength threshold is an absolute value of a minimum signal strength corresponding to the wireless access point;
[0016] Determine a sum of the preset signal strength threshold and the signal strength of the wireless access point corresponding to the wireless access point to obtain the second interference level corresponding to the wireless access point;
[0017] Determining the first interference level corresponding to the channel according to the second interference levels corresponding to all the wireless access points in the channel includes:
[0018] Determine a sum value of the second interference levels corresponding to all the wireless access points in the channel to obtain a second interference level sum value;
[0019] The second interference level and value are determined as the first interference level corresponding to the channel.
[0020] In an optional implementation, determining the second channel from the plurality of channels according to the first interference levels corresponding to the plurality of channels includes:
[0021] For each of the channels, perform the following operations:
[0022] Determine at least one third channel corresponding to the channel from the plurality of channels, wherein the third channel is a channel adjacent to the channel;
[0023] Determine a sum of the first interference levels corresponding to all the third channels to obtain a first interference level sum value;
[0024] Determining a target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value;
[0025] A second channel is determined from the multiple channels according to the target interference levels corresponding to the multiple channels.
[0026] In an optional implementation, determining a target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value includes:
[0027] Determine a target weight corresponding to the channel, where the target weight represents a degree of interference of at least one third channel corresponding to the channel to the channel;
[0028] Using the target weight to adjust the first interference degree and value to obtain an adjusted first interference degree and value;
[0029] A sum value between the first interference level and the first interference level sum value is determined to obtain a target interference level corresponding to the channel.
[0030] In an optional implementation, determining the second channel from the plurality of channels according to the target interference levels corresponding to the plurality of channels includes:
[0031] Sorting the target interference levels corresponding to the plurality of channels in order from small to large according to the target interference levels, so as to obtain a target sorting result;
[0032] Determine the channel that is at the first place from the target sorting results;
[0033] The channel that is at the first position in the target sorting result is determined as the second channel.
[0034] In an optional implementation, the determining channel information corresponding to a plurality of channels in the network environment around the target device includes:
[0035] When the target device operates on the first channel, scanning each wireless access point in the network environment around the target device to obtain access point information corresponding to each wireless access point;
[0036] Classifying all the wireless access points in the same channel into one category according to the access point information corresponding to all the wireless access points, so as to obtain multiple classification results;
[0037] For each of the classification results, the access point information corresponding to all the wireless access points in the classification result is determined as the channel information corresponding to the channel in the classification result, so as to obtain the channel information corresponding to a plurality of the channels.
[0038] In a second aspect, the present application provides a channel switching device, comprising:
[0039] An information determination module, used to determine channel information corresponding to a plurality of channels in a network environment around the target device when the target device operates on a first channel;
[0040] An interference level determination module, configured to determine, for each of the channels, a first interference level corresponding to the channel according to the channel information corresponding to the channel, wherein the first interference level represents a level of interference of the channel to the wireless network of the target device;
[0041] a channel determination module, configured to determine a second channel from the plurality of channels according to the first interference levels corresponding to the plurality of channels, wherein the second channel is used for channel switching of the target device;
[0042] The switching module is used to switch the target device from the first channel to the second channel for operation.
[0043] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is used to execute a channel switching program stored in the memory to implement the channel switching method described above.
[0044] In a fourth aspect, the present application provides a storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the channel switching method as described above.
[0045] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art. The channel switching method provided by the embodiment of the present application includes: when the target device works on the first channel, determining the channel information corresponding to multiple channels in the network environment around the target device; for each channel, determining the first interference degree corresponding to the channel according to the channel information corresponding to the channel, the first interference degree characterizes the interference degree of the channel to the wireless network of the target device; according to the first interference degree corresponding to the multiple channels, determining the second channel from the multiple channels, the second channel is used for the channel switching of the target device; switching the target device from the first channel to the second channel for operation. In the above manner, when the target device works on the first channel, the present application determines the interference degree of each channel to the wireless network of the target device through the channel information corresponding to the multiple channels in the environment around the target device, thereby determining the best second channel from the multiple channels according to the interference degrees determined, and then automatically switching the target device to the second channel for operation, avoiding the problem of inaccurate and low efficiency of channel switching when manually switching the second channel, and improving the accuracy and efficiency of channel switching. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0049] Figure 1 A schematic diagram of a flow chart of a channel switching method provided in an embodiment of the present application;
[0050] Figure 2 A schematic flow chart of another channel switching method provided in an embodiment of the present application;
[0051] Figure 3 A schematic flow chart of another channel switching method provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of adjacent channel interference with a 20M bandwidth provided in an embodiment of the present application;
[0053] Figure 5 A schematic diagram of the structure of a channel switching device provided in an embodiment of the present application;
[0054] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0055] In the above attached figure:
[0056] 501, information determination module; 502, interference level determination module; 503, channel determination module; 504, switching module;
[0057] 600, electronic device; 601, processor; 602, memory; 6021, operating system; 6022, application; 603, user interface; 604, network interface; 605, bus system. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0059] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0060] refer to Figure 1 , Figure 1 A schematic flow chart of a channel switching method provided in an embodiment of the present application. A channel switching method provided in this embodiment includes the following steps:
[0061] S101: When a target device operates on a first channel, channel information corresponding to a plurality of channels in a network environment around the target device is determined.
[0062] In this embodiment, the target device may be a router, and the specific form of the target device may be selected according to actual needs. The specific form of the target device is not limited in this embodiment. Since there are multiple channels in the network environment around the target environment, if the channel on which the target device works is not good, it will affect the wireless network of the subsequent target device. Therefore, in order to avoid the above problem, the traditional method can switch the channel of the target device based on the channel information of each channel displayed by the target device, so that the target device works on the best channel. However, the above-mentioned manual channel switching has the problem of inaccurate channel switching and low efficiency. Therefore, in order to solve the above problem, when the target device works on the first channel, the channel information corresponding to multiple channels in the network environment around the target device is determined, so that the best channel is automatically determined from the multiple channels according to the channel information corresponding to the multiple channels in the network environment around the target device, and then the channel of the target device is automatically switched, so that the target device works on the determined best channel, which not only improves the accuracy of channel switching, but also improves the efficiency of channel switching.
[0063] The first channel is the channel on which the current target device is working. The channel information corresponding to each channel is composed of access point information corresponding to each wireless access point (AP) in the channel. The access point information may include the signal strength of the wireless access point, the channel where the wireless access point is located, and the channel adjacent to the channel where the wireless access point is located.
[0064] S102: For each channel, determine a first interference degree corresponding to the channel according to channel information corresponding to the channel.
[0065] In this embodiment, the first interference degree represents the interference degree of the channel to the wireless network of the target device. After obtaining the channel information corresponding to multiple channels in the network environment around the target device, for each channel, the first interference degree corresponding to the channel can be determined according to each access point information in the channel information corresponding to the channel, so as to switch the channel of the target device by using the determined first interference degree corresponding to each channel, so as to switch the first channel to the determined channel, so that the target device works on the determined channel.
[0066] S103: Determine a second channel from the multiple channels according to the first interference levels corresponding to the multiple channels.
[0067] In this embodiment, the second channel is used for channel switching of the target device. After obtaining the first interference levels corresponding to multiple channels in the network environment around the target device, a channel with the least interference to the wireless network of the target device can be selected from the multiple first interference levels determined, and the determined channel can be determined as the best channel (i.e., the second channel), so that when the target device is switched to the second channel for operation, the interference to the wireless network of the target device can be minimized, thereby improving the performance of the wireless network of the target device and improving the user experience.
[0068] S104: Switch the target device from the first channel to the second channel to operate.
[0069] In this embodiment, if the determined second channel is the same as the first channel, the target device does not need to be switched to the second channel, and the target device can continue to work on the first channel. If the determined second channel is different from the first channel, the first channel needs to be switched to the second channel so that the target device works on the second channel, thereby ensuring the performance of the wireless network of the target device, not only improving the accuracy of channel switching, but also improving the efficiency of channel switching.
[0070] The present embodiment provides a channel switching method. When a target device is operating on a first channel, the interference degree of each channel to the wireless network of the target device is determined by channel information corresponding to multiple channels in the surrounding environment of the target device, so as to determine the best second channel from the multiple channels according to the determined interference degrees, and then automatically switch the target device to the second channel for operation, thereby avoiding the problems of inaccurate and low efficiency of channel switching when manually switching the second channel, and improving the accuracy and efficiency of channel switching.
[0071] refer to Figure 2 , Figure 2 A schematic flow chart of another channel switching method provided in this embodiment. A channel switching method provided in this embodiment includes the following steps:
[0072] S201: When the target device operates on a first channel, channel information corresponding to a plurality of channels in a network environment around the target device is determined.
[0073] In this embodiment, determining the channel information corresponding to multiple channels in the network environment around the target device in step S201 includes:
[0074] When the target device is operating on the first channel, each wireless access point in the network environment around the target device is scanned to obtain access point information corresponding to each wireless access point;
[0075] Classifying all wireless access points in the same channel into one category according to access point information corresponding to all wireless access points, so as to obtain multiple classification results;
[0076] For each classification result, the access point information corresponding to all wireless access points in the classification result is determined as the channel information corresponding to the channel in the classification result, so as to obtain the channel information corresponding to the plurality of channels.
[0077] Among them, in order to make the target device work in the best channel in the network environment around the target to ensure the performance of the wireless network of the target device, when the target device works in the first channel, the wifi module set in the target device can be used to scan the various wireless access points in the network environment around the target device in real time, so as to obtain the access point information corresponding to each wireless access point. The access point information can refer to the above description, which is not repeated in this embodiment. The scanning of various wireless access points in the network environment around the target device by the wifi module can refer to the existing technology, which is not repeated in this embodiment.
[0078] Specifically, after obtaining access point information corresponding to each wireless access point in the network environment around the target device, all wireless access points in the network environment around the target device can be classified based on the channel where the wireless access point in each access point information is located, so as to classify all wireless access points in the same channel into one category, thereby obtaining multiple classification results. Among them, all wireless access points in each classification result are in the same channel. After obtaining multiple classification results, for each classification result, the access point information corresponding to all wireless access points in the classification result can be determined as the channel information corresponding to the channel in the classification result, thereby obtaining channel information corresponding to multiple channels in the network environment around the target device.
[0079] S202: performing the following operations for each channel: for each wireless access point in the channel, determining a second interference degree corresponding to the wireless access point according to access point information corresponding to the wireless access point.
[0080] S203: Determine a first interference level corresponding to the channel according to second interference levels corresponding to all wireless access points in the channel.
[0081] With respect to the above-mentioned steps S202 and S203, the second interference degree characterizes the interference degree of the wireless access point to the wireless network of the target device. After obtaining the channel information corresponding to multiple channels in the network environment around the target device, for each channel, the second interference degree corresponding to each channel can be determined according to the access point information corresponding to each wireless access point in the channel, so as to determine the first interference degree corresponding to the channel by using the second interference degree corresponding to all wireless access points in the channel, and then use the determined first interference degree corresponding to each channel to switch the channel of the target device, so as to switch the first channel to the determined channel, so that the target device works on the determined channel.
[0082] In this embodiment, determining the second interference level corresponding to the wireless access point according to the access point information corresponding to the wireless access point in step S202 includes:
[0083] Get the preset signal strength threshold;
[0084] A sum of a preset signal strength threshold and a signal strength of a wireless access point corresponding to the wireless access point is determined to obtain a second interference degree corresponding to the wireless access point.
[0085] The access point information includes the signal strength of the wireless access point. The preset signal strength threshold is the absolute value of the minimum signal strength corresponding to the wireless access point. For example, the signal strength of the wireless access point is usually -1 to -100, so the preset signal strength threshold is 100, and the sum of the preset signal strength threshold and the signal strength of the wireless access point corresponding to the wireless access point is used to obtain the second interference level corresponding to the wireless access point. After obtaining the second interference level corresponding to each wireless access point in the channel, the second interference level corresponding to all wireless access points in the channel can be calculated to obtain the first interference level corresponding to the channel.
[0086] The second interference level corresponding to the wireless access point in the above description can be expressed by the following formula:
[0087] D AP =100+RSSI
[0088] In the above formula, D AP represents the second interference level corresponding to the wireless access point, 100 represents the preset signal strength threshold, and RSSI represents the signal strength of the wireless access point.
[0089] Specifically, determining the first interference level corresponding to the channel according to the second interference levels corresponding to all wireless access points in the channel in step S203 includes:
[0090] Determine a sum value of second interference levels corresponding to all wireless access points in the channel to obtain a second interference level sum value;
[0091] The second interference level and value are determined as the first interference level corresponding to the channel.
[0092] Among them, after obtaining the second interference levels corresponding to all wireless access points in the channel, the sum of the second interference levels corresponding to all wireless access points in the channel can be calculated to determine the determined sum as the first interference level corresponding to the channel, so as to use the first interference level corresponding to the channel to characterize the interference level of the channel to the wireless network of the target device, and then according to the interference level of each channel in the network environment around the target device to the wireless network of the target device, the best channel is selected from all channels in the network environment around the target device, so as to switch the target device to the best channel to work, so as to ensure the performance of the wireless network of the target device.
[0093] The first interference degree mentioned above can be expressed by the following formula:
[0094]
[0095] In the above formula, D1 represents the first interference level, D APirepresents the second interference level corresponding to the i-th wireless access point in the channel, and n represents the number of all wireless access points in the channel.
[0096] S204: Determine a second channel from the multiple channels according to the first interference levels corresponding to the multiple channels.
[0097] In this embodiment, after obtaining the first interference levels corresponding to the multiple channels, the channel corresponding to the minimum first interference level can be determined from the multiple channels according to the multiple first interference levels, and the channel corresponding to the minimum first interference level can be determined as the second channel. Since the channels adjacent to the channel will also affect the calculation of the interference level of the channel to the wireless network of the target device, the step S204 in this embodiment determines the second channel from the multiple channels according to the first interference levels corresponding to the multiple channels, including:
[0098] For each channel, perform the following operations:
[0099] determining at least one third channel corresponding to the channel from the plurality of channels;
[0100] Determine the sum of the first interference levels corresponding to all the second channels to obtain a first interference level sum value;
[0101] Determining a target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value;
[0102] A second channel is determined from the multiple channels according to target interference levels corresponding to the multiple channels.
[0103] The third channel is a channel adjacent to the channel. Figure 4 As shown in the figure, there is a 20M wireless access point on channel 6, and channel 5 and channel 7 are adjacent channels of channel 6. Among them, the channels connected to the channel can be obtained by scanning the wireless access point, that is, the access point information corresponding to the wireless access point includes the channel where the wireless access point is located and the channels adjacent to the channel.
[0104] Specifically, after obtaining the first interference degree corresponding to each channel in the network environment around the target device, for each channel in the network around the target device, at least one third channel adjacent to the channel can be determined from multiple channels in the network environment around the target device according to the access point information corresponding to each wireless access point in the channel, so as to sum the first interference degrees corresponding to the determined third channels to obtain the first interference degree sum value, and then comprehensively determine the target interference degree corresponding to the channel according to the first interference degree corresponding to the channel and the first interference degree sum value, so as to use the target interference degree to characterize the interference effect of the channel on the wireless network of the target device, and then use the target interference degrees corresponding to multiple channels in the network environment around the target device to more accurately determine the best second channel from multiple channels, and then switch the target device to the second channel to operate.
[0105] In the above, determining the target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value includes:
[0106] Determine the target weight corresponding to the channel;
[0107] Using the target weight to adjust the first interference degree and value to obtain an adjusted first interference degree and value;
[0108] A sum value between the first interference level and the first interference level sum value is determined to obtain a target interference level corresponding to the channel.
[0109] Among them, the target weight characterizes the degree of interference of at least one third channel corresponding to the channel to the channel. The target weights corresponding to different channels can be set according to actual needs, and the specific values of the target weights corresponding to different channels are not limited in this embodiment. When determining the target interference degree, the correspondence between different channels and weights can be pre-set, so that based on the channel, the above correspondence is queried to obtain the target weight corresponding to the channel. In obtaining the target weight, the product between the target weight and the first interference degree and value can be determined, and the product is used as the adjusted first interference degree and value, so as to sum the first interference degree and the first interference degree and value to obtain the final target interference degree corresponding to the channel.
[0110] Specifically, the target interference level corresponding to the channel can be determined by the following formula:
[0111]
[0112] In the above formula, D T represents the target interference level corresponding to the channel, D1 represents the first interference level corresponding to the channel, and D jrepresents the third channel adjacent to the j-th channel, m represents the number of third channels adjacent to the channel, and v represents the target weight corresponding to the channel.
[0113] In the above, determining the second channel from the multiple channels according to the target interference levels corresponding to the multiple channels includes:
[0114] Sorting the target interference levels corresponding to the multiple channels in order from small to large, so as to obtain a target sorting result;
[0115] Determine the channel that ranks first from the target ranking results;
[0116] The channel that is ranked first in the target sorting result is determined as the second channel.
[0117] Among them, in order to determine the channel with the least interference effect on the wireless network of the target device from multiple channels in the network environment around the target device, the target interference degrees corresponding to the multiple channels are sorted in order from small to large, so as to obtain a target sorting result. The target interference degree corresponding to the channel ranked first in the target sorting result is the smallest, and the interference effect of this channel on the wireless network of the target device is the smallest. Therefore, the channel ranked first in the target sorting result is determined as the second channel to be switched by the target device, thereby ensuring the performance of the wireless network of the subsequent target device.
[0118] S205: Switch the target device from the first channel to the second channel to operate.
[0119] In this embodiment, step S205 is consistent with the above-mentioned step S104. For details, please refer to the above-mentioned step S104, and this embodiment will not be described in detail here.
[0120] The present embodiment provides a channel switching method. When a target device is operating on a first channel, the interference degree of each channel to the wireless network of the target device is determined by channel information corresponding to multiple channels in the surrounding environment of the target device, so as to determine the best second channel from the multiple channels according to the determined interference degrees, and then automatically switch the target device to the second channel for operation, thereby avoiding the problems of inaccurate and low efficiency of channel switching when manually switching the second channel, and improving the accuracy and efficiency of channel switching.
[0121] As an example, refer to Figure 4 , let's introduce the whole channel switching process in detail, as follows:
[0122] When the device works on the first channel, each wireless access point in the network environment around the device is scanned to obtain access point information corresponding to each wireless access point;
[0123] Channel-dividing all wireless access points according to access point information corresponding to all wireless access points, so as to obtain channel information corresponding to each channel in the network environment around the target device;
[0124] For each channel, determining a first interference degree corresponding to the channel according to signal strengths of wireless access points corresponding to each wireless access point in the channel information corresponding to the channel;
[0125] For each channel, determining at least one third channel adjacent to the channel from the plurality of channels;
[0126] Determine the sum of the first interference levels corresponding to all third channels to obtain a first interference level sum value;
[0127] Determining a target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value;
[0128] Sorting the target interference levels corresponding to the multiple channels in order from small to large, so as to obtain a target sorting result;
[0129] Determine the channel that ranks first from the target ranking results;
[0130] Determine the channel that is ranked first in the target sorting result as the second channel;
[0131] Switch the device from the first channel to the second channel for operation.
[0132] refer to Figure 5 , Figure 5 A schematic diagram of the structure of a channel switching device provided in an embodiment of the present application. A channel switching device provided in an embodiment of the present application includes: an information determination module 501, an interference degree determination module 502, a channel determination module 503 and a switching module 504. Among them, the information determination module 501 is used to determine the channel information corresponding to multiple channels in the network environment around the target device when the target device is working in the first channel; the interference degree determination module 502 is used to determine, for each of the channels, the first interference degree corresponding to the channel according to the channel information corresponding to the channel, the first interference degree characterizing the interference degree of the channel to the wireless network of the target device; the channel determination module 503 is used to determine a second channel from a plurality of the channels according to the first interference degrees corresponding to the plurality of the channels, the second channel being used for channel switching of the target device; the switching module 504 is used to switch the target device from the first channel to the second channel for operation.
[0133] In this embodiment, the channel information includes access point information corresponding to each wireless access point in the channel; the interference level determination module 502 is further used to:
[0134] For each of the wireless access points in the channel, determining a second interference level corresponding to the wireless access point according to access point information corresponding to the wireless access point, where the second interference level represents an interference level of the wireless access point to the wireless network of the target device;
[0135] A first interference level corresponding to the channel is determined according to the second interference levels corresponding to all the wireless access points in the channel.
[0136] In this embodiment, the access point information includes the signal strength of the wireless access point; the interference level determination module 502 is further used to:
[0137] Obtaining a preset signal strength threshold, where the preset signal strength threshold is an absolute value of a minimum signal strength corresponding to the wireless access point;
[0138] A sum of the preset signal strength threshold and the signal strength of the wireless access point corresponding to the wireless access point is determined to obtain the second interference level corresponding to the wireless access point.
[0139] In this embodiment, the interference level determination module 502 is further configured to:
[0140] Determine a sum value of the second interference levels corresponding to all the wireless access points in the channel to obtain a second interference level sum value;
[0141] The second interference level and value are determined as the first interference level corresponding to the channel.
[0142] In this embodiment, the channel determination module 503 is further configured to:
[0143] For each of the channels, perform the following operations:
[0144] Determine at least one third channel corresponding to the channel from the plurality of channels, wherein the third channel is a channel adjacent to the channel;
[0145] Determine a sum of the first interference levels corresponding to all the third channels to obtain a first interference level sum value;
[0146] Determining a target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value;
[0147] A second channel is determined from the multiple channels according to the target interference levels corresponding to the multiple channels.
[0148] In this embodiment, the channel determination module 503 is further configured to:
[0149] Determine a target weight corresponding to the channel, where the target weight represents a degree of interference of at least one third channel corresponding to the channel to the channel;
[0150] Using the target weight to adjust the first interference degree and value to obtain an adjusted first interference degree and value;
[0151] A sum value between the first interference level and the first interference level sum value is determined to obtain a target interference level corresponding to the channel.
[0152] In this embodiment, the channel determination module 503 is further configured to:
[0153] Sorting the target interference levels corresponding to the plurality of channels in order from small to large according to the target interference levels, so as to obtain a target sorting result;
[0154] Determine the channel that is at the first place from the target sorting results;
[0155] The channel that is at the first position in the target sorting result is determined as the second channel. In this embodiment, the information determination module is also used for:
[0156] When the target device operates on the first channel, scanning each wireless access point in the network environment around the target device to obtain access point information corresponding to each wireless access point;
[0157] Classifying all the wireless access points in the same channel into one category according to the access point information corresponding to all the wireless access points, so as to obtain multiple classification results;
[0158] For each of the classification results, the access point information corresponding to all the wireless access points in the classification result is determined as the channel information corresponding to the channel in the classification result, so as to obtain the channel information corresponding to a plurality of the channels.
[0159] The present embodiment provides a channel switching device, which, when a target device is operating on a first channel, determines the interference degree of each channel to the wireless network of the target device through the channel information corresponding to multiple channels in the surrounding environment of the target device, thereby determining the best second channel from the multiple channels according to the determined interference degrees, and then automatically switching the target device to the second channel for operation, thereby avoiding the problems of inaccurate and low efficiency of channel switching when manually switching the second channel, and improving the accuracy and efficiency of channel switching.
[0160] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 6 The electronic device 600 shown includes: at least one processor 601, a memory 602, at least one network interface 604 and other user interfaces 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 605 is not shown in FIG. Figure 6 Various buses are labeled as bus system 605 .
[0161] The user interface 603 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0162] It can be understood that the memory 602 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0163] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and an application 6022 .
[0164] The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 6022.
[0165] In the embodiment of the present invention, by calling the program or instruction stored in the memory 602, specifically, the program or instruction stored in the application 6022, the processor 601 is used to execute the method steps provided by each method embodiment.
[0166] The method disclosed in the above embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 601 or the instruction in the form of software. The above processor 601 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.
[0167] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0168] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0169] The electronic device provided in this embodiment may be Figure 6 The electronic device shown in FIG. 1 may perform the following steps: Figure 1 to Figure 3 All steps of the channel switching method in Figure 1 to Figure 3 For details, please refer to Figure 1 to Figure 3 For the sake of brevity, the relevant description is not repeated here.
[0170] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0171] When one or more programs in the storage medium can be executed by one or more processors, the channel switching method executed on the channel switching device side is implemented.
[0172] The processor is used to execute the channel switching program stored in the memory to implement the following steps of the channel switching method executed on the channel switching device side.
[0173] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians 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 the present invention.
[0174] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0175] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A channel switching method, characterized in that: include: When the target device operates on the first channel, determining channel information corresponding to a plurality of channels in a network environment around the target device; For each of the channels, determining a first interference degree corresponding to the channel according to the channel information corresponding to the channel, where the first interference degree represents an interference degree of the channel to the wireless network of the target device; determining a second channel from the plurality of channels according to the first interference levels corresponding to the plurality of channels, the second channel being used for channel switching of the target device; The target device is switched from the first channel to the second channel to operate.
2. The method according to claim 1, characterized in that: The channel information includes access point information corresponding to each wireless access point in the channel; The determining, according to the channel information corresponding to the channel, a first interference degree corresponding to the channel includes: For each of the wireless access points in the channel, determining a second interference level corresponding to the wireless access point according to access point information corresponding to the wireless access point, where the second interference level represents an interference level of the wireless access point to the wireless network of the target device; A first interference level corresponding to the channel is determined according to the second interference levels corresponding to all the wireless access points in the channel.
3. The method according to claim 2, characterized in that The access point information includes the signal strength of the wireless access point; Determining, according to the access point information corresponding to the wireless access point, a second interference level corresponding to the wireless access point, includes: Obtaining a preset signal strength threshold, where the preset signal strength threshold is an absolute value of a minimum signal strength corresponding to the wireless access point; Determine a sum of the preset signal strength threshold and the signal strength of the wireless access point corresponding to the wireless access point to obtain the second interference level corresponding to the wireless access point; Determining the first interference level corresponding to the channel according to the second interference levels corresponding to all the wireless access points in the channel includes: Determine a sum value of the second interference levels corresponding to all the wireless access points in the channel to obtain a second interference level sum value; The second interference level and value are determined as the first interference level corresponding to the channel.
4. The method according to claim 1, characterized in that The determining a second channel from the plurality of channels according to the first interference levels corresponding to the plurality of channels comprises: For each of the channels, perform the following operations: Determine at least one third channel corresponding to the channel from the plurality of channels, wherein the third channel is a channel adjacent to the channel; Determine a sum of the first interference levels corresponding to all the third channels to obtain a first interference level sum value; Determining a target interference level corresponding to the channel according to the first interference level corresponding to the channel and the first interference level and value; A second channel is determined from the multiple channels according to the target interference levels corresponding to the multiple channels.
5. The method according to claim 4, characterized in that The determining, according to the first interference degree corresponding to the channel and the first interference degree and value, a target interference degree corresponding to the channel includes: Determine a target weight corresponding to the channel, where the target weight represents a degree of interference of at least one third channel corresponding to the channel to the channel; Using the target weight to adjust the first interference degree and value to obtain an adjusted first interference degree and value; A sum value between the first interference level and the first interference level sum value is determined to obtain a target interference level corresponding to the channel.
6. The method according to claim 4, characterized in that The determining a second channel from the plurality of channels according to the target interference levels corresponding to the plurality of channels comprises: Sorting the target interference levels corresponding to the plurality of channels in order from small to large according to the target interference levels, so as to obtain a target sorting result; Determine the channel that is at the first place from the target sorting results; The channel that is at the first position in the target sorting result is determined as the second channel.
7. The method according to claim 1, characterized in that The determining of channel information corresponding to a plurality of channels in the network environment around the target device includes: When the target device operates on the first channel, scanning each wireless access point in the network environment around the target device to obtain access point information corresponding to each wireless access point; Classifying all the wireless access points in the same channel into one category according to the access point information corresponding to all the wireless access points, so as to obtain multiple classification results; For each of the classification results, the access point information corresponding to all the wireless access points in the classification result is determined as the channel information corresponding to the channel in the classification result, so as to obtain the channel information corresponding to a plurality of the channels.
8. A channel switching device, characterized in that: include: An information determination module, used to determine channel information corresponding to a plurality of channels in a network environment around the target device when the target device operates on a first channel; An interference level determination module, configured to determine, for each of the channels, a first interference level corresponding to the channel according to the channel information corresponding to the channel, wherein the first interference level represents a level of interference of the channel to the wireless network of the target device; a channel determination module, configured to determine a second channel from the plurality of channels according to the first interference levels corresponding to the plurality of channels, wherein the second channel is used for channel switching of the target device; The switching module is used to switch the target device from the first channel to the second channel for operation.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a channel switching program stored in the memory to implement the channel switching method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the channel switching method according to any one of claims 1 to 7.