Patent Description:
WiFi allows a terminal to be connected to a wireless local area network (English: WLAN), and generally operates on a radio frequency band of <NUM> or <NUM>. Like a Bluetooth technology, a WiFi technology is also a short-range wireless communications technology, is a network transmission standard, and has already been widely applied to daily life. For example, in areas such as a house, an airport, a coffee shop, and a shopping mall, a user can experience a high-speed network by using a mobile electronic device (that is, a terminal) to access a WiFi access point (English: Access Point, AP for short) or a WiFi hotspot.

From <CIT> wireless systems for load balancing and simultaneous communication are known.

During use, sometimes, a terminal may need to access two WiFi APs at the same time, or in other words, a terminal has a WiFi dual connectivity requirement. Currently, the terminal may be connected to two different WiFi networks by using two independent WiFi connection channels, so that the two WiFi networks operate on a same frequency band or different radio frequency bands. For example, one WiFi network connected to the terminal operates on a radio frequency band of <NUM> and the other WiFi network operates on a radio frequency band of <NUM>. Alternatively, the two WiFi networks each operate on a radio frequency band of <NUM>. In such a WiFi dual connectivity technology, data traffic can be improved, multiple types of applications can be supported, and the like. An existing WiFi dual connectivity technology is implemented mostly based on a terminal hardware design and with a lack of an appropriate software layer design. Therefore, how to design an appropriate software architecture to support WiFi dual connectivity becomes a problem.

Embodiments of this application provide a terminal for accessing a WiFi network, so as to support the terminal in being connected to two or more WiFi networks at the same time, and therefore, WiFi network is applied in a safer and more fluent manner.

The embodiments of this application provide a terminal according to claim <NUM>.

According to the terminal provided in the embodiments of this application, the terminal can be supported in being connected to two or more WiFi networks at the same time by using a software layer design, so that WiFi network is applied in a safer and more fluent manner.

Apparently, the described embodiments are merely some rather than all of the embodiments of this application.

In view of a fact that an existing WiFi dual connectivity technology is implemented mostly based on a terminal hardware design and with a lack of an appropriate software layer design, according to a terminal provided in the embodiments of this application, an appropriate software architecture is designed, so that WiFi dual connectivity and even multi-connectivity of more than two WiFi connections are supported.

In embodiments of this description, a terminal is described with two or more operating systems, however the claimed embodiment corresponds to the embodiment of this description with one operating system.

Detailed descriptions are respectively provided below.

Currently, a terminal with dual operating systems has been applied. The terminal has two independent operating systems. It may be considered that two containers can operate in the terminal, and there is a safe distance between the two containers, so as to ensure that tasks and data are mutually isolated during operation of the two containers, and ensure privacy of each operating system. When using the terminal with dual operating systems, a user may use one operating system to execute a business task, and use the other operating system to execute a personal task, so that business information or personal information safety can be ensured when the user performs switch operation between different operating systems. However, in a process of switch operation between operating systems, the operating systems need to be connected to different WiFi APs. In view of the foregoing problem, the embodiments of this application provide a method and an apparatus for accessing a WiFi network and a terminal. The terminal mentioned includes at least two WiFi access circuits and can form at least two containers, and when different containers operate, the terminal uses different WiFi access circuits to access corresponding WiFi networks. In this way, it can be ensured that a WiFi network connection is not disconnected when a terminal switches between different operating systems, so that WiFi network application is safer, a service is more fluent, and user experience is improved.

Optionally, the operating system mentioned in the embodiments may be an operating system such as Android (Android), iOS, or Windows. The terminal mentioned in the embodiments of this application may be a mobile electronic device such as a mobile phone, a notebook computer, or a tablet computer.

Specifically, referring to <FIG>, a terminal <NUM> in an embodiment of this application includes a main chip <NUM>, a WiFi chip <NUM>, and a memory <NUM>. The memory <NUM> is configured to store a software program. An operating system that can be used by the terminal <NUM> is loaded in the main chip <NUM>. The terminal <NUM> includes at least one body, that is, a main central processing unit (English: Central Processing Unit, CPU for short), that uses the WiFi chip <NUM>, and the main CPU is hereinafter briefly referred to as a processor. The at least one processor is coupled to the memory <NUM>, and is configured to read the software program from the memory to run the operating system and application software. A WiFi CPU (that is, a WIFI processor) <NUM> is loaded in the WiFi chip <NUM>. The WiFi CPU <NUM> is a WiFi chip kernel processor, and mainly implements a WiFi-related operation function, for example, is responsible for congestion control, carrier aggregation, frame filtering, key control, frame receiving/transmission management, and the like. It may be understood that the main chip <NUM> and the WiFi chip <NUM> may be integrated into one chip.

N WiFi access circuits are integrated into the WiFi chip <NUM>, and N is a natural number greater than or equal to <NUM>. Each of the N WiFi access circuits is used for access to one corresponding WiFi network, and each WiFi access circuit corresponds to one independent Media Access Control (English: Media Access Control, MAC for short) <NUM> and one independent physical layer (English: physical layer, PHY for short) <NUM>. N MACs <NUM> and N PHYs <NUM> share one WiFi CPU <NUM>, and can receive/transmit data at the same time, so as to implement a dual-band dual-concurrent (Dual-Band Dual-Concurrent, DBDC) function. Functions of the MAC <NUM> mainly include channel access, group deframing, data receiving/transmission, encryption/decryption, and energy conservation control. As shown in <FIG>, the MAC <NUM> may be implemented by using independent hardware such as an independent digital signal processor. Certainly, the MAC <NUM> may be implemented by using the WiFi CPU <NUM>, that is, functions of the MAC <NUM> are implemented by using the WiFi CPU <NUM>. <FIG> is merely used for reference, and does not impose any limitation. The PHY <NUM> mainly implements a physical layer function such as digital baseband processing. The WiFi chip <NUM> further includes a radio frequency component <NUM>. The radio frequency component <NUM> converts a baseband signal processed by the MAC <NUM> and the PHY <NUM> into a radio frequency signal during transmission, and converts a radio frequency signal received from an antenna into a baseband signal during receiving, so that the PHY <NUM> and the MAC <NUM> perform further processing. It may be understood that the WiFi CPU <NUM> may be replaced with a DSP (digital signal processor) or an independent FPGA (field programmable gate array) chip. A specific form of a processor implementing WiFi processing may be flexible. <FIG> is merely used for reference, and does not impose any limitation.

In this embodiment of this application, the at least one processor in the main chip <NUM> may run the software program to form M containers. M is a natural number greater than or equal to <NUM>, and generally, M=<NUM>. Each container corresponds to one operating system, the M containers are capable of operating at the same time, each container corresponds to one WiFi network access service, the terminal <NUM> uses different operating systems when different containers operate, and tasks and data of different WiFi network access services during operation of different containers are mutually isolated, that is, each container has an independent task and independent data, and different containers are corresponding to tasks that do not interfere with each other and data that does not interfere with each other. During switch operation between different operating systems, the terminal <NUM> switches between the operation of different containers. Different containers need to be safely isolated from each other, so as to ensure that information about data generated during operation of any two different containers does not interact with each other. Therefore, privacy of each operating system is ensured. The two operating systems may be of different types such as an Android system and a Windows system, or may be of a same type such as dual Android systems. Two operating systems of a same type that implement dual-WiFi concurrence may use different kernels, or may use a same kernel, but in the two systems or two containers, data is isolated and user operations are isolated in a specific manner. Currently, a dual-container intelligent terminal is relatively widely applied. One operating system may be corresponding to business application, and the other operating system may be corresponding to personal application. This can ensure that business information and personal information do not interfere with each other, so as to ensure privacy. The method provided in this application may be applied to a terminal in which at least two containers operate, and optionally, applied to a dual-container terminal. The container is software that keeps together an operating system program or an application program and a running component of the operating system program or the application program. For example, the container is configured to pack the operating system program or the application program, a library, and another binary file required for running of the operating system program or the application program, so that an independent operating system environment can be provided for the operating system program or the application program. Generally, each software container may include at least a part of a corresponding operating system. Alternatively, each software container may not include an operating system kernel, and in this case, the container may be faster and more flexible than a virtual machine. In this embodiment, one container may be corresponding to one operating system, and two operating systems may be mutually isolated, so that operations of the two operating systems do not interfere with each other.

It may be understood that the container mentioned in each embodiment of this application may include one of at least a part of a corresponding operating system (that may selectively include or not include an operating system kernel), a corresponding application program, a corresponding component, corresponding middleware, or a corresponding database, or a combination thereof. For example, as a software functional entity executed by the main CPU, the container may be configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state.

The WiFi CPU <NUM> is configured to: when a first container in the M containers operates, access a first WiFi network by using a first WiFi access circuit in the N WiFi access circuits, and when the terminal <NUM> switches from the operation of the first container to operation of a second container in the M containers, access a second WiFi network by using a second WiFi access circuit in the N WiFi access circuits. The at least one processor is further configured to: when the WiFi CPU <NUM> accesses the second WiFi network by using the second WiFi access circuit, continue running the first container in a background running manner, and the WiFi CPU <NUM> is further configured to continue using the first WiFi access circuit to access the first WiFi network, so as to ensure that a WiFi network connection is not disconnected during switch operation between a foreground operating system and a background operating system.

Optionally, when using a WiFi access circuit to access a corresponding WiFi network, the WiFi CPU <NUM> accesses the first WiFi network according to a preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits; and accesses the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits. In addition, when accessing the first WiFi network by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits, the WiFi CPU <NUM> performs at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network; and when accessing the second WiFi network by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits, the WiFi CPU <NUM> performs at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the second WiFi network.

Based on the structural diagram of the terminal shown in <FIG>, with reference to the accompanying drawings, the following describes in detail an implementation method, provided in the embodiments of this application, for ensuring that neither of WiFi network connections in the foreground and the background is disconnected when a terminal switches between different operating systems. In the embodiments of this application, switch operation between operating systems or corresponding containers is switch operation of the operating systems or the containers between the foreground and the background. An operating system or a container is switched from the background to the foreground, and an operating system or a container that originally operates in the foreground is switched to the background. Such switch operation does not cause disconnection of a WiFi connection corresponding to an operating system running in the background, and corresponding WiFi data transmission is not disconnected, so as to implement a WiFi dual connectivity and simultaneous data transmission. When an operating system or a container is in a foreground operating state, data or a process of the operating system or the container may be displayed to a user by using a user interface (English: User Interface, UI for short). When an operating system or a container is in a background operating state, data or a process of the operating system or the container is not displayed to a user by using a user interface.

As shown in <FIG>, a procedure of a method for accessing a WiFi network provided in an embodiment of this application is as follows:.

According to the foregoing method, when switching to the operation of the second container, the terminal uses the second WiFi access circuit to access the second WiFi network. The first WiFi access circuit and the second WiFi access circuit are mutually independent, and therefore, the terminal can continue using the first WiFi access circuit in the background to access the first WiFi network, and a service is not disconnected.

In a specific implementation process, the terminal presets a mapping relationship between containers and WiFi access circuits, accesses the first WiFi network according to the preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits, and accesses the second WiFi network by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits.

Based on the terminal shown in <FIG> and the method shown in <FIG>, referring to <FIG>, an embodiment of this application further provides an apparatus <NUM> for accessing a WiFi network. The apparatus <NUM> includes M containers <NUM> that are capable of operating at the same time and a WiFi module <NUM>. Each container <NUM> corresponds to one WiFi network access service, tasks and data of different WiFi network access services during operation of different containers <NUM> are mutually isolated, and the M containers <NUM> include a first container <NUM>-<NUM> and a second container <NUM>-<NUM>.

The WiFi module <NUM> is configured to: when the first container <NUM>-<NUM> operates, access a first WiFi network by using a first WiFi access circuit; and is further configured to: when the apparatus <NUM> switches from the operation of the first container <NUM>-<NUM> to the operation of the second container <NUM>-<NUM>, access a second WiFi network by using a second WiFi access circuit. The first container <NUM>-<NUM> is further configured to: when the WiFi module <NUM> accesses the second WiFi network by using the second WiFi access circuit, continue operating in a background running manner, and the WiFi module <NUM> is further configured to continue using the first WiFi access circuit to access the first WiFi network.

M and N are natural numbers greater than or equal to <NUM>. Preferably, M is equal to N.

Optionally, the WiFi module <NUM> is configured to access the first WiFi network according to a preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container <NUM>-<NUM>.

The WiFi module <NUM> is further configured to access the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container <NUM>-<NUM>.

Optionally, the WiFi module <NUM> is further configured to: when accessing the first WiFi network by using the first WiFi access circuit corresponding to the first container <NUM>-<NUM>, perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network; and when accessing the second WiFi network by using the second WiFi access circuit corresponding to the second container <NUM>-<NUM>, perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the second WiFi network.

Optionally, each of the M containers <NUM> is configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state.

For better understanding of the terminal shown in <FIG>, the method shown in <FIG>, and the apparatus shown in <FIG> in the embodiments of this application, the following further describes an implementation of a terminal by using a more detailed schematic diagram of an internal structure stack of a terminal shown in <FIG> and <FIG>. As shown in <FIG> and <FIG>, a terminal <NUM> may use at least two operating systems. In <FIG> and <FIG>, an example in which two operating systems: OS0 and OS1 are used is used for description. For each operating system, the following modules are included: a WiFi setting module <NUM>, an AP state machine <NUM>, a station peer to peer (English: Station Peer to Peer, STA P2P for short) network state machine <NUM>, an interface <NUM>, a network adapter matching module <NUM>, an encryption network access logical entity <NUM>, a WLANO <NUM>, a P2P0 <NUM>, a P2P <NUM>, a scheduling module <NUM>, a WiFi protocol stack <NUM>, and a WiFi access circuit <NUM>.

The WiFi setting module <NUM> is a WiFi utilization interface normally used on an intelligent terminal, that is, a user interface software, and is application software run by a main CPU.

The AP state machine <NUM> is used for logical implementation of an AP start state in an installation package of the terminal; is software run by the main CPU or a WiFi CPU; is generally run by the main CPU; and is configured to: receive a report from a bottom layer, obtain an access status such as a connected state or a disconnected state or connection signal strength of a WiFi AP, and deliver the obtained access status of the WiFi AP to the WiFi setting module, so that the WiFi setting module <NUM> displays the access status of the WiFi AP on a user interface.

The station peer to peer network state machine <NUM> is used for logical implementation of a STA P2P connection status in the installation package of the terminal. Similar to the AP state machine, the STA P2P state machine is configured to obtain a status of a P2P point, that is, information about a peer device in WiFi direct transmission, is software run by the main CPU or the WiFi CPU, and is generally run by the main CPU.

It may be considered that the WiFi setting module <NUM>, the AP state machine <NUM>, and the STA P2P state machine <NUM> that are corresponding to each operating system are included in one container and are run by the main CPU. The AP state machine <NUM> and the STA P2P state machine <NUM> learn an operating status of a WiFi part (including a WiFi processor and a WiFi access circuit) by maintaining and managing the access status of the WiFi AP and the connection status of the STA P2P, so that a related status is conveniently delivered to the WiFi setting module <NUM> at an upper layer, and the WiFi setting module <NUM> can perform corresponding display.

The interface <NUM> is an interface logical protocol stack interface layer, and is only an interface for connecting an upper part and a lower part.

The network adapter matching module <NUM> is used for network adapter binding and distribution of called network interfaces, that is, used for implementing a correspondence between a high-layer container and a bottom-layer software module such as the encryption network access logical entity <NUM>, the WLANO <NUM>, the P2P0 <NUM>, the P2P <NUM>, the WiFi protocol stack <NUM>, and the WiFi access circuit <NUM>, and is software run by the WiFi CPU.

The encryption network access logical entity <NUM> implements a WiFi AP-mode encryption/decryption network access function, and is software run by the WiFi CPU.

The WLANO <NUM> is a WLAN communications entity, is software run by the WiFi CPU, and implements a necessary software function required for WLAN communication.

The P2P0 <NUM> is a P2P communications entity, is software run by the WiFi CPU, and implements a necessary software function required for P2P communication.

The P2P <NUM> is a P2P scanning function, is software run by the WiFi CPU, and implements a necessary software function required for P2P scanning.

The scheduling module <NUM> is configured to perform scheduling, including channel resource scheduling and the like, between two virtual access points based on one WiFi CPU.

The WiFi protocol stack <NUM> includes at least two independent MACs. In <FIG> and <FIG>, two MACs are used as an example. The MAC may be software run by the WiFi CPU, or certainly, may be implemented by using independent MAC hardware instead of WiFi CPU software.

Software run by the WiFi CPU may be collectively referred to as a WiFi module, may selectively include the interface <NUM>, the network adapter matching module <NUM>, the encryption network access logical entity <NUM>, the scheduling module <NUM>, and the WiFi protocol stack <NUM>, and may further include the WLANO <NUM>, the P2P0 <NUM>, and the P2P <NUM>.

At least two WiFi access circuits <NUM> and the WiFi CPU are all included in a WiFi chip, and the at least two WiFi access circuits <NUM> may include at least two independent PHY layers and at least two radio frequency components. For example, there are two WiFi access circuits: a first WiFi access circuit and a second WiFi access circuit. It may be understood that the WiFi access circuit <NUM> may be implemented by using an integrated circuit, that is, the WiFi CPU and the WiFi access circuits including the independent PHY layers and the radio frequency components may be integrated into the WiFi chip. In this way, the WiFi access circuits and the WiFi CPU form a complete processor, and the processor is integrated into a semiconductor chip by using an integrated circuit technology. Alternatively, in a non-claimed embodiment the WiFi access circuit <NUM> may be an independent chip, and is implemented in separation from the WiFi CPU. This is not limited in this embodiment.

