CN112312394A - Wireless fidelity Wi-Fi management method, device and related equipment - Google Patents
Wireless fidelity Wi-Fi management method, device and related equipment Download PDFInfo
- Publication number
- CN112312394A CN112312394A CN202011365117.1A CN202011365117A CN112312394A CN 112312394 A CN112312394 A CN 112312394A CN 202011365117 A CN202011365117 A CN 202011365117A CN 112312394 A CN112312394 A CN 112312394A
- Authority
- CN
- China
- Prior art keywords
- control instruction
- instruction
- manager
- control
- driver
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/06—Authentication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/02—Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
- H04W84/10—Small scale networks; Flat hierarchical networks
- H04W84/12—WLAN [Wireless Local Area Networks]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the application discloses a wireless fidelity Wi-Fi management method, a device and related equipment. The Wi-Fi management method is applied to terminal equipment, and the terminal equipment comprises the following steps: a web application, a Wi-Fi manager, a Wi-Fi driver, and Wi-Fi firmware, the Wi-Fi driver hosted by the Wi-Fi manager, wherein: the network application program receives the control instruction and sends the control instruction to the Wi-Fi manager; the Wi-Fi manager verifies whether the control instruction is legal or not, and sends the control instruction to the Wi-Fi driver after verifying that the control instruction is legal; and the Wi-Fi driver drives the Wi-Fi firmware to execute the corresponding operation of the control instruction according to the control instruction. The method is beneficial to simplifying the communication calling process of the network application program and the Wi-Fi firmware, improving the Wi-Fi management efficiency in a real-time operation environment and reducing the memory space occupied by the Wi-Fi software architecture.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for managing wireless fidelity Wi-Fi, and a related device.
Background
A Wireless Fidelity (Wi-Fi) software architecture is an important module for designing a terminal device, and the terminal device can manage the Wi-Fi state of the terminal device based on the Wi-Fi software architecture. A Wi-Fi software architecture based on a Linux system is shown in fig. 1, and the Wi-Fi software architecture includes: the system comprises network applications (the network application corresponding to the AP and the network application corresponding to the STA), Wi-Fi middleware hostapd and wpa _ supplant, a libnl function library, a Wi-Fi Driver (Driver) depending on a Linux kernel, and Wi-Fi Firmware (Firmware), wherein the Wi-Fi Driver is hosted in the Linux kernel. When the device is used as a wireless Access Point (AP) in a Wi-Fi network, the AP network application program transmits a control instruction to a hostapd of a Wi-Fi middleware in a socket communication mode, the hostapd transmits the instruction to a Wi-Fi Driver through netlink communication based on a libnl function library, so that the Wi-Fi Driver drives the Wi-Fi Firmware to execute the related functions of the AP based on the control instruction. When the device is used as a connection Station (STA) in a Wi-Fi network, the network application program transmits a control instruction to a wpa _ subordinate of the Wi-Fi middleware in a socket (socket) communication mode, and the wpa _ subordinate transmits the instruction to a Wi-Fi Driver through netlink communication based on a libnl function library so that the Wi-Fi Driver drives the Wi-Fi Firmware to execute relevant functions of the STA based on the control instruction.
However, the application program receives the control instruction and the Wi-Fi Firmware executes related functions based on the control instruction, multiple communications are needed, the calling program is complex, the efficiency is low in a Real-time operating system (RTOS) environment, and the Wi-Fi software architecture occupies more memory space.
Disclosure of Invention
The embodiment of the application provides a wireless fidelity Wi-Fi management method, a wireless fidelity Wi-Fi management device and related equipment, which are beneficial to simplifying the communication calling process of a network application program and Wi-Fi firmware and improving the Wi-Fi management efficiency under a real-time operation environment.
In a first aspect, an embodiment of the present application provides a wireless fidelity Wi-Fi management method, where the method is applied to a terminal device, and the terminal device includes: the system comprises a network application program, a Wi-Fi Manager, a Wi-Fi Driver and a Wi-Fi Firmware, wherein the Wi-Fi Driver is hosted by the Wi-Fi Manager, and comprises:
the network application program receives the control instruction and sends the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to the wireless access point AP or a control instruction corresponding to the station STA; the Wi-Fi Manager verifies whether the control instruction is legal or not, and sends the control instruction to the Wi-Fi Driver after verifying that the control instruction is legal; and the Wi-Fi Driver drives the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
Therefore, the network application program sends the control instruction to the Wi-Fi manager in a function calling mode, the Wi-Fi manager directly sends the control instruction to the Wi-Fi driver after verifying that the control instruction is legal, so that the Wi-Fi firmware is driven to execute the corresponding operation of the control instruction, the socket communication calling time of the network application program and the Wi-Fi middleware can be saved, the communication calling process between the network application program and the Wi-Fi firmware is simplified, and the Wi-Fi management efficiency under a real-time operating environment is improved.
In one possible implementation, the network application calls the first application programming interface API to send the control instruction to the Wi-Fi Manager; the Wi-Fi Manager calls the second API to send a control instruction to the Wi-Fi Driver.
In one possible implementation, the control instruction carries an identifier of the control instruction, the Wi-Fi Manager comprises a state machine, the Wi-Fi Manager determines the type of the control instruction based on the identifier of the control instruction, and the type of the control instruction comprises a control instruction corresponding to the AP and a control instruction corresponding to the STA; the Wi-Fi Manager calls a state machine to acquire a first state corresponding to the type of the control instruction based on the type of the control instruction; the Wi-Fi Manager calls a state machine to determine a second state corresponding to the control instruction based on the type of the control instruction and the control instruction; and the Wi-Fi Manager calls a state machine to verify whether the control instruction is legal or not according to the first state and the second state.
In one possible implementation, the control instruction is a control instruction corresponding to the STA, and the control instruction includes: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
In one possible implementation, the control instruction is a control instruction corresponding to the AP, and the control instruction includes: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
In a second aspect, an embodiment of the present application provides a Wi-Fi management apparatus, where the apparatus is configured in a terminal device, and the terminal device includes: the system comprises a network application program, a Wi-Fi Manager, a Wi-Fi Driver and a Wi-Fi Firmware, wherein the Wi-Fi Driver is hosted by the Wi-Fi Manager, and the Wi-Fi Driver is hosted by the Wi-Fi Manager, wherein:
the network application program is used for receiving a control instruction and sending the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to the wireless access point AP or a control instruction corresponding to the station STA;
the Wi-Fi Manager is used for verifying whether the control instruction is legal or not and sending the control instruction to the Wi-Fi Driver after the control instruction is verified to be legal;
and the Wi-Fi Driver is used for driving the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
In one possible implementation, the network application is specifically configured to: calling a first Application Programming Interface (API) to send a control instruction to the Wi-Fi Manager; Wi-Fi Manager is specifically used for: and calling a second API to send a control instruction to the Wi-Fi Driver.
In a possible implementation, the control instruction carries an identifier of the control instruction, and the Wi-Fi Manager includes a state machine, and is specifically configured to: determining the type of the control instruction based on the identifier of the control instruction, wherein the type of the control instruction comprises a control instruction corresponding to the AP and a control instruction corresponding to the STA; based on the type of the control instruction, calling a state machine to acquire a first state corresponding to the type of the control instruction; based on the type of the control instruction and the control instruction, calling a state machine to determine a second state corresponding to the control instruction; and calling a state machine to verify whether the control instruction is legal or not according to the first state and the second state.
In a possible implementation, the control instruction is a control instruction corresponding to the STA, and the control instruction includes: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
In one possible implementation, the control instruction is a control instruction corresponding to the AP, and the control instruction includes: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes:
a memory for storing a computer program;
a processor invoking a computer program for performing the following operations:
the network application program receives the control instruction and sends the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to the wireless access point AP or a control instruction corresponding to the station STA; the Wi-Fi Manager verifies whether the control instruction is legal or not, and sends the control instruction to the Wi-Fi Driver after verifying that the control instruction is legal; and the Wi-Fi Driver drives the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer software instructions for the user equipment, which includes a program for executing the method according to any one of the first aspect.
Drawings
FIG. 1 is a schematic diagram of a Wi-Fi software architecture based on a Linux system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a Wi-Fi management method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a Wi-Fi software architecture according to an embodiment of the present disclosure;
fig. 4 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 5 is a schematic flowchart of another Wi-Fi management method according to an embodiment of the application;
fig. 6 is a schematic structural diagram of a Wi-Fi management apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be understood that the terms "first" and "second", etc. in the description and drawings of the present application are used for distinguishing different objects or for distinguishing different processes for the same object, and are not used for describing a specific order of the objects. Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design method described herein as "exemplary" or "e.g.," should not be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion. In the examples of the present application, "A and/or B" means both A and B, and A or B. "A, and/or B, and/or C" means either A, B, C, or means either two of A, B, C, or means A and B and C. The technical solution in the present application is described below with reference to the accompanying drawings.
A terminal device referred to in this application may also be called a terminal, user equipment, access terminal, subscriber unit, subscriber station, mobile station, remote terminal, mobile device, user terminal, user agent, or user equipment. The terminal device in the embodiment of the application may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), an internet of things (IoT) device, and the like.
To facilitate an understanding of the embodiments disclosed herein, some concepts related to the embodiments of the present application will be first explained. The description of these concepts includes, but is not limited to, the following.
Wi-Fi middleware hostapd: the application is a daemon program of a user space, and is mainly used on an Access Point (AP) and an authentication server, and the daemon program is used as an authentication server of the AP and is responsible for controlling access and authentication of management stations (for example, generally, a PC with a wireless network card).
Wi-Fi middleware wpa _ suppplierant: wpa _ supplicant is a separately running daemon for configuring the wireless network. The core of the system is a message loop, and a Wi-Fi Protected Access (WPA) state machine, a control command, a driving event, configuration information and the like are processed in the message loop. The WPA authentication client is an application layer authentication client of the WPA and is responsible for finishing work such as login, encryption and the like related to authentication.
library libnl function: the API interface is used for providing a set of Linux system communication based on a netlink protocol for Wi-Fi middleware hostapd or wpa _ suppplielicant.
Wi-Fi firmware (firmware): is a type of software embedded in a hardware device. Typically it is in a flash memory or EEPROM or PROM located in an Application Specific Integrated Circuit (ASIC) or Programmable Logic Device (PLD), some of which can be updated by the user. The method can be applied to very wide electronic products, and the shadow can be seen from a remote controller, a calculator, a keyboard and a hard disk in a computer, and even an industrial robot.
Based on the above description, an embodiment of the present application proposes a Wi-Fi management method as shown in fig. 2, where the method is applied to a terminal device, where the terminal device includes a Wi-Fi software architecture as shown in fig. 3, a web application (AP web application and STA web application), a Wi-Fi Manager (Manager), a Wi-Fi Driver, and a Wi-Fi Firmware, where the Wi-Fi Driver is hosted by the Wi-Fi Manager, and the Wi-Fi management method may include steps S201 to S203:
s201: and the network application program receives the control instruction and sends the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to the wireless access point or a control instruction corresponding to the site.
The user inputs a control instruction through the network application program, and the network application program forwards the control instruction to the Wi-Fi Manager. The network application may be understood as an application that may call (or turn on) a network hotspot (e.g., an AP network application in fig. 3), and/or may call (or turn on/use) an application use of Wi-Fi (e.g., an STA network application in fig. 3). When a user inputs a control instruction through an AP network application program of the terminal equipment, the control instruction is a control instruction corresponding to the wireless access point. When a user inputs a control instruction through an STA network application program of the terminal equipment, the control instruction is a control instruction corresponding to the station.
It should be noted that the control instruction is a control instruction corresponding to the AP, and may be understood as a control instruction received when the terminal device is used as the AP, for example, a network hotspot opening instruction. Similarly, the control instruction is a control instruction corresponding to a Station (STA), and may be understood as a control instruction received when the terminal device is taken as an STA, for example, a Wi-Fi instruction is turned on. In an application scenario, the same terminal device may serve as both an STA and an AP. As shown in fig. 4, fig. 4 is a schematic diagram of an application scenario. In the application scenario, the terminal device 1 serves as an AP to provide a wireless network for the terminal device 2, and meanwhile, in the application scenario, the terminal device 1 also serves as a network hotspot where an STA is connected to the terminal device 3. Wi-FiDriver is hosted by the Wi-Fi Manager can be understood as the Wi-FiDriver is hosted by the Wi-Fi Manager process.
In a possible implementation, when the control instruction is a control instruction corresponding to the STA, the control instruction may include: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
In one possible implementation, the control instruction is a control instruction corresponding to the AP, and the control instruction may include: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
In one possible implementation, the network Application receives the control command and invokes an Application Programming Interface (API) to send the control command to the Wi-Fi Manager. By the method, the network application program transmits the control instruction to the Wi-Fi Manager in a function call (function call) mode, and the efficiency of transmitting the control instruction to the Wi-Fi Manager is improved.
S202: and the Wi-Fi Manager verifies whether the control instruction is legal or not, and sends the control instruction to the Wi-Fi Driver after verifying that the control instruction is legal.
The Wi-Fi Manager verifies whether the control instruction is legal or not by using a logic unit of the Wi-Fi Manager, namely, whether the control instruction can be executed by the terminal equipment or not is verified, if the control instruction can be executed by the terminal equipment, the control instruction is determined to be legal, and the control instruction is sent to the Wi-Fi Driver.
The verification of whether the control instruction is legal can be understood as verifying whether the control instruction is wrong. For example, the terminal device is not configured with a function as an STA, i.e., cannot connect to Wi-Fi (such as a desktop computer). And if the user inputs an instruction for opening the terminal device Wi-Fi, the control instruction is an error instruction, namely the control instruction is illegal.
Illustratively, the terminal device may be an STA, and the Wi-Fi band that the STA supports scanning at this time is the Wi-Fi of the 4th Generation mobile communication (4G) band. If the Wi-Fi Manager receives a control command for scanning a Wi-Fi signal in an FR1 band, and the FR1 band is the 5th Generation mobile communication (5G) band, the Wi-Fi Manager may determine that the control command is illegal.
In one possible implementation, after the Wi-Fi Manager verifies that the control instruction is legal, the Wi-Fi Manager can call the second API to send the control instruction to the Wi-Fi Driver. By the method, the Wi-Fi Manager transmits the control instruction to the Wi-Fi Driver in a function call (function call) mode, and the efficiency of transmitting the control instruction to the Wi-Fi Driver by the Wi-Fi Manager is improved.
S203: and the Wi-Fi Driver drives the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
The Wi-Fi over receives a legal control instruction sent by the Wi-Fi Manager, and drives the Wi-Fi Firmware to execute the control instruction according to the legal control instruction, namely the Wi-Fi Firmware executes the operation corresponding to the control instruction.
In the embodiment of the application, after the terminal device receives a control instruction input by a user through a network application program, the network application program sends the control instruction to the Wi-Fi Manager in a function calling mode, and after the Wi-Fi Manager verifies that the control instruction is legal, the control instruction is sent to the Wi-Fi Driver in a function calling mode, so that the Wi-Fi Driver drives the Wi-Fi Firmware to execute corresponding operation of the control instruction according to the control instruction. By the method, the instruction transmission process of receiving the control instruction and executing the operation corresponding to the control instruction by the terminal is simplified, and the efficiency of managing and operating Wi-Fi or network hotspots in the RTOS environment is improved. Meanwhile, due to the fact that the transmission process of the control command is simplified, the Wi-Fi software architecture (comprising the network application program, the Wi-Fi Manager, the Wi-Fi Driver and the Wi-Fi Firmware) occupies a small memory of the terminal device, and is more suitable for the terminal device (such as IoT device) with the small memory.
Based on the above description, an embodiment of the present application provides another Wi-Fi management method as shown in fig. 5, where the method is applied to a terminal device, and the terminal device includes: the Wi-Fi management method comprises the following steps of S501-S506, wherein the Wi-Fi Manager is hosted by the Wi-Fi Manager, the control instruction carries an identifier of the control instruction, the Wi-Fi Manager comprises a state machine, and the method comprises the following steps:
s501: and the network application program receives the control instruction and sends the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to the wireless access point AP or a control instruction corresponding to the station STA.
The specific implementation manner of step S501 may refer to the specific implementation manner of step S201 in the foregoing embodiment, and will not be described in detail herein.
S502: and the Wi-Fi Manager determines the type of the control instruction based on the identification of the control instruction, wherein the type of the control instruction comprises a control instruction corresponding to the AP and a control instruction corresponding to the STA.
The identifier of the control command may be understood as a character or a character string that uniquely corresponds to the control command. Exemplarily, as shown in table 1, the control instruction corresponding to the AP and the control instruction corresponding to the STA are identified.
TABLE 1
As can be seen from table 1, when the identifier of the control instruction received by the Wi-Fi Manager is identifier 01-identifier 05, it can be determined that the control instruction type is the control instruction corresponding to the STA. When the mark of the control instruction received by the Wi-Fi Manager is the mark 06-09, the control instruction type can be determined to be the control instruction corresponding to the AP.
S503: and calling a state machine to acquire a first state corresponding to the type of the control instruction by the Wi-Fi Manager based on the type of the control instruction.
And calling the state machine to acquire a first state of the terminal equipment at the previous moment corresponding to the control instruction type by the Wi-Fi Manager according to the control instruction type. The previous time refers to a time before the terminal device receives the control instruction, or may be understood as a current time when the terminal device does not execute the control instruction.
Illustratively, in the application scenario as shown in fig. 4, the terminal device 1 functions as both an STA (i.e., the network hotspot where the terminal device 1 is currently connected to the terminal device 2) and an AP (i.e., the network hotspot where the terminal device 3 is currently connected to the terminal device 1). If the type of the control instruction received by the Wi-Fi Manager is the control instruction corresponding to the STA, the Wi-Fi Manager calls a state machine to acquire a first state when the terminal device is used as the STA, and the first state is as follows: connect Wi-Fi state.
S504: and the Wi-Fi Manager calls the state machine to determine a second state corresponding to the control instruction based on the type of the control instruction and the control instruction.
And the Wi-Fi Manager calls the state machine to determine that the terminal equipment is in a second state of the type of the control instruction after the terminal equipment executes the control instruction according to the type of the control instruction and the control specification.
Illustratively, in the application scenario as shown in fig. 4, the terminal device 1 functions as both an STA (i.e., the network hotspot where the terminal device 1 is currently connected to the terminal device 2) and an AP (i.e., the network hotspot where the terminal device 3 is currently connected to the terminal device 1). If the control instruction received by the Wi-Fi Manager is an instruction for disconnecting the Wi-Fi network, and it can be seen that the type of the control instruction is a control instruction corresponding to the STA, the Wi-Fi Manager invokes a state machine to determine a second state corresponding to the control instruction, which can be understood that if the terminal device executes the control instruction, the second state of the terminal device as the STA is: the connected state is disconnected.
S505: and the Wi-Fi Manager calls a state machine to verify whether the control instruction is legal or not according to the first state and the second state.
And the Wi-Fi Manager verifies whether the control instruction is legal or not according to the first state, the second state and the logic sequence among the states.
It should be noted that, the logic sequence between the states may be understood that, after the terminal device executes the control instruction, the terminal device can switch from the first state to the second state, and then it is determined that the control instruction is legal. For example, when the first state of the terminal device is the STA mode on state, the terminal device may execute an instruction to scan the Wi-Fi network, and switch the STA mode state of the terminal device to the Wi-Fi scanning state. And when the first state of the terminal equipment is the Wi-Fi network connected state, executing an instruction of disconnecting the Wi-Fi network, and switching the STA mode of the terminal equipment to the network disconnection state. When the first state of the terminal device is the STA mode on state, the terminal device may execute an instruction to turn off the STA mode, and switch the STA mode state of the terminal device to the STA mode off state. When the first state of the terminal device is the AP mode on state, the terminal device can execute the instruction to turn off the AP mode, and the AP mode state of the terminal device is switched to the AP mode off state. When the first state of the terminal device is a hotspot opening state, the terminal device can execute a hotspot closing instruction, and the AP mode state of the terminal device is changed into a hotspot closing state.
Illustratively, when the type of the control command is a control command corresponding to the STA: and if the Wi-Fi network is disconnected, the second state corresponding to the control instruction is as follows: Wi-Fi network disconnect status. If the first state of the STA mode (that is, the terminal device is used as an STA) of the current terminal device obtained according to the type of the control instruction is: and if the Wi-Fi network is in the connected state, determining that the control command is: the "instruction to disconnect Wi-Fi network" is legitimate. If the first state obtained according to the type of the control instruction when the STA mode of the current terminal device (that is, the terminal device serves as the STA) is: and if the STA mode is in the off state, determining that the control command: the "instruction to disconnect Wi-Fi network" is illegal.
S506: and the Wi-Fi Driver drives the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
The specific implementation manner of step S506 may refer to the specific implementation manner of step S203 in the foregoing embodiment, and will not be described in detail herein.
In the embodiment of the present application, the terminal device determines the type of the control instruction according to the identifier of the control instruction, and then invokes the state machine to determine whether the control instruction is legal according to the type of the control instruction, so as to ensure that the terminal device executes the control instruction with legal operation logic, that is, as shown in fig. 4.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a wifi management apparatus according to an embodiment of the present disclosure, where the wifi management apparatus is used in a terminal device, and the wifi management apparatus 60 may include: a web application 601, a Wi-FiManager 602, a Wi-FiDriver 603, and a Wi-Firmware 604, the Wi-FiDriver hosted by the Wi-Fi Manager, wherein:
the network application 601 is configured to receive a control instruction and send the control instruction to the Wi-Fi Manager 602, where the control instruction includes a control instruction corresponding to an AP or a control instruction corresponding to an STA;
the Wi-Fi Manager 602 is configured to verify whether the control instruction is legal, and send the control instruction to the Wi-Fi Driver603 after verifying that the control instruction is legal;
the Wi-Fi Driver603 is used for driving the Wi-Fi Firmware 604 to execute the corresponding operation of the control instruction according to the control instruction.
In one possible implementation, the web application 601 is specifically configured to: calling a first Application Programming Interface (API) to send the control instruction to the Wi-Fi Manager; the Wi-Fi Manager 602 is specifically configured to: and calling a second API to send the control instruction to the Wi-Fi Driver.
In a possible implementation, the control instruction carries an identifier of the control instruction, the Wi-Fi Manager 602 includes a state machine, and the Wi-Fi Manager 602 is specifically configured to: determining the type of the control instruction based on the identification of the control instruction, wherein the type of the control instruction comprises a control instruction corresponding to an AP and a control instruction corresponding to an STA; calling the state machine to acquire a first state corresponding to the type of the control instruction based on the type of the control instruction; calling the state machine to determine a second state corresponding to the control instruction based on the type of the control instruction and the control instruction; and calling the state machine to verify whether the control instruction is legal or not according to the first state and the second state.
In one possible implementation, the control instruction is a control instruction corresponding to the STA, and the control instruction includes: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
In one possible implementation, the control instruction is a control instruction corresponding to the AP, and the control instruction includes: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application. The terminal 70 described in the embodiment of the present application includes: the processor 701, the memory 702, the processor 701 and the memory 702 are connected by one or more communication buses.
The Processor 701 may be a Central Processing Unit (CPU), and may also be other general purpose processors, Digital Signal Processors (DSP), Application Specific Integrated Circuits (ASIC), Field-Programmable Gate arrays (FPGA) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The processor 701 is configured to support the user equipment to perform the corresponding functions of the terminal equipment in the methods described in fig. 2 and fig. 5.
The memory 702 may include read-only memory and random access memory, and provides computer programs and data to the processor 701. A portion of the memory 702 may also include non-volatile random access memory. When the processor 701 calls the computer program, it is configured to:
the network application program receives a control instruction and sends the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to a wireless Access Point (AP) or a control instruction corresponding to a Station (STA);
the Wi-Fi Manager verifies whether the control instruction is legal or not, and sends the control instruction to the Wi-Fi Driver after verifying that the control instruction is legal;
and the Wi-Fi Driver drives the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
In one possible implementation, the processor 701 is specifically configured to:
the network application program calls a first Application Programming Interface (API) to send the control instruction to the Wi-Fi Manager;
the Wi-Fi Manager sends the control instruction to the Wi-Fi Driver, and the method comprises the following steps:
and the Wi-Fi Manager calls a second API to send the control instruction to the Wi-Fi Driver.
In a possible implementation, the control instruction carries an identifier of the control instruction, the Wi-Fi Manager includes a state machine, and the processor 701 is specifically configured to:
the Wi-Fi Manager determines the type of the control instruction based on the identification of the control instruction, wherein the type of the control instruction comprises a control instruction corresponding to the AP and a control instruction corresponding to the STA;
calling the state machine to acquire a first state corresponding to the type of the control instruction by the Wi-Fi Manager based on the type of the control instruction;
the Wi-Fi Manager calls the state machine to determine a second state corresponding to the control instruction based on the type of the control instruction and the control instruction;
and the Wi-Fi Manager calls the state machine to verify whether the control instruction is legal or not according to the first state and the second state.
In one possible implementation, the control instruction is a control instruction corresponding to the STA, and the control instruction includes: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
In one possible implementation, the control instruction is a control instruction corresponding to the AP, and the control instruction includes: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program may be used to implement the Wi-Fi management method described in the embodiment corresponding to fig. 2 and fig. 5 in the embodiment of the present application, and details of the method are not repeated here.
The computer readable storage medium may be an internal storage unit of the terminal device according to any of the foregoing embodiments, for example, a hard disk or a memory of the device. The computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
It will be understood by those skilled in the art that all or part of the processes in the methods of the embodiments described above may be implemented by a computer program, which may be stored in a readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.
Claims (12)
1. A Wi-Fi management method is applied to a terminal device, and the terminal device comprises: the system comprises a network application program, a Wi-Fi Manager, a Wi-Fi Driver and a Wi-Fi Firmware, wherein the Wi-Fi Driver is hosted by the Wi-Fi Manager, and comprises:
the network application program receives a control instruction and sends the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to a wireless Access Point (AP) or a control instruction corresponding to a Station (STA);
the Wi-Fi Manager verifies whether the control instruction is legal or not, and sends the control instruction to the Wi-Fi Driver after verifying that the control instruction is legal;
and the Wi-Fi Driver drives the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
2. The method of claim 1, wherein the web application sends the control instructions to the Wi-Fi Manager, comprising:
the network application program calls a first Application Programming Interface (API) to send the control instruction to the Wi-Fi Manager;
the Wi-Fi Manager sends the control instruction to the Wi-Fi Driver, and the method comprises the following steps:
and the Wi-Fi Manager calls a second API to send the control instruction to the Wi-Fi Driver.
3. The method according to claim 1 or 2, wherein the control instruction carries an identifier of the control instruction, the Wi-Fi Manager includes a state machine, and the Wi-Fi Manager verifies whether the control instruction is legal, including:
the Wi-Fi Manager determines the type of the control instruction based on the identification of the control instruction, wherein the type of the control instruction comprises a control instruction corresponding to the AP and a control instruction corresponding to the STA;
calling the state machine to acquire a first state corresponding to the type of the control instruction by the Wi-Fi Manager based on the type of the control instruction;
the Wi-Fi Manager calls the state machine to determine a second state corresponding to the control instruction based on the type of the control instruction and the control instruction;
and the Wi-Fi Manager calls the state machine to verify whether the control instruction is legal or not according to the first state and the second state.
4. The method according to claim 3, wherein the control command is a control command corresponding to the STA, and the control command includes: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
5. The method according to claim 3, wherein the control command is a control command corresponding to the AP, and the control command includes: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
6. A Wi-Fi management apparatus configured to a terminal device, the terminal device comprising: the system comprises a network application program, a Wi-Fi Manager, a Wi-Fi Driver and a Wi-Fi Firmware, wherein the Wi-Fi Driver is hosted by the Wi-Fi Manager, and comprises:
the network application program is used for receiving a control instruction and sending the control instruction to the Wi-Fi Manager, wherein the control instruction comprises a control instruction corresponding to a wireless Access Point (AP) or a control instruction corresponding to a Station (STA);
the Wi-Fi Manager is used for verifying whether the control instruction is legal or not and sending the control instruction to the Wi-Fi Driver after verifying that the control instruction is legal;
and the Wi-Fi Driver is used for driving the Wi-Fi Firmware to execute the corresponding operation of the control instruction according to the control instruction.
7. The apparatus of claim 6, wherein the web application is specifically configured to:
calling a first Application Programming Interface (API) to send the control instruction to the Wi-Fi Manager;
the Wi-Fi Manager is specifically configured to:
and calling a second API to send the control instruction to the Wi-Fi Driver.
8. The apparatus according to claim 6 or 7, wherein the control instruction carries an identifier of the control instruction, the Wi-Fi Manager includes a state machine, and the Wi-Fi Manager is specifically configured to:
determining the type of the control instruction based on the identification of the control instruction, wherein the type of the control instruction comprises a control instruction corresponding to an AP and a control instruction corresponding to an STA;
calling the state machine to acquire a first state corresponding to the type of the control instruction based on the type of the control instruction;
calling the state machine to determine a second state corresponding to the control instruction based on the type of the control instruction and the control instruction;
and calling the state machine to verify whether the control instruction is legal or not according to the first state and the second state.
9. The apparatus according to claim 8, wherein the control command is a control command for the STA, and the control command includes: an instruction to turn on STA mode, an instruction to scan Wi-Fi network, an instruction to connect Wi-Fi network, an instruction to disconnect Wi-Fi network, and an instruction to turn off STA mode.
10. The apparatus of claim 8, wherein the control command is a control command corresponding to the AP, and the control command includes: an instruction for opening the AP mode, an instruction for opening the hot spot, an instruction for closing the hot spot and an instruction for closing the AP mode.
11. A terminal device, characterized in that it comprises a processor and a memory, said processor and memory being interconnected, wherein said memory is adapted to store a computer program comprising program instructions, said processor being configured to invoke said program instructions to perform the method according to any one of claims 1-5.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011365117.1A CN112312394B (en) | 2020-11-27 | 2020-11-27 | Wireless fidelity Wi-Fi management method, device and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011365117.1A CN112312394B (en) | 2020-11-27 | 2020-11-27 | Wireless fidelity Wi-Fi management method, device and related equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112312394A true CN112312394A (en) | 2021-02-02 |
CN112312394B CN112312394B (en) | 2023-03-31 |
Family
ID=74487866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011365117.1A Active CN112312394B (en) | 2020-11-27 | 2020-11-27 | Wireless fidelity Wi-Fi management method, device and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112312394B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113194409A (en) * | 2021-04-27 | 2021-07-30 | 艾体威尔电子技术(北京)有限公司 | Method for establishing WIFI probe on android device for detection and counting passenger flow |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102098761A (en) * | 2009-12-10 | 2011-06-15 | 华为终端有限公司 | Mobile communication terminal and network access method thereof |
CN104768147A (en) * | 2015-03-09 | 2015-07-08 | 中国科学院信息工程研究所 | WLAN device and data channel real-time control method and system |
CN105721220A (en) * | 2016-03-11 | 2016-06-29 | 北京奇虎科技有限公司 | Intelligent terminal and network bottom configuration method thereof |
CN106060970A (en) * | 2016-03-11 | 2016-10-26 | 北京奇虎科技有限公司 | Intelligent terminal and network configuration method thereof |
CN106708633A (en) * | 2016-12-07 | 2017-05-24 | 广东欧珀移动通信有限公司 | Method for increasing WiFi workstation mode disabling speed of terminal, and mobile terminal |
CN107071865A (en) * | 2016-12-07 | 2017-08-18 | 广东欧珀移动通信有限公司 | The method and device that a kind of Wireless Fidelity is quickly connected |
US20180288614A1 (en) * | 2017-03-30 | 2018-10-04 | Intel Corporation | WiFi PROTECTED ACCESS 2 (WPA2) PASS-THROUGH VIRTUALIZATION PARTITION |
CN111885665A (en) * | 2020-07-30 | 2020-11-03 | 海信视像科技股份有限公司 | Wireless network connection control method and display device |
-
2020
- 2020-11-27 CN CN202011365117.1A patent/CN112312394B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102098761A (en) * | 2009-12-10 | 2011-06-15 | 华为终端有限公司 | Mobile communication terminal and network access method thereof |
CN104768147A (en) * | 2015-03-09 | 2015-07-08 | 中国科学院信息工程研究所 | WLAN device and data channel real-time control method and system |
CN105721220A (en) * | 2016-03-11 | 2016-06-29 | 北京奇虎科技有限公司 | Intelligent terminal and network bottom configuration method thereof |
CN106060970A (en) * | 2016-03-11 | 2016-10-26 | 北京奇虎科技有限公司 | Intelligent terminal and network configuration method thereof |
CN106708633A (en) * | 2016-12-07 | 2017-05-24 | 广东欧珀移动通信有限公司 | Method for increasing WiFi workstation mode disabling speed of terminal, and mobile terminal |
CN107071865A (en) * | 2016-12-07 | 2017-08-18 | 广东欧珀移动通信有限公司 | The method and device that a kind of Wireless Fidelity is quickly connected |
US20180288614A1 (en) * | 2017-03-30 | 2018-10-04 | Intel Corporation | WiFi PROTECTED ACCESS 2 (WPA2) PASS-THROUGH VIRTUALIZATION PARTITION |
CN111885665A (en) * | 2020-07-30 | 2020-11-03 | 海信视像科技股份有限公司 | Wireless network connection control method and display device |
Non-Patent Citations (4)
Title |
---|
MALATI HEGDE: ""Experiences with WM: A centralised scheduling approach for performance management of IEEE 802.11 wireless LANs"", 《2009 FIRST INTERNATIONAL COMMUNICATION SYSTEMS AND NETWORKS AND WORKSHOPS》 * |
唐智灵等: "嵌入式终端WiFi网卡驱动程序的开发", 《桂林电子工业学院学报》 * |
杨中皇等: "Android隐私保护系统的设计与实现", 《西安邮电大学学报》 * |
杨洪涛等: "基于Android平台的WIFI控制系统的设计与实现", 《北京工业职业技术学院学报》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113194409A (en) * | 2021-04-27 | 2021-07-30 | 艾体威尔电子技术(北京)有限公司 | Method for establishing WIFI probe on android device for detection and counting passenger flow |
CN113194409B (en) * | 2021-04-27 | 2022-05-17 | 艾体威尔电子技术(北京)有限公司 | Method for establishing WIFI probe on android device for detection and counting passenger flow |
Also Published As
Publication number | Publication date |
---|---|
CN112312394B (en) | 2023-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3116161B1 (en) | Security unit management method and terminal | |
EP2611226B1 (en) | Processing method and system for over-the-air bootstrap | |
US10419900B2 (en) | Method and apparatus for managing application terminal remotely in wireless communication system | |
US10708744B2 (en) | NFC-based communication method and apparatus | |
CN107950041A (en) | A kind of method and terminal of Profile switchings | |
CN110312286B (en) | Network switching method, communication device and communication equipment | |
KR20140103153A (en) | Method fo routing within a mobile terminal emulating a contactless payment card | |
CN111918274B (en) | Code number configuration and management method and device, electronic equipment and readable storage medium | |
JP2020523891A (en) | Communication method and device | |
JP7392652B2 (en) | Access methods, Internet of Things platforms, application equipment and service equipment | |
CN105847048B (en) | The configuration method and device of smart machine | |
AU2021319660A1 (en) | Method, system and apparatus for determining user plane security algorithm | |
CN112312394B (en) | Wireless fidelity Wi-Fi management method, device and related equipment | |
JP5723174B2 (en) | Information processing program, information processing system, information processing apparatus, and information processing method | |
US20090221264A1 (en) | Storage system of mobile terminal and access control method | |
CN116248657B (en) | Control method and device of screen projection system, computer equipment and storage medium | |
CN116847319A (en) | Device authentication networking method, communication device and readable storage medium | |
JP7286989B2 (en) | eUICC, communication control method, communication control program and communication system | |
CN108769989B (en) | Wireless network connection method, wireless access device and equipment | |
US8955064B2 (en) | Control over access to device management tree of device management client | |
JP2012074975A (en) | Subscriber identity module, portable terminal, information processing method and program | |
US9294632B2 (en) | Mobile terminal and computer-readable recording medium for a mobile terminal using near field wireless communication to transmit a scan command to a scanning device | |
WO2023179137A1 (en) | Device communication method and related product | |
US20240049334A1 (en) | Non-transitory computer-readable recording medium storing computer readable instructions for terminal device, terminal device, and method for controlling terminal device | |
WO2021000315A1 (en) | Device onboarding method for use in internet of things, and communication device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |