Channel switching method and device, computer equipment and computer readable storage medium

By obtaining the broadcast of network function status changes in the terminal device, determining channel conflicts and switching, the problem of channel interference in the terminal device is solved, and the stability and user experience of network functions are improved.

CN119212018APending Publication Date: 2024-12-27SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411340898.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The channel interference problem caused by channel switching during use in terminal devices is difficult to effectively alleviate the prior art.

Method used

By acquiring the status change broadcast of the network function, it is determined whether there is a conflict between the channels corresponding to the first network function and the second network function, and perform channel switching during conflict, and switch to a channel different from the original channel to avoid interference.

Benefits of technology

It effectively alleviates channel interference between different network modules and improves the network function usage experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119212018A_ABST
    Figure CN119212018A_ABST
Patent Text Reader

Abstract

The invention discloses a channel switching method and device, computer equipment and a computer readable storage medium. The method comprises the following steps: acquiring a state change broadcast of a first network function; determining whether a channel conflict exists between a first channel corresponding to the first network function and a second channel corresponding to the second network function based on the state change broadcast; and if the channel conflict exists between the first channel and the second channel, carrying out channel switching on the second channel. By adopting the method provided by the invention, channel interference between network functions corresponding to different network modules can be effectively relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a channel switching method, device, computer equipment and computer-readable storage medium. Background Art

[0002] The terminal device can realize different network functions through different network modules. For example, the terminal device is equipped with two wifi chips at the same time. One wifi chip can realize the station (sta) function and / or peer-to-peer (p2p) function, and the other wifi chip can realize the access point (ap) function.

[0003] Normally, network functions corresponding to different network modules work on different channels, and there is no channel interference between the network functions corresponding to different network modules. However, during the use of network functions, due to channel switching, the network functions corresponding to different network modules may work on the same channel, resulting in channel interference between the network functions corresponding to different network modules. Summary of the invention

[0004] The embodiments of the present application provide a channel switching method, apparatus, computer device, and computer-readable storage medium, which can effectively alleviate channel interference between network functions corresponding to different network modules.

[0005] The technical solution adopted by the present invention to solve the problem is as follows:

[0006] On the one hand, the present application provides a channel switching method, which is applied to a terminal device, the terminal device includes a first network module and a second network module, the terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module, and the channel switching method includes:

[0007] Get the state change broadcast of the first network function;

[0008] Based on the state change broadcast, determining whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function;

[0009] If there is a channel conflict between the first channel and the second channel, the second channel is switched.

[0010] In some embodiments of the present application, determining whether there is a channel conflict between a first channel corresponding to a first network function and a second channel corresponding to a second network function based on a state change broadcast includes:

[0011] Obtain a first channel identifier of a first channel from the state change broadcast;

[0012] Based on the first channel identifier, determining whether the first channel changes;

[0013] If the first channel changes, it is determined whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel.

[0014] In some embodiments of the present application, determining whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel includes:

[0015] matching the first channel identifier with the second channel identifier of the second channel;

[0016] If the first channel identifier and the second channel identifier match, determining that there is a channel conflict between the first channel and the second channel;

[0017] If the first channel identifier and the second channel identifier do not match, it is determined that there is no channel conflict between the first channel and the second channel.

[0018] In some embodiments of the present application, determining whether the first channel has changed based on the first channel identifier includes:

[0019] Acquire a third channel identifier of the first channel; the third channel identifier is the channel identifier of the first channel acquired from the state change broadcast last time;

[0020] If the first channel identifier and the third channel identifier match, determining that the first channel has not changed;

[0021] If the first channel identifier and the third channel identifier do not match, it is determined that the first channel has changed.

[0022] In some implementation schemes of the present application, obtaining a state change broadcast of a first network function includes:

[0023] Register broadcast monitoring object;

[0024] The state change broadcast of the first network function is obtained through the broadcast monitoring object.

[0025] In some embodiments of the present application, performing channel switching on the second channel includes:

[0026] Determining a fourth channel based on a first channel identifier of the first channel; the fourth channel being a channel different from the first channel;

[0027] generating a channel switching instruction based on a fourth channel identifier of the fourth channel;

[0028] The second channel is switched based on the channel switching instruction.

[0029] In some embodiments of the present application, the terminal device further includes a first driving module, which switches the second channel based on the channel switching instruction, including:

[0030] Sending a channel switching instruction to the first driving module through a preset channel switching interface;

[0031] The first driving module switches the second channel based on the channel switching instruction.

[0032] In a second aspect, an embodiment of the present invention further provides a channel switching device, which is applied to a terminal device, wherein the terminal device includes a first network module and a second network module, wherein the terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module, wherein the channel switching device includes:

[0033] A broadcast acquisition module, used to acquire a state change broadcast of a first network function;

[0034] A channel determination module, configured to determine, based on the state change broadcast, whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function;

[0035] The channel switching module is used to switch the second channel if there is a channel conflict between the first channel and the second channel.

[0036] In a third aspect, the present application further provides a computer device, the computer device comprising:

[0037] one or more processors;

[0038] Memory; and

[0039] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to implement any one of the channel switching methods in the first aspect.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in the channel switching method of any one of the first aspects.

[0041] The beneficial effects of the present invention are as follows: through status change broadcasting, it is determined whether there is a channel conflict between a first channel corresponding to a first network function and a second channel corresponding to a second network function; if there is a channel conflict between the first channel and the second channel, the second channel is switched; in the case where there is a channel conflict between the first network function and the second network function, the second channel can be switched to a channel different from the first channel, thereby effectively alleviating channel interference between network functions corresponding to different network modules. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 is a schematic diagram of the structure of a terminal device provided by an embodiment of the present invention;

[0044] Figure 2 is a flow chart of an embodiment of a channel switching method provided by an embodiment of the present invention;

[0045] Figure 3 It is a flowchart of a specific embodiment of obtaining a status change broadcast provided by an embodiment of the present invention;

[0046] Figure 4 is a schematic diagram of a specific embodiment flow of determining whether there is a channel conflict between a first channel and a second channel provided by an embodiment of the present invention;

[0047] Figure 5 is a schematic diagram of a specific embodiment flow of switching a second channel provided by an embodiment of the present invention;

[0048] Figure 6 is a principle block diagram of a channel switching device provided by an embodiment of the present invention;

[0049] Figure 7 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only 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 those skilled in the art without creative work are within the scope of protection of this application.

[0051] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the features.

[0052] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0053] It should be noted that since the method of the embodiment of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information. For example, time is actually time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data for processing by the computer device. The details will not be repeated here.

[0054] The embodiments of the present application provide a channel switching method, apparatus, computer device, and computer-readable storage medium, which are described in detail below.

[0055] The channel switching method provided in the embodiment of the present application is applied to a terminal device. Figure 1 , Figure 1A scenario diagram of a terminal device provided in an embodiment of the present application, the terminal device may include a first network module and a second network module, the terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module. The first network module or the second network module in the embodiment of the present application can implement one or more network functions, and the one or more network functions include but are not limited to one or more of a station (sta) function, an access point (ap) function, and a peer-to-peer (p2p) function. The first network function or the second network function belongs to the one or more network functions mentioned above. It should be noted that the first network function implemented by the first network module and the second network function implemented by the second network module are different network functions. For example, the first network function may be a station (STA) function, and the second network function may be an access point (AP) function; for another example, the first network function may be a station (STA) function, and the second network function may be a peer-to-peer (P2P) function; for another example, the first network function may be an access point (AP) function, and the second network function may be a peer-to-peer (P2P) function, which is not limited in this embodiment. Among them, the STA function is a daily used WiFi scanning and connection function, the AP function represents a hotspot function, and the P2P function represents a peer-to-peer communication or WiFi direct connection function.

[0056] Optionally, continue to refer to Figure 1 As shown, the terminal device may further include a first network management module, a second network management module, a first function operation module, a second function operation module, a first driver module, and a second driver module. The first network management module and the second network management module are used to manage the first network function and the second network function respectively, the first function operation module and the second function operation module are underlying software for operating the first network function and the second network function respectively, the first function operation module and the second function operation module may be obtained by programming in C language, the first driver module and the second driver module are drivers for the second network module and the first network module respectively, and the first driver module and the second driver module may directly control various functions of the corresponding network modules.

[0057] For example, the first network module and the second network module are wifi chips, the first driver module and the second driver module are wifi drivers, the first network function is the sta function, and the second network function is the ap function, the first network management module is WifiManager, the second network management module is SoftApManeger, the first function operation module is wpa_supplicant, and the second function operation module is hostapd. The first driver module can directly control the ap function of the second network module, and the second driver module can directly control the sta function of the first network module.

[0058] Continue to refer to Figure 1 As shown, the first network management module and the second network management module are arranged in the system service layer (System Service) of the terminal device, the first function operation module and the second function operation module are arranged in the hardware abstraction layer (Hal) of the terminal device, and the terminal device further comprises a first interface module and a second interface module. Among them, the first interface module and the second interface module are used for functional docking between the System Service and the Hal layer, for example, the first interface module is HostapdHal, the second interface module is android.hardware.wifi.hostapd@1.2.so, and HostapdHal and android.hardware.wifi.hostapd@1.2.so are used for ap function docking between the System Service and the Hal layer.

[0059] A channel switching device is integrated in the terminal device in the embodiment of the present application, and the channel switching device is mainly used to obtain a status change broadcast of a first network function; based on the status change broadcast, determine whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function; if there is a channel conflict between the first channel and the second channel, switch the second channel, which can effectively alleviate the channel interference between network functions corresponding to different network modules.

[0060] The terminal device used in the embodiments of the present application may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The terminal device may specifically be a desktop terminal or a mobile terminal, and the terminal device may specifically be one of a mobile phone, a tablet computer, a laptop computer, etc.

[0061] It should be noted that Figure 1The scenario diagram of the terminal device shown is merely an example. The terminal device and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of terminal devices and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.

[0062] First, a channel switching method, device, computer equipment and computer-readable storage medium are provided in an embodiment of the present application. The execution subject of the channel switching method is a channel switching device, and the channel switching device is applied to a terminal device. The terminal device includes a first network module and a second network module. The terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module. The channel switching method includes: obtaining a state change broadcast of the first network function; based on the state change broadcast, determining whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function; if there is a channel conflict between the first channel and the second channel, switching the second channel.

[0063] like Figure 2 As shown, it is a schematic flow chart of an embodiment of a channel switching method in an embodiment of the present application. The channel switching method may include the following steps S201 to S203, which are as follows:

[0064] Step S201: Acquire a state change broadcast of a first network function.

[0065] In this embodiment, the first network function may be a station (sta) function, an access point (ap) function, or a peer-to-peer (p2p) function, which is not limited in this embodiment. When the state of the first network function changes, the channel of the first network function may switch. In order to avoid channel conflicts between the first network function and the second network function, when the state of the first network function changes, the first network management module will issue a state change broadcast. For example, the first network function is a sta function. When the terminal device successfully connects to the hotspot in the environment, the terminal device is disconnected from the hotspot in the environment, or the terminal device successfully reconnects to the hotspot in the environment, it indicates that the state of the sta function has changed, and WifiManager issues a state change broadcast.

[0066] Furthermore, in the field of computers and communications, especially in computer networks and Android systems, state change broadcast refers to a data transmission or information transfer mechanism. This mechanism allows information to be sent from one or more sources to multiple recipients, and is usually used to notify or update the status of the system when a specific event occurs. In this embodiment, the state change broadcast refers to the state change information sent when the state of the first network function changes. The state change broadcast includes the channel identifier of the current working channel of the first network function. Based on the channel identifier of the current working channel corresponding to the first network function, it can be determined whether the working channel of the first network function has changed, and in the case of a change in the working channel of the first network function, it is determined whether there is a channel conflict between the working channel of the first network function and the working channel of the second network function.

[0067] Step S202: Based on the state change broadcast, determine whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function.

[0068] In this embodiment, the first channel refers to the current working channel of the first network function, and the second channel refers to the current working channel of the second network function. The existence of a channel conflict between the first channel and the second channel means that the first channel and the second channel are the same channel or the channel frequency of the first channel and the channel frequency of the second channel intersect. When the first channel and the second channel are the same channel or the channel frequency of the first channel and the channel frequency of the second channel intersect, since the first network function and the second network function are in different network modules, the first channel and the second channel will interfere with each other. Therefore, it is necessary to perform channel switching on the first channel or the second channel to avoid mutual interference between the first channel and the second channel.

[0069] Step S203: If there is a channel conflict between the first channel and the second channel, switch the second channel.

[0070] In a specific embodiment, the priority of the first network function is higher than the priority of the second network function. For example, the first network function is the STA function and the second network function is the AP function. Since the channel of the first network function is determined by the environmental hotspot to which the terminal device is connected, the priority of the STA function is higher than the priority of the AP function. After determining that there is a channel conflict between the first channel and the second channel in this embodiment, the second channel with a lower priority is switched, which can effectively avoid mutual interference between the first channel and the second channel.

[0071] For example, the first network function is the STA function, and the second network function is the AP function. The terminal device turns on the STA function and selects the environmental hotspot with channel 44 for connection, and selects channel 149 to turn on the AP function. At this time, the STA function and the AP function work in different channels and will not interfere with each other. The user then switches the STA function to another hotspot located on channel 149. At this time, since the STA function and the AP function work in the same channel, the channel of the STA function and the channel of the AP function will interfere with each other, affecting the user experience of the related functions. By using the channel switching method provided in this embodiment, after the channel of the STA function is switched to channel 149, the channel of the AP function is switched to other channels different from channel 149, which can effectively avoid the channel of the STA function and the channel of the AP function from interfering with each other.

[0072] In a specific implementation, referring to Figure 3 As shown, the acquisition of the state change broadcast of the first network function in the above step S201 may include steps S301 to S302, which are specifically as follows:

[0073] Step S301: register a broadcast monitoring object.

[0074] In a specific embodiment, registering a broadcast monitoring object includes creating a broadcast monitoring object and registering the broadcast monitoring object in an application. The ways of registering the broadcast monitoring object in an application include static registration and dynamic registration. Static registration is suitable for monitoring tasks that need to be run when the application starts, or listeners that do not need frequent registration and deregistration. Dynamic registration is suitable for scenarios where monitoring is required only under specific conditions, or when the monitoring conditions are no longer met, the monitoring can be easily deregistered. The dynamically registered broadcast monitoring object is only created when a broadcast is received and is destroyed immediately after the broadcast is processed. Therefore, it is more lightweight and will not increase the long-term burden of the application.

[0075] Step S302: Acquire the state change broadcast of the first network function through the broadcast monitoring object.

[0076] In a specific embodiment, in combination Figure 1 As shown, the channel switching method is executed by the second network management module. After the second network management module registers a broadcast monitoring object, the state change broadcast issued by the first network management module can be obtained through the broadcast monitoring object. For example, the first network management module is WifiManager, and the second network management module is SoftapManager. After SoftapManager registers a broadcast monitoring object, the state change broadcast issued by WifiManager can be obtained through the broadcast monitoring object.

[0077] In a specific implementation, referring to Figure 4As shown, in the above step S202, based on the state change broadcast, determining whether there is a channel conflict between the first channel corresponding to the first network function and the second channel corresponding to the second network function may include steps S401 to S403, which are specifically as follows:

[0078] Step S401: Acquire a first channel identifier of a first channel from a state change broadcast.

[0079] In this embodiment, the first channel identifier is used to indicate the channel on which the first network function is currently working. In an optional implementation, the first channel identifier may be the channel number of the first channel or the channel ID of the first channel, etc. In addition, it may also be other indication information used to indicate the channel on which the first network function is currently working, which is not limited in this embodiment. For example, if the first channel is channel 149, the first channel identifier may be "149".

[0080] Step S402: Determine whether the first channel changes based on the first channel identifier.

[0081] During the use of the first network function, the first channel may change. For example, the first network function is the STA function. The terminal device turns on the STA function and selects an environmental hotspot with a channel of 44 for connection. Then the user switches the STA function to another hotspot on channel 149, and the first channel changes.

[0082] Considering that there is no conflict between the working channels of the first network function and the second network function at the beginning, the conflict between the first channel and the second channel will occur due to channel switching during the use of the first network function. Therefore, if the first channel has not changed, there is no conflict between the first channel and the second channel. Only when the first channel changes, it is necessary to further determine whether there is a conflict between the first channel and the second channel.

[0083] In a specific embodiment, based on the first channel identifier, the step of determining whether the first channel has changed specifically includes: obtaining a third channel identifier of the first channel; if the first channel identifier and the third channel identifier match, determining that the first channel has not changed; if the first channel identifier and the third channel identifier do not match, determining that the first channel has changed.

[0084] Among them, the third channel identifier is the channel identifier of the first channel obtained from the last state change broadcast. After obtaining the third channel identifier, this embodiment matches the third channel identifier with the first channel identifier. If the first channel identifier and the third channel identifier match, it is determined that the first channel has not changed; conversely, if the first channel identifier and the third channel identifier do not match, it is determined that the first channel has changed. For example, if the first channel identifier and the third channel identifier are both 44, the first channel identifier and the third channel identifier match, and the first channel has not changed; if the first channel identifier is 44 and the third channel identifier is 149, the first channel identifier and the third channel identifier do not match, and the first channel has changed.

[0085] Step S403: If the first channel changes, determine whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel.

[0086] In this embodiment, the second channel identifier is used to indicate the channel on which the second network function is currently working. In an optional implementation, the second channel identifier may be the channel number of the second channel or the channel ID of the second channel, etc. In addition, it may also be other indication information used to indicate the channel on which the first network function is currently working, which is not limited in this embodiment. For example, if the second channel is channel 149, the second channel identifier may be "149".

[0087] In this embodiment, after determining whether the first channel has changed based on the first channel identifier, if the first channel has changed, it is determined whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel; otherwise, if the first channel has not changed, the step of obtaining the status change broadcast of the first network function is continued.

[0088] In a specific embodiment, the step of determining whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel specifically includes: matching the first channel identifier and the second channel identifier of the second channel; if the first channel identifier and the second channel identifier match, determining that there is a channel conflict between the first channel and the second channel; if the first channel identifier and the second channel identifier do not match, determining that there is no channel conflict between the first channel and the second channel.

[0089] For example, if the first channel identifier is 44 and the second channel identifier is 149, the first channel identifier and the second channel identifier do not match, and there is no channel conflict between the first channel and the second channel; if the first channel identifier and the second channel identifier are both 149, the first channel identifier and the second channel identifier match, and there is a channel conflict between the first channel and the second channel.

[0090] In a specific implementation, referring to Figure 5As shown, the channel switching of the second channel in the above step S203 may include steps S501 to S503, which are specifically as follows:

[0091] Step S501: Determine a fourth channel based on a first channel identifier of a first channel.

[0092] In a specific embodiment, the fourth channel is a channel different from the first channel. Based on the first channel identifier of the first channel, the step of determining the fourth channel specifically includes: determining the target channel identifier from the preset channel identifiers based on the first channel identifier of the first channel; the target channel identifier is a channel identifier different from the first channel identifier in the preset channel identifier; and determining the channel corresponding to the target channel identifier as the fourth channel. For example, the commonly used wifi channels currently include 2.4G and 5G frequency bands. The commonly used 2.4G frequency band channels include channels corresponding to channel identifiers such as 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, and 13. The commonly used 5G frequency band channels include channels corresponding to channel identifiers such as 36, 40, 44, 48, 149, 153, 157, 161, and 165. If the first channel identifier is 44, the target channel identifier is determined to be 149 from the channel identifiers of the commonly used 5G frequency band channels, and the channel corresponding to 149 is determined as the fourth channel.

[0093] Step S502: Generate a channel switching instruction based on the fourth channel identifier of the fourth channel.

[0094] In this embodiment, the channel switching instruction is a channel switching command for switching the second channel to the fourth channel. Based on the channel switching instruction, the second channel can be switched to the fourth channel, thereby avoiding the channel conflict caused by the working channel of the first network function being the same as the working channel of the second network function. For example, the fourth channel is identified as 149, the second channel is channel 44, and the channel switching instruction can be "switch channel 44 to channel 149".

[0095] Step S503: Switch the second channel based on the channel switching instruction.

[0096] In a specific embodiment, the terminal device also includes a first driver module, which is used to control various functions of the second network module. The above-mentioned step of switching the second channel based on the channel switching instruction specifically includes: sending the channel switching instruction to the first driver module through a preset channel switching interface; and switching the second channel based on the channel switching instruction through the first driver module.

[0097] The existing terminal device needs to restart the second network function to implement the channel switching of the second channel. In order to implement the channel switching of the second channel without restarting the second network function, refer to Figure 1As shown, in this embodiment, a channel switching interface is added in the first interface module, the second interface module and the second functional operation module, and the second network management module sends the channel switching instruction to the first driver module through the channel switching interface, and the first driver module switches the second channel based on the channel switching instruction. For example, the second network management module is SoftManager, the first interface module is HostapdHal, the second interface module is android.hardware.wifi.hostapd@1.2.so, the second functional operation module is hostapd, and the first driver module is wifi driver. A channel switching interface is added in HostapdHal, android.hardware.wifi.hostapd@1.2.so and hostapd, and SoftManager sends the channel switching instruction to the wifi driver through the channel switching interface, and the wifi driver switches the second channel based on the channel switching instruction.

[0098] In order to better implement the channel switching method in the embodiment of the present application, based on the channel switching method, a channel switching device is also provided in the embodiment of the present application. The channel switching device is applied to a terminal device, and the terminal device includes a first network module and a second network module. The terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module. Figure 6 As shown, the channel switching device 700 includes:

[0099] A broadcast acquisition module 710 is used to acquire a state change broadcast of a first network function;

[0100] A channel determination module 720, configured to determine whether there is a channel conflict between a first channel corresponding to a first network function and a second channel corresponding to a second network function based on the state change broadcast;

[0101] The channel switching module 730 is configured to switch the second channel if there is a channel conflict between the first channel and the second channel.

[0102] In an embodiment of the present application, it is determined whether there is a channel conflict between a first channel corresponding to a first network function and a second channel corresponding to a second network function based on a status change broadcast. If there is a channel conflict between the first channel and the second channel, the second channel is switched. In the case where there is a channel conflict between the first network function and the second network function, the second channel can be switched to a channel different from the first channel, thereby effectively alleviating channel interference between network functions corresponding to different network modules.

[0103] In some embodiments of the present application, the broadcast acquisition module 710 acquires the state change broadcast of the first network function, including:

[0104] Register broadcast monitoring object;

[0105] The state change broadcast of the first network function is obtained through the broadcast monitoring object.

[0106] In some embodiments of the present application, the channel determination module 720 determines whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function based on the state change broadcast, including:

[0107] Obtain a first channel identifier of a first channel from the state change broadcast;

[0108] Based on the first channel identifier, determining whether the first channel changes;

[0109] If the first channel changes, it is determined whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel.

[0110] In some embodiments of the present application, the channel determination module 720 determines whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel, including:

[0111] matching the first channel identifier with the second channel identifier of the second channel;

[0112] If the first channel identifier and the second channel identifier match, determining that there is a channel conflict between the first channel and the second channel;

[0113] If the first channel identifier and the second channel identifier do not match, it is determined that there is no channel conflict between the first channel and the second channel.

[0114] In some embodiments of the present application, the channel determination module 720 determines whether the first channel has changed based on the first channel identifier, including:

[0115] Acquire a third channel identifier of the first channel; the third channel identifier is the channel identifier of the first channel acquired from the state change broadcast last time;

[0116] If the first channel identifier and the third channel identifier match, determining that the first channel has not changed;

[0117] If the first channel identifier and the third channel identifier do not match, it is determined that the first channel has changed.

[0118] In some embodiments of the present application, the channel switching module 730 switches the second channel, including:

[0119] Determining a fourth channel based on a first channel identifier of the first channel; the fourth channel being a channel different from the first channel;

[0120] generating a channel switching instruction based on a fourth channel identifier of the fourth channel;

[0121] The second channel is switched based on the channel switching instruction.

[0122] In some embodiments of the present application, the terminal device further includes a first driving module, and the channel switching module 730 switches the second channel based on the channel switching instruction, including:

[0123] Sending a channel switching instruction to the first driving module through a preset channel switching interface;

[0124] The first driving module switches the second channel based on the channel switching instruction.

[0125] The embodiment of the present application further provides a computer device, which integrates any one of the channel switching devices provided in the embodiment of the present application, and the computer device includes:

[0126] one or more processors;

[0127] Memory; and

[0128] One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the processor to execute the steps of the channel switching method in any of the above channel switching method embodiments.

[0129] The present application also provides a computer device that integrates any channel switching device provided in the present application. Figure 7 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:

[0130] The computer device may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0131] The processor 801 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.

[0132] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0133] The computer device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0134] The computer device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0135] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:

[0136] Get the state change broadcast of the first network function;

[0137] Based on the state change broadcast, determining whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function;

[0138] If there is a channel conflict between the first channel and the second channel, the second channel is switched.

[0139] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0140] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any channel switching method provided in the embodiment of the present application. For example, the computer program is loaded by the processor to execute the following steps:

[0141] Get the state change broadcast of the first network function;

[0142] Based on the state change broadcast, determining whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function;

[0143] If there is a channel conflict between the first channel and the second channel, the second channel is switched.

[0144] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0145] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0146] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0147] The above is a detailed introduction to a channel switching method, device, computer equipment and computer-readable storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A channel switching method, characterized in that: Applied to a terminal device, the terminal device includes a first network module and a second network module, the terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module, and the channel switching method includes: Obtaining a state change broadcast of the first network function; Based on the state change broadcast, determining whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function; If there is a channel conflict between the first channel and the second channel, channel switching is performed on the second channel.

2. The channel switching method according to claim 1, characterized in that: The determining, based on the state change broadcast, whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function includes: Acquire a first channel identifier of the first channel from the state change broadcast; Determining, based on the first channel identifier, whether the first channel changes; If the first channel changes, it is determined whether there is a channel conflict between the first channel and the second channel based on the first channel identifier and the second channel identifier of the second channel.

3. The channel switching method according to claim 2, characterized in that: The determining, based on the first channel identifier and the second channel identifier of the second channel, whether there is a channel conflict between the first channel and the second channel includes: matching the first channel identifier with a second channel identifier of the second channel; If the first channel identifier and the second channel identifier match, determining that there is a channel conflict between the first channel and the second channel; If the first channel identifier and the second channel identifier do not match, it is determined that there is no channel conflict between the first channel and the second channel.

4. The channel switching method according to claim 2, characterized in that: The determining, based on the first channel identifier, whether the first channel changes includes: Acquire a third channel identifier of the first channel; the third channel identifier is the channel identifier of the first channel acquired from the state change broadcast last time; If the first channel identifier and the third channel identifier match, determining that the first channel has not changed; If the first channel identifier and the third channel identifier do not match, it is determined that the first channel has changed.

5. The channel switching method according to claim 1, characterized in that: The acquiring the state change broadcast of the first network function includes: Register broadcast monitoring object; The state change broadcast of the first network function is obtained through the broadcast monitoring object.

6. The channel switching method according to claim 1, characterized in that: The performing channel switching on the second channel includes: Determining a fourth channel based on a first channel identifier of the first channel; the fourth channel being a channel different from the first channel; generating a channel switching instruction based on a fourth channel identifier of the fourth channel; The second channel is switched based on the channel switching instruction.

7. The channel switching method according to claim 6, characterized in that: The terminal device further includes a first driving module, and the switching of the second channel based on the channel switching instruction includes: Sending the channel switching instruction to the first driving module through a preset channel switching interface; The second channel is switched by the first driving module based on the channel switching instruction.

8. A channel switching device, characterized in that: Applied to a terminal device, the terminal device includes a first network module and a second network module, the terminal device implements a first network function through the first network module, and the terminal device implements a second network function through the second network module, and the channel switching device includes: A broadcast acquisition module, used to acquire a state change broadcast of the first network function; a channel determination module, configured to determine, based on the state change broadcast, whether there is a channel conflict between a first channel corresponding to the first network function and a second channel corresponding to the second network function; The channel switching module is configured to switch the second channel if there is a channel conflict between the first channel and the second channel.

9. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the channel switching method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the channel switching method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Channel switching method and apparatus, and computer device

    WO2026067165A1