Specifically, the terminal may switch between the two operating systems, OS0 and OS1. Each operating system corresponds to operation in one container. As shown in <FIG> and <FIG>, there are two symmetrical parts. It may be considered that the terminal may operate a virtual device corresponding to each part, that is, may operate a container corresponding to each part. A difference between center frequencies of channels used when two containers operate in the terminal needs to be greater than a threshold, for example, needs to be at least <NUM>. Alternatively, the terminal may use a same channel when two containers operates.

In an actual application process, when the terminal starts, a WLAN and a P2P of the OS0, a WLAN and a P2P of the OS1, an encryption entity of the OS0, and an encryption entity of the OS1 start by default.

When the OSO starts, an AP state machine <NUM> and a STA P2P state machine <NUM> of the OS0 register with a network adapter matching module <NUM>, and is associated with the corresponding encryption network access logical entity <NUM> of the OS0, so that a connection to the corresponding encryption network access logical entity <NUM> is established (certainly, the encryption network access logical entity <NUM> of the OS1 may be obtained, so that a connection to the corresponding encryption network access logical entity <NUM> of the OS1 is established).

A start process of the OS1 is similar to the foregoing start process of the OS0, and details are not described herein again.

The network adapter matching module <NUM> needs to store an index of the encryption network access logical entity <NUM> and indexes of the AP state machine <NUM> and the STA P2P state machine <NUM> of the OS0, store a shared variable or a message queue that is used for state machine communication between the encryption network access logical entity <NUM> and both the AP state machine <NUM> and the STA P2P state machine <NUM> of the OS0, and store a connection relationship between each upper-layer state machine of the network adapter matching module <NUM> and the lower-layer encryption network access logical entity <NUM>.

Calling a native interface includes calling an interface from the encryption network access logical entity <NUM> to each state machine and calling an interface from each state machine to the encryption network access logical entity <NUM>, and the network adapter matching module <NUM> needs to be adaptive to the native interface by using an incremental message mechanism or another process communication mechanism.

Exit logic is contrary to the foregoing start logic, and reference may be made to the foregoing start logic.

According to the terminal and the method and apparatus for accessing a WiFi network provided in <FIG> and <FIG>, it can be ensured that a WiFi network connection is not disconnected when a terminal switches between different operating systems, so that WiFi network application is safer, a service is more fluent, and user experience is improved.

In addition, in a public environment such as an airport or a shopping mall, because multiple WiFi APs are disposed, when a user who holds a terminal moves from one area to another area, the terminal needs to switch from one WiFi AP to another WiFi AP. In this switch process, service disconnection is caused, and user experience is compromised. In view of this, based on the terminal structure provided in <FIG>, the embodiments of this application provide another method and apparatus for accessing a WiFi network and another terminal, so that one terminal can be connected to two or more different WiFi APs, a WiFi network is not disconnected during switch operation between two WiFi APs, a service is more fluent, and user experience is improved.

In the terminal structure provided in <FIG>, the at least one processor in the main chip <NUM> may run the software program to form at least two containers. Alternatively, certainly, the at least one processor in the main chip <NUM> may run the software program to form only one container, that is, a single-container mode is supported. Likewise, a single container may also be configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state. A terminal mentioned in a method and an apparatus described in <FIG> and <FIG> in the embodiments of this application is for the single-container mode. In the single-container mode, two WiFi network access identifiers may be conveniently displayed on a user interface or a display, so that a user can conveniently learn connection statuses of two WiFi networks, and user experience is improved.

Based on the terminal structure shown in <FIG>, in the single-container mode, a container in the terminal <NUM> supports both a first WiFi network access service and a second WiFi network access service. The WiFi CPU <NUM> is configured to: when an access request for accessing the first WiFi network is received, access the first WiFi network by using a first WiFi access circuit in N WiFi access circuits; and on condition of using the first WiFi access circuit to access the first WiFi network, if an access request for accessing the second WiFi network is received, access the second WiFi network by using a second WiFi access circuit in the N WiFi access circuits. The at least one processor included in the main chip <NUM> is configured to drive a display interface corresponding to the container to synchronously display a first WiFi network access identifier and a second WiFi network access identifier. For the display interface, refer to a schematic diagram shown in <FIG>. The first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is accessed. N is a natural number greater than or equal to <NUM>.

Optionally, the terminal <NUM> may further include a display <NUM>, and the display interface corresponding to the container is displayed on the display <NUM>.

The at least one processor in the main chip <NUM> is further configured to drive the display interface to synchronously display connection signal strength of the first WiFi network and connection signal strength of the second WiFi network.

Optionally, the WiFi CPU <NUM> is further configured to: after accessing the first WiFi network and the second WiFi network, select, according to a detected WiFi network connection manner entered by a user, at least one of the first WiFi network or the second WiFi network to carry a data service. In addition, the WiFi CPU <NUM> is further configured to perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network and the second WiFi network.

Based on the terminal <NUM> in the single-container mode, referring to <FIG>, a procedure of another method for accessing a WiFi network provided in an embodiment of this application is as follows:.

N is a natural number greater than or equal to <NUM>.

After accessing the first WiFi network and the second WiFi network, the terminal synchronously displays a first WiFi network access identifier and a second WiFi network access identifier on a display interface. The display interface is shown in <FIG>. The first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is accessed. Further, after accessing the first WiFi network and the second WiFi network, the terminal may synchronously display connection signal strength of the first WiFi network and connection signal strength of the second WiFi network on the display interface.

Optionally, a WiFi network connection manner is pre-configured for the terminal. The WiFi network connection manner is used by a user to select a WiFi network to carry a data service. For example, the WiFi network connection manner includes: preferably accessing a WiFi AP with a strong signal, or accessing multiple WiFi APs (for example, two WiFi APs) at the same time, or accessing a designated WiFi AP, or the like. The terminal selects, according to the detected WiFi network connection manner entered by the user, at least one of the first WiFi network or the second WiFi network to carry the data service. Specifically, after accessing the first WiFi network and the second WiFi network, the terminal selects, from the first WiFi network and the second WiFi network according to the detected WiFi network connection manner entered by the user, a WiFi network having higher connection signal strength to carry the data service; or selects, according to the detected WiFi network connection manner entered by the user, a WiFi network designated by the user, to carry the data service, or selects, according to the detected WiFi network connection manner entered by the user and according to a load balancing policy, the first WiFi network and the second WiFi network to carry the data service together.

That the first WiFi network and the second WiFi network are selected according to the load balancing policy to carry the data service together may include but be not limited to the following several cases.

The terminal uses, according to a traffic balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service; or
the terminal uses, according to a service request quantities balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service.

It can be learned from the method shown in <FIG> that, when the terminal has accessed one network, the terminal may further access another network while maintaining the one network access service. The two WiFi networks use different WiFi access circuits to operate, and therefore, it can be ensured that the two WiFi networks are online at the same time. The foregoing manner may also be referred to as a WiFi dual standby manner. Certainly, in the foregoing method, an extended case is that more than two WiFi networks are online at the same time. In this way, if the terminal is connected to two WiFi networks at the same time, when a user who holds the terminal moves from one area to another area, it can be ensured that a WiFi network connection is not disconnected, it can be ensured that a service is not disconnected, and user experience can be improved.

Based on the method for accessing a WiFi network shown in <FIG>, referring to <FIG>, an embodiment of this application further provides an apparatus <NUM> for accessing a WiFi network. The apparatus <NUM> includes a container <NUM> supporting both a first WiFi network access service and a second WiFi network access service and a WiFi module <NUM>. The container <NUM> includes a display module <NUM>.

The WiFi module <NUM> is configured to: when an access request for accessing a WiFi network is received, access the first WiFi network by using a first WiFi access circuit in N WiFi access circuits, and is further configured to: on condition of using the first WiFi access circuit to access the first WiFi network, if an access request for accessing the second WiFi network is received, access the second WiFi network by using the second WiFi access circuit. N is a natural number greater than or equal to <NUM>.

The display module <NUM> is configured to: after the WiFi module accesses the first WiFi network and the second WiFi network, synchronously display a first WiFi network access identifier and a second WiFi network access identifier on a display interface corresponding to the container. The first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is accessed.

Optionally, the display module <NUM> is further configured to synchronously display connection signal strength of the first WiFi network and connection signal strength of the second WiFi network on the display interface.

Optionally, the apparatus <NUM> or the container <NUM> further includes a service distribution module <NUM>. The service distribution module <NUM> may be a part of an operating system, that is, the container <NUM> includes the service distribution module <NUM>, or certainly, may be a part of software run by a WiFi CPU. For example, in <FIG>, the service distribution module <NUM> exists in the container <NUM>. The service distribution module <NUM> is configured to: after the WiFi module accesses the first WiFi network and the second WiFi network, select, according to a detected WiFi network connection manner entered by a user, at least one of the first WiFi network or the second WiFi network to carry a data service.

Specifically, the service distribution module <NUM> is configured to: detect the WiFi network connection manner entered by the user, and select, from the first WiFi network and the second WiFi network according to the detected WiFi network connection manner entered by the user, a WiFi network having higher connection signal strength to carry the data service; or.

The service distribution module <NUM> uses, according to a traffic balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service, or uses, according to a service request quantities balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service.

Optionally, the WiFi module <NUM> is further configured to perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network and the second WiFi network. Optionally, the container <NUM> is configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state.

For better understanding of the method and the apparatus shown in <FIG> in the embodiments of this application, the following further describes an implementation of a terminal by using a more detailed schematic diagram of an internal structure stack of a terminal shown in <FIG> and <FIG>.

As shown in <FIG> and <FIG>, a terminal <NUM> includes a WiFi setting module <NUM>, at least two AP state machines <NUM> (two AP state machines are used as an example in the figure), at least two STA P2P state machines <NUM> (two STA P2P state machines are used as an example in the figure), a service distribution module <NUM>, an interface <NUM>, at least two encryption network access logical entities <NUM> (two encryption network access logical entities are used as an example in the figure), at least two WLANOs <NUM> (two WLANOs are used as an example in the figure), at least two P2P0s <NUM> (two P2P0s are used as an example in the figure), at least two P2Ps <NUM> (two P2Ps are used as an example in the figure), at least two scheduling modules <NUM>, a WiFi protocol stack <NUM> (two WiFi protocol stacks are used as an example in the figure), and a WiFi access circuit <NUM>. The WiFi setting module <NUM>, the at least two AP state machines <NUM>, and the at least two STA P2P state machines <NUM> may be included in one container, and run by a CPU. Optionally, the service distribution module <NUM> is also included in the container. Alternatively, the service distribution module <NUM> may be run by a WiFi CPU. The WiFi CPU is further configured to run and implement the interface <NUM>, the at least two encryption network access logical entities <NUM>, the at least two WLANOs <NUM>, the at least two P2P0s <NUM>, the at least two P2Ps <NUM>, the at least two scheduling modules <NUM>, and the WiFi protocol stack <NUM>. In the claimed embodiment the WiFi CPU and the WiFi access circuit <NUM> are integrated into a WiFi chip, but in other non-claimed embodiments they may be implemented separately.

A module that has a same module name as that of a module in <FIG> and <FIG> also has a same function as that of the module in <FIG> and <FIG>, and details are not described herein again. Differently, the terminal <NUM> shown in <FIG> and <FIG> may operate one operating system, that is, may operate in a single-container mode. Therefore, one WiFi setting module <NUM> is included in <FIG> and <FIG>, that is, setting is performed by using a setting interface of one operating system. Likewise, it can be learned from <FIG> and <FIG> that it may be considered that the terminal <NUM> has two channels that share one CPU. One channel may be corresponding to accessing one WiFi network, the single container of the terminal <NUM> may use either of the channels, and when using the two channels at the same time according to an appropriate software design, the terminal <NUM> can be connected to two WiFi networks at the same time, that is, implement a WiFi dual standby function. Likewise, a terminal with more than two channels can implement a WiFi multi-standby function. In this embodiment, two channels are used as an example, and are not intended to limit the protection scope.

The service distribution module <NUM> is configured to execute a function executed by the service distribution module <NUM> in <FIG>. In this embodiment of this application, the terminal may use different WiFi access circuits for different services in one operating system by using the added service distribution module, so that a concurrent function that multiple WiFi networks are used for multiple services is implemented, and one terminal can be connected to two or more different WiFi APs at the same time, that is, a WiFi dual standby or multi-standby function is implemented. In addition, a new interface manner is provided, so that at least two WiFi identifiers can be displayed on a display interface of the terminal, and a display manner of WiFi dual standby display or WiFi multi-standby display is implemented.

Persons skilled in the art should understand that the embodiments of this application may be provided as a method, a system, or a computer program product. Therefore, a part of content in the method designed in this application may be implemented by using software, or in a form of embodiments with a combination of software and hardware. For example, a software-driven program, such as an operating system program, or container software, or necessary software required by a WiFi CPU, that is executed by a main CPU or the WiFi CPU may be stored in the storage media, and executed by a corresponding processor.

This application is described with reference to the flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to the embodiments of this application. It should be understood that computer program instructions may be used to implement each process and/or each block in the flowcharts and/or the block diagrams and a combination of a process and/or a block in the flowcharts and/or the block diagrams. These computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of any other programmable data processing device generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.

Further embodiments of the present application provide a method and an apparatus for accessing a WiFi network by a terminal, so as to support the terminal in being connected to two or more WiFi networks at the same time, and therefore, WiFi network is applied in a safer and more fluent manner.

The embodiments of this application provide the following specific technical solutions.

According to one aspect, an embodiment of this application provides a method for accessing a WiFi network. The method is applied to a terminal, the terminal includes N WiFi access circuits and at least one processor, the at least one processor is configured to run a software program to form M containers, one container may be equivalent to one operating system, switch operation may be performed between different containers, each container corresponds to one WiFi network access service, the M containers are capable of operating at the same time, tasks and data of different WiFi network access services during operation of different containers are mutually isolated, and M and N are natural numbers greater than or equal to <NUM>. The method includes: accessing, by the terminal when a first container in the M containers operates, a first WiFi network by using a first WiFi access circuit in the N WiFi access circuits; and accessing, by the terminal, a second WiFi network by using a second WiFi access circuit in the N WiFi access circuits when the terminal switches from operation of the first container to operation of a second container in the M containers, where the first container continues operating in a background running manner, and the terminal continues using the first WiFi access circuit to access the first WiFi network. In this way, when switching to the operation of the second container, the terminal uses the second WiFi access circuit to access the second WiFi network. The first WiFi access circuit and the second WiFi access circuit are mutually independent, and therefore, the terminal can continue using the first WiFi access circuit in the background to access the first WiFi network, and a service is not disconnected, so that WiFi network application is safer, the service is more fluent, and user experience is improved.

In a possible design, the accessing, by the terminal when a first container operates, a first WiFi network by using a first WiFi access circuit in the N WiFi access circuits includes: accessing, by the terminal, the first WiFi network according to a preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits; and the accessing, by the terminal, a second WiFi network by using a second WiFi access circuit in the N WiFi access circuits when the terminal switches to operation of a second container includes: accessing, by the terminal, the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits.

In a possible design, the terminal further includes a WiFi processor; the accessing, by the terminal, the first WiFi network according to a preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits includes: accessing, by the WiFi processor of the terminal, the first WiFi network according to the preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits; and the accessing, by the terminal, the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits includes: accessing, by the WiFi processor of the terminal, the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits. In this way, when the terminal switches between the operation of different containers, the WiFi processor uses different WiFi access circuits to access different WiFi networks, so that a WiFi network disconnection due to a hardware design disadvantage during switch operation between a foreground operating system and a background operating system does not happen.

In a possible design, when the first WiFi network is accessed by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits, the method further includes: performing, by the WiFi processor of the terminal, at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network; and when the second WiFi network is accessed by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits, the method further includes: performing, by the WiFi processor of the terminal, at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the second WiFi network.

In a possible design, each container is configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state.

In a possible design, both M and N are equal to <NUM>.

According to another aspect, an embodiment of this application provides a method for accessing a WiFi network. The method is applied to a terminal, the terminal includes N WiFi access circuits and at least one processor, the at least one processor is configured to run a software program to form a container, the container may also be referred to as an operating system, and the container supports both a first WiFi network access service and a second WiFi network access service. The method includes: when receiving an access request for accessing the first WiFi network, accessing, by the terminal, the first WiFi network by using a first WiFi access circuit in the N WiFi access circuits; on condition of using the first WiFi access circuit to access the first WiFi network, if the terminal receives an access request for accessing the second WiFi network, accessing, by the terminal, the second WiFi network by using a second WiFi access circuit in the N WiFi access circuits; and synchronously displaying, by the terminal, a first WiFi network access identifier and a second WiFi network access identifier on a display interface corresponding to the container, where the first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is accessed; and N is a natural number greater than or equal to <NUM>. According to the foregoing method, one terminal can be connected to two or more different WiFi APs at the same time, that is, a WiFi dual standby or multi-standby function is implemented, so that a WiFi network is not disconnected during switch operation between two WiFi APs, a service is more fluent, and user experience is improved. A new interface manner is provided, so that at least two WiFi identifiers can be displayed on the display interface of the terminal, and a display manner of WiFi dual standby display or WiFi multi-standby display is implemented.

In a possible design, after the terminal accesses the first WiFi network and the second WiFi network, the terminal synchronously displays connection signal strength of the first WiFi network and connection signal strength of the second WiFi network on the display interface.

In a possible design, after the terminal accesses the first WiFi network and the second WiFi network, the method further includes: selecting, by the terminal according to a detected WiFi network connection manner entered by a user, at least one of the first WiFi network or the second WiFi network to carry a data service.

In a possible design, the WiFi network connection manner is used by the user to select a WiFi network to carry the data service. After the terminal accesses the first WiFi network and the second WiFi network, the terminal selects, from the first WiFi network and the second WiFi network according to the detected WiFi network connection manner entered by the user, a WiFi network having higher connection signal strength to carry the data service. Alternatively, the terminal selects, according to the detected WiFi network connection manner entered by the user, a WiFi network designated by the user, to carry the data service. Alternatively, the terminal selects, according to the detected WiFi network connection manner entered by the user and according to a load balancing policy, the first WiFi network and the second WiFi network to carry the data service together. In this way, a preferred WiFi is selected, a service of the obtained WiFi network is better, multiple WiFi systems are used to implement WiFi multi-system concurrence, and different WiFi systems are used for different services, so that all the different services can obtain more fluent network services.

In a possible design, that the terminal selects, according to the load balancing policy, the first WiFi network and the second WiFi network to carry the data service together includes: The terminal uses, according to a traffic balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service. Alternatively, the terminal uses, according to a service request quantities balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service. In this way, when different WiFi networks carry the data service together, traffic can be balanced. In a possible design, the terminal further includes a WiFi processor; and the method further includes: performing, by the WiFi processor of the terminal, at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network and the second WiFi network.

In a possible design, the container is configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state.

According to still another aspect, an embodiment of this application provides an apparatus for accessing a WiFi network. The apparatus includes M containers that are capable of operating at the same time and a WiFi module, each container corresponds to one WiFi network access service, tasks and data of different WiFi network access services during operation of different containers are mutually isolated, and the M containers include a first container and a second container; the WiFi module is configured to: when the first container operates, access a first WiFi network by using a first WiFi access circuit, and is further configured to: when the apparatus switches from operation of the first container to operation of the second container, access a second WiFi network by using the second WiFi access circuit; and the first container is further configured to: when the WiFi module accesses the second WiFi network by using the second WiFi access circuit, continue operating in a background running manner, and the WiFi module is further configured to continue using the first WiFi access circuit to access the first WiFi network, where M and N are natural numbers greater than or equal to <NUM>. In this way, when switching to the operation of the second container, the terminal uses the second WiFi access circuit to access the second WiFi network. The first WiFi access circuit and the second WiFi access circuit are mutually independent, and therefore, the terminal can continue using the first WiFi access circuit in the background to access the first WiFi network, and a service is not disconnected, so that WiFi network application is safer, the service is more fluent, and user experience is improved. In a possible design, the WiFi module is configured to: access the first WiFi network according to a preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container, and access the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container.

In a possible design, the WiFi module is further configured to: when accessing the first WiFi network by using the first WiFi access circuit corresponding to the first container, perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network; and when accessing the second WiFi network by using the second WiFi access circuit corresponding to the second container, perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the second WiFi network.

According to still another aspect, an embodiment of this application provides an apparatus for accessing a WiFi network. The apparatus includes a container supporting both a first WiFi network access service and a second WiFi network access service and a WiFi module, and the container includes a display module, the WiFi module is configured to: when an access request for accessing the first WiFi network is received, access the first WiFi network by using a first WiFi access circuit, and is further configured to: on condition of using the first WiFi access circuit to access the first WiFi network, if an access request for accessing the second WiFi network is received, access the second WiFi network by using the second WiFi access circuit; and the display module is configured to: after the WiFi module accesses the first WiFi network and the second WiFi network, synchronously display a first WiFi network access identifier and a second WiFi network access identifier on a display interface corresponding to the container, where the first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is accessed. According to the foregoing method, one terminal can be connected to two or more different WiFi APs at the same time, that is, a WiFi dual standby or multi-standby function is implemented, so that a WiFi network is not disconnected during switch operation between two WiFi APs, a service is more fluent, and user experience is improved. A new interface display manner is provided, so that at least two WiFi identifiers can be displayed on the display interface of the terminal, and a display manner of WiFi dual standby display or WiFi multi-standby display is implemented.

In a possible design, the display module is further configured to synchronously display connection signal strength of the first WiFi network and connection signal strength of the second WiFi network on the display interface.

In a possible design, the apparatus or the container further includes a service distribution module, and the service distribution module is configured to: after the WiFi module accesses the first WiFi network and the second WiFi network, select, according to a detected WiFi network connection manner entered by a user, at least one of the first WiFi network or the second WiFi network to carry a data service.

In a possible design, the WiFi network connection manner is used by the user to select a WiFi network to carry the data service. After the terminal accesses the first WiFi network and the second WiFi network, the terminal selects, from the first WiFi network and the second WiFi network according to the detected WiFi network connection manner entered by the user, a WiFi network having higher connection signal strength to carry the data service. Alternatively, the terminal selects, according to the detected WiFi network connection manner entered by the user, a WiFi network designated by the user, to carry the data service Alternatively, the terminal selects, according to the detected WiFi network connection manner entered by the user and according to a load balancing policy, the first WiFi network and the second WiFi network to carry the data service together. In this way, a preferred WiFi is selected, a service of the obtained WiFi network is better, multiple WiFi systems are used to implement WiFi multi-system concurrence, and different WiFi systems are used for different services, so that all the different services can obtain more fluent network services.

In a possible design, that the terminal selects, according to the load balancing policy, the first WiFi network and the second WiFi network to carry the data service together includes: The terminal uses, according to a traffic balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service. Alternatively, the terminal uses, according to a service request quantities balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service. In this way, when different WiFi networks carry the data service together, traffic can be balanced. In a possible design, the WiFi module is further configured to perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network and the second WiFi network.

According to yet another aspect, an embodiment of this application provides a terminal, including a WiFi processor, N WiFi access circuits, a memory, and at least one processor. The memory is configured to store a software program, the at least one processor is coupled to the memory, and is configured to read the software program from the memory and run the software program to form M containers, where the M containers are capable of operating at the same time, each container corresponds to one WiFi network access service, and tasks and data of different WiFi network access services during operation of different containers are mutually isolated; the WiFi processor is configured to: when a first container in the M containers operates, access a first WiFi network by using a first WiFi access circuit in the N WiFi access circuits, and is further configured to: when the terminal switches from the operation of the first container to operation of a second container in the M containers, access a second WiFi network by using a second WiFi access circuit in the N WiFi access circuits; and the at least one processor is further configured to: when the WiFi processor accesses the second WiFi network by using the second WiFi access circuit, continue running the first container in a background running manner, and the WiFi processor is further configured to continue using the first WiFi access circuit to access the first WiFi network, where each of the N WiFi access circuits is used for access to one corresponding WiFi network, and M and N are natural numbers greater than or equal to <NUM>. In this way, when switching to the operation of the second container, the terminal uses the second WiFi access circuit to access the second WiFi network. The first WiFi access circuit and the second WiFi access circuit are mutually independent, and therefore, the terminal can continue using the first WiFi access circuit in the background to access the first WiFi network, and a service is not disconnected, so that WiFi network application is safer, the service is more fluent, and user experience is improved.

In a possible design, the WiFi processor is configured to: access the first WiFi network according to a preset mapping relationship between containers and WiFi access circuits by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits; and access the second WiFi network according to the mapping relationship by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits.

In a possible design, the WiFi processor is further configured to: when accessing the first WiFi network by using the first WiFi access circuit corresponding to the first container in the N WiFi access circuits, perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network; and when accessing the second WiFi network by using the second WiFi access circuit corresponding to the second container in the N WiFi access circuits, perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the second WiFi network.

According to yet another aspect, an embodiment of this application provides a terminal. The terminal includes a WiFi processor, N WiFi access circuits, a memory, and at least one processor. The memory is configured to store a software program; the at least one processor is coupled to the memory, and is configured to read the software program from the memory and run the software program to form a container, where the container supports both a first WiFi network access service and a second WiFi network access service; the WiFi processor is configured to: when an access request for accessing the first WiFi network is received, access the first WiFi network by using a first WiFi access circuit in the N WiFi access circuits, and on condition of using the first WiFi access circuit to access the first WiFi network, if an access request for accessing the second WiFi network is received, access the second WiFi network by using a second WiFi access circuit in the N WiFi access circuits; and the at least one processor is configured to drive a display interface corresponding to the container to synchronously display a first WiFi network access identifier and a second WiFi network access identifier, where the first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is accessed; and N is a natural number greater than or equal to <NUM>. According to the foregoing method, one terminal can be connected to two or more different WiFi APs at the same time, that is, a WiFi dual standby or multi-standby function is implemented, so that a WiFi network is not disconnected during switch operation between two WiFi APs, a service is more fluent, and user experience is improved. A new interface manner is provided, so that at least two WiFi identifiers can be displayed on the display interface of the terminal, and a display manner of WiFi dual standby display or WiFi multi-standby display is implemented.

In a possible design, the terminal further includes a display, and the display interface is displayed on the display.

In a possible design, the at least one processor is further configured to drive the display interface to synchronously display connection signal strength of the first WiFi network and connection signal strength of the second WiFi network.

In a possible design, the WiFi processor is further configured to: after accessing the first WiFi network and the second WiFi network, select, according to a detected WiFi network connection manner entered by a user, at least one of the first WiFi network or the second WiFi network to carry a data service.

In a possible design, that the terminal selects, according to the load balancing policy, the first WiFi network and the second WiFi network to carry the data service together includes: The terminal uses, according to a traffic balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service. Alternatively, the terminal uses, according to a service request quantities balancing policy of the first WiFi network and the second WiFi network, the first WiFi network and the second WiFi network to carry the data service. In this way, when different WiFi networks carry the data service together, traffic can be balanced. In a possible design, the WiFi processor is further configured to perform at least one of channel resource scheduling, Media Access Control, or encryption/decryption related to accessing the first WiFi network and the second WiFi network.

In a possible design, the container is further configured to implement at least one of a user interface function of a corresponding WiFi network access service, maintenance of an access point start state, or maintenance of a station peer to peer network start state.

Claim 1:
A terminal (<NUM>) comprising an apparatus (<NUM>) for accessing a Wireless Fidelity, WiFi, network, the apparatus comprising:
a WiFi processor (<NUM>), configured to implement a WiFi-related operation function;
a main central processing unit, CPU, configured to run one operating system and an application software to drive a display interface;
N WiFi access circuits, configured to access N WiFi networks to implement simultaneous data transmission, wherein the N WiFi networks operate on different radio frequency bands or each operate on a radio frequency band of <NUM>, the different radio frequency bands comprises a radio frequency band of <NUM> and a radio frequency band of <NUM>, and N is a natural number greater than or equal to two;
wherein each WiFi access circuit of the N WiFi access circuits comprises corresponding Media Access Control, MAC, hardware (<NUM>) and physical layer, PHY, hardware (<NUM>) and is configured to access a WiFi network corresponding to the WiFi access circuit;
wherein the N WiFi access circuits are integrated in a WiFi chip (<NUM>), and the WiFi processor (<NUM>) is integrated into the WiFi chip (<NUM>); and
wherein the MAC hardware (<NUM>) and the PHY hardware (<NUM>) of the N WiFi access circuits share the WiFi processor (<NUM>);
wherein the CPU is configured to drive the display interface corresponding to the one operating system to synchronously display a first WiFi network access identifier and a second WiFi network access identifier after a first WiFi network is accessed by using a first WiFi access circuit of the N WiFi access circuits and a second WiFi network is also accessed by using a second WiFi access circuit of the N WiFi access circuits, and wherein the first WiFi network access identifier represents that the first WiFi network is accessed, and the second WiFi network access identifier represents that the second WiFi network is also accessed;
and wherein connection signal strength of the first WiFi network and connection signal strength of the second WiFi network are displayed on the display interface after the first WiFi network and the second WiFi network are accessed.