WO2013174312A2 - Control method and device, and mobile terminal - Google Patents

Control method and device, and mobile terminal Download PDF

Info

Publication number
WO2013174312A2
WO2013174312A2 PCT/CN2013/079717 CN2013079717W WO2013174312A2 WO 2013174312 A2 WO2013174312 A2 WO 2013174312A2 CN 2013079717 W CN2013079717 W CN 2013079717W WO 2013174312 A2 WO2013174312 A2 WO 2013174312A2
Authority
WO
WIPO (PCT)
Prior art keywords
command
wireless network
user terminal
network
module
Prior art date
Application number
PCT/CN2013/079717
Other languages
French (fr)
Chinese (zh)
Other versions
WO2013174312A3 (en
Inventor
马海蓉
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2013174312A2 publication Critical patent/WO2013174312A2/en
Publication of WO2013174312A3 publication Critical patent/WO2013174312A3/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Definitions

  • the present invention relates to the field of communications, and in particular, to a control method, device, and mobile terminal.
  • a user terminal such as a computer can access a cellular network (such as an EDGE/3G network) by using a mobile terminal such as a data card as a wireless MODEM.
  • the user terminal needs to configure the APN parameter for the mobile terminal by using the standard AT command AT+CGDCONT, and then uses the PPP dialing method to control the behavior of the mobile terminal controlling the connection to the cellular network.
  • PPP dialing requires the use of a dialer provided by the computer operating system, which is strongly related to the operating system.
  • an object of embodiments of the present invention is to provide a control method, apparatus, and mobile terminal to implement high robustness control of a mobile terminal controlling a behavior of connecting to a wireless network.
  • the embodiment of the present invention provides a control method, which is used in a mobile terminal, and the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and the method includes: Receiving a first AT command sent by the user terminal; determining whether the first AT command indicates to connect to the wireless network, obtaining a first determination result; and when the first determination result is YES, generating a first wireless network connection instruction.
  • the wireless network is a WIFI network
  • the generating the first wireless network connection instruction comprises: parsing a WIFI hotspot identification parameter from the first AT command; generating the first wireless for indicating a connection to a WIFI hotspot The network connection command; wherein, the WIFI hotspot corresponds to the WIFI hotspot identification parameter.
  • the method before the receiving the first AT command sent by the user terminal, the method further includes: acquiring a scan result of the current WIFI network; sending a second AT command carrying the scan result to the user terminal, so that the user terminal The scan result can be parsed from the second AT command, and the first AT command is generated and transmitted to the mobile terminal according to the scan result.
  • the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, the generating the first wireless network connection instruction comprising: Parsing a network type parameter in the first AT command; generating, when the network type parameter is a first network type, the first wireless for controlling the first module to connect to a wireless network having a first network type a network connection instruction; when the network type parameter is a second network type, generating the first wireless network connection instruction for controlling the second module to connect to a wireless network having a second network type.
  • the method further includes: controlling, by the user terminal, the first between the first module and the wireless network having the first network type Connecting, when the first connection is established, transmitting, to the user terminal, a third AT command carrying a connected state of the wireless network, so that the user terminal can generate and send a disconnection indication to the mobile terminal according to the third AT command. a fourth AT command; receiving the fourth AT command; controlling, according to the fourth AT command, the first module to disconnect the first connection; when the first connection is disconnected, transmitting to the user terminal
  • the fifth AT command of the wireless network not connected state enables the user terminal to generate and transmit the first AT command to the mobile terminal according to the fifth AT command.
  • the controlling, by the user terminal, the first connection between the first module and the wireless network having the first network type is: receiving a sixth AT command sent by the user terminal; determining the Whether the six AT command indicates that the wireless network is connected to obtain a second determination result; when the second determination result is YES, the second wireless network connection instruction is generated.
  • the first network type is one of WIFI and a cell
  • the second network type is one of WIFI and a cell except the first network type.
  • the embodiment of the present invention provides a control device, which is used in a mobile terminal, where the device includes: a first receiving module, configured to receive a first AT command sent by a user terminal; and a determining module, configured to determine the first AT command Whether the connection to the wireless network is instructed to obtain a first determination result; and the generating module is configured to generate a first wireless network connection instruction when the first determination result is YES.
  • the wireless network is a WIFI network
  • the generating module includes: a first parsing unit, configured to parse the WIFI hotspot identification parameter from the first AT command when the first determining result is yes;
  • the first generating unit is configured to generate the first wireless network connection instruction for indicating a connection to the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter.
  • the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, the generating module comprising: a second analyzing unit, setting When the first determination result is YES, the network class is extracted from the first AT command.
  • a second generating unit configured to: when the network type parameter is a first network type, generate the first wireless network connection instruction for controlling the first module to connect to a wireless network having a first network type; And a unit, configured to: when the network type parameter is a second network type, generate the first wireless network connection instruction for controlling the second module to connect to a wireless network having a second network type.
  • the device further includes: a first control module, configured to: before the receiving module receives the first AT command sent by the user terminal, control, by the user terminal, the first module to establish and have the first network a first connection between the wireless networks of the type;
  • the second sending module is configured to: before the receiving, receiving, by the receiving module, the first AT command sent by the user terminal, when the first connection is established, sending the wireless network to the user terminal a third AT command of the connected state, so that the user terminal can generate and send a fourth AT command indicating disconnection to the mobile terminal according to the third AT command;
  • the second receiving module is configured to receive the user terminal by the receiving module Before the first AT command is sent, the fourth AT command is received;
  • the second control module is configured to: before the receiving module receives the first AT command sent by the user terminal, control the first according to the fourth AT command The module disconnects the first connection;
  • the third sending module is configured to receive, before the receiving module receives the first AT command sent by the user terminal And transmitting, when the first connection is
  • the first control module includes: a control unit, configured to receive a sixth AT command sent by the user terminal before the receiving module receives the first AT command sent by the user terminal; and the determining unit is configured as the receiving module Before receiving the first AT command sent by the user terminal, determining whether the sixth AT command indicates to connect to the wireless network, and obtaining a second determination result; the fourth generating unit is configured to receive, by the receiving module, the first AT sent by the user terminal Before the command, when the second determination result is YES, a second wireless network connection instruction is generated.
  • a mobile terminal including the above control device.
  • the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and is sent by the receiving user terminal.
  • the first AT command when the first AT command indicates to connect to the wireless network, generates a first wireless network connection command, thereby achieving high robustness control of the behavior of the mobile terminal controlling the connected wireless network.
  • FIG. 1 is a flow chart of steps of a control method according to an embodiment of the present invention
  • FIG. 2 is a block diagram of a software structure of a data card based on hardware WIFI
  • 3 is a flow chart of initializing AT commands
  • FIG. 1 is a flow chart of steps of a control method according to an embodiment of the present invention
  • FIG. 2 is a block diagram of a software structure of a data card based on hardware WIFI
  • 3 is a flow chart of initializing AT commands
  • FIG. 1 is a flow chart of steps of a control method according to an embodiment of the present invention
  • FIG. 2 is a block diagram
  • FIG. 1 is a flowchart of a method for controlling a method according to an embodiment of the present invention.
  • an embodiment of the present invention provides a control method, where the method includes the following steps: Step 101: Receive a first AT command sent by a user terminal; Step 102: Determine whether the first AT command indicates to connect to the wireless network, and obtain a first determination result. Step 103: When the first determination result is yes, generate a first wireless network connection instruction.
  • the method is applied to a mobile terminal, and the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel established between the mobile terminal and the user terminal. It can be seen that the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and receives the first AT command sent by the user terminal, and indicates that the first AT command is connected to the wireless network.
  • the first wireless network connection command is generated, thereby achieving high robustness control of the behavior of the mobile terminal controlling the connection to the wireless network.
  • the mobile terminal may be, for example, a data card, a mobile phone, a tablet, or the like.
  • the indicator following the character "AT” in the first AT command may be parsed from the first AT command, if it is a standard AT command "+", the first judgment result is No; if it is a custom specific character (such as " ⁇ "), the first judgment result is YES.
  • parsing an indicator following the character "AT” in the first AT command from the first AT command, and if it is a customized specific character parsing the command name following the specific character from the first AT command If it is a custom name representing the wireless network connection (such as "TCO ⁇ "), the first judgment result is yes; otherwise, the first judgment result is no.
  • the indicator and the command name following the character "AT" in the first AT command are parsed from the first AT command, if the indicator is "+" representing the standard AT command and the command name is a preset
  • the standard AT command name parses a custom parameter from the first AT command. If the parameter indicates a connection (such as ⁇ mode>, 1 indicates a connection), the first judgment result is yes; otherwise, the first The result of a judgment is no.
  • the wireless network is, for example, a WIFI network, a cellular network such as 2G/3G, and the like.
  • a wireless chip can be built in the mobile terminal, such as a WIFI chip or an EDGE/3G dual-mode chip; or an external wireless module, such as a WIFI module or an EDGE/3G dual-mode module.
  • the first wireless network connection command should be an instruction that can be recognized by the wireless chip or the wireless module and the wireless chip or the wireless module can be connected to the wireless network under the control of the first wireless network connection instruction.
  • the first wireless network connection instruction may be designed and generated in various manners by those skilled in the art, and details are not described herein again.
  • the first AT command may be The first wireless network connection command generated by the mobile terminal may carry a preset WIFI hotspot connection condition, for example, the signal strength is greater than a certain threshold.
  • the first AT command may carry the WIFI hotspot connection condition, for example, the signal strength is greater than a certain threshold, and correspondingly, the first wireless network connection command generated by the mobile terminal may also carry the condition.
  • the first AT command may carry WIFI hotspot identification parameters (such as SSID and bSSID) to indicate which WIFI hotspot is connected, and accordingly, may have:
  • the generating the first wireless network connection command includes: parsing the WIFI hotspot identification parameter from the first AT command; generating a first wireless network connection instruction for indicating the connection of the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter.
  • the first wireless network connection command should be an instruction that can be recognized by the wireless chip built in the mobile terminal or an external wireless module, and the wireless chip or the wireless module can be executed under the control of the first wireless network connection instruction.
  • Corresponding operations (such as connecting to a WIFI hotspot that satisfies the condition information, connecting to a WIFI hotspot indicating the connection).
  • the first wireless network connection instruction can be designed and generated in various manners by those skilled in the art, and details are not described herein again. Further, it is considered that the user terminal may need to know the scanning condition of the WIFI network before instructing to connect to the WIFI network.
  • the method may further include: acquiring a current WIFI network. Scanning result; transmitting a second AT command carrying the scan result to the user terminal, so that the user terminal can parse the scan result from the second AT command, and generate and send the first AT command to the mobile terminal according to the scan result.
  • the scan result may be acquired by the mobile terminal or may be obtained by the user terminal.
  • the scan result may include a scanned list of WIFI hotspot identifiers, and optionally, information such as signal strength of each WIFI hotspot in the list.
  • the PPP dialing control mode can be reserved for the cellular wireless network, and the WIFI wireless network is used for the WIFI wireless network.
  • the control method based on the AT command is used.
  • two different methods do the same thing (ie, using a mobile terminal such as a data card as a wireless MODEM to access the network), The complexity of the system consumes a certain amount of transmission resources and processing resources, which reduces the efficiency of control to a certain extent.
  • the AT command is simple in design and extensible, so it can be further used for the control of the behavior of the mobile terminal controlling the connection of different types of wireless networks by the user terminal. This type of control is more efficient and achieves the goal that cannot be achieved only by using PPP dialing.
  • the mobile terminal when it has the ability to control connection to multiple types of wireless networks, it can still be controlled by means of an AT command, for example, using different AT command names to indicate connection to different types of wireless networks; Or, use different parameters to represent the connection to a different type of wireless network.
  • the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type
  • generating the first wireless network connection instruction comprises: from the first AT command Parsing the network type parameter; when the network type parameter is the first network type, generating a first wireless network connection instruction for controlling the first module to connect to the wireless network having the first network type; and when the network type parameter is the second network type And generating, by the second module, a first wireless network connection instruction for controlling the second module to connect to the wireless network having the second network type.
  • the user terminal can control the behavior of the mobile terminal to control different types of wireless networks simply and conveniently through an AT command.
  • the method may further include: before receiving the first AT command sent by the user terminal, the method further includes: under the control of the user terminal Controlling, by the first module, a first connection with the wireless network having the first network type; when the first connection is established, transmitting, to the user terminal, a third AT command carrying the connected state of the wireless network, so that the user terminal can enable Generating and transmitting to the mobile terminal a fourth AT command indicating disconnection according to the third AT command; receiving a fourth AT command; controlling the first module to disconnect the first connection according to the fourth AT command; when the first connection is disconnected And transmitting, to the user terminal, a fifth AT command carrying a wireless network unconnected state, so that the user terminal can generate and send the first AT command to the mobile terminal according to the fifth AT command.
  • the controlling, by the user terminal, the first connection between the first module and the wireless network having the first network type may include: receiving a sixth AT command sent by the user terminal; determining whether the sixth AT command indicates the connection The wireless network obtains a second determination result; when the second determination result is YES, generates a second wireless network connection instruction.
  • the user terminal controls, by the second AT command, the behavior of the mobile terminal controlling the connection to the specific type of wireless network, and when the first connection is established, instructing the mobile terminal to disconnect the first connection by using the fourth AT command, in the first connection
  • the behavior of the mobile terminal to control a specific type of wireless network is controlled by the first AT command, so that the user terminal can conveniently establish and disconnect the mobile terminal for the case where the two specific types are of the same type.
  • Controlling the behavior of a specific type of wireless network connection; for the case where the two specific types are different types the user terminal can conveniently control the mobile terminal, so that the mobile terminal can control the wireless path corresponding to the first module at the air interface. Any switching between the wireless channels corresponding to the second module.
  • the first network type may be one of the WIFI and the cellular
  • the second network type may be one of the WIFI and the cellular except the first network type.
  • the specific description is as follows: With the development of the WIFI technology, the deployment of the AP hotspot is gradually increased, and more and more The more terminal products are starting to support WIFI. Traditional data cards have also begun to evolve into T+W data cards.
  • T TD-SCDMA
  • W WLAN
  • WIFI chip so when connecting to WIFI network, you need to borrow the wireless network card on the connected user terminal (such as computer), such as the built-in wireless network card that comes with the laptop. If the user terminal does not have a wireless network card, you can't connect to the WIFI network. For data cards. For this inconvenient place, a WIFI chip can be added to the data card, and the WIFI chip set on the data card itself is connected to the WIFI network. However, at present, the user terminal cannot control the behavior of the data card to control the connection to the WIFI network. Therefore, specific to the case where the mobile terminal is a data card, another advantage of the embodiment of the present invention is to provide a control method for controlling the behavior of the data card to connect to the WIFI network.
  • the NDIS network card device when the data card is inserted into the user terminal, the NDIS network card device can be enumerated.
  • the device is in a non-connected state by default, and after the WIFI connection is successful, the device is placed in a connected state, and the device becomes a channel for data transmission.
  • the data card then allocates IP to the user terminal through the DHCP server, so that the user terminal can perform data service through the data card.
  • This also solves the problem that the user terminal side software with the hardware WIFI chip T+W type data card is difficult to control. In this way, the user terminal can still access the WIFI network through the data card without the wireless network card or the wireless network card is temporarily unavailable or temporarily disabled, thereby expanding the application scenario of the data card.
  • the user terminal is a personal computer (PC)
  • the mobile terminal is a data card
  • the first module and the second module are built in the data card.
  • the preferred embodiment provides a control method based on the AT command, which satisfies the requirements for the connection operation of the hardware WIFI data card.
  • the present invention proposes a control method based on an AT command, the core of which includes a set of AT command sets.
  • the PC side software can operate the data card through the related new AT command.
  • the data card After the data card accepts the AT command, it executes according to the parameters given by the command, returns the execution result to the PC side software, and if the data card has a status after executing the AT command.
  • the change the initiative to report the corresponding AT command to the PC side software, PC side software and then according to the report results to decide what AT command to send next to control.
  • the newly added AT commands include the current connection status reporting AT command, the WIFI hotspot scanning AT command, and the network connection AT command.
  • three COM port class devices and one NDIS NIC class device are enumerated. Among them, the COM port class device is the channel for AT command transmission.
  • the NDIS network card device defaults to the non-connected state.
  • the wireless connection When the wireless connection is successful, it is set to the connection state, which is the channel for data transmission between the data card and the computer.
  • Reporting the AT command on the current connection status When the COM port class device is available, the PC side software sends the status report to the data card to enable the AT command. After receiving the command, the data card will immediately report the current status.
  • the first bit of the report indicates the network type, whether it is a 2G/3G network or a WIFI network, and the second bit indicates the status under the current network type.
  • the report In the first step, if the data card is successfully initialized after being inserted into the computer, and the 2G/3G network or the WIFI network is ready and there is no abnormality, the report is successfully initialized.
  • the data card automatically reports that the network is not connected, indicating that the PC side software can start to connect to the network. That is to say, after the data card is reported to be enabled by the PC-side software to enable the AT command, the normalization will be reported to the 2G/3G network connection type, the network is not connected, and the network will be reported.
  • the initialization of the WIFI network connection type is successful and the network is not connected.
  • other status reporting functions of the data card include: When the connection is being made, the reporting network is connected. After the connection is successful, the reporting network is connected. When the connection is disconnected, the reporting is disconnected. If the connection is canceled, the connection is canceled.
  • the network is not reported, and the connection can be initiated again.
  • the data card enters the state of scanning the AP hotspot, it will report that the AP status is being scanned. The purpose is to inform the PC side software. At this time, connecting the AT command or disconnecting the AT command may fail to respond and need to be delayed. When the scan ends, the status before the scan is re-reported.
  • the WIFI hotspot scanning AT command The PC side software reports the WIFI network initialization on the data card and then enables the setting by the AT command. If the AT command in the setting contains the time parameter and the parameter value is not zero, the timer on the data card is enabled according to the parameter value.
  • the data card When the timer expires, the data card automatically scans the WIFI hotspot, and the ATINF actively reports the AT. command.
  • the first two parameters of the reported AT command indicate the SSID and bSSID of the WIFI hotspot, which are used to distinguish the unique WIFI hotspot, and the third parameter indicates the current signal strength of the WIFI hotspot. If the time parameter included in the AT command is set to zero, the WIFI hotspot scan is performed immediately, and the scan result is reported automatically, and the report format is reported with the same timed scan. This mode is used when the PC side software needs to immediately obtain the current surrounding WIFI hotspot information.
  • the AT command also includes the SSID and bSSID parameters
  • the data card is instructed to obtain the current signal strength of the specified WIFI hotspot and provide the PC side software according to the values of the SSID and the bSSID.
  • the network connection class AT command includes the network connection AT command, the cancel network connection AT command, and the disconnect network connection AT command.
  • the PC side software can send the network connection AT command.
  • the first parameter of the command is the connection network type, indicating whether the current connection operation is to connect to the 2G/3G network or the WIFI network. Because it is considered that if there is a connection process, there is a scene of canceling the connection.
  • the meaning of the second parameter indicates whether the current action is to connect to the network or to disconnect the network for differentiation.
  • the third and fourth parameters are valid when the connected network type is a WIFI network, and is used to specify a unique WIFI hotspot to be connected.
  • the network connection class AT command also contains parameters to get the AT command and the parameter setting AT command when connecting.
  • the parameter acquires the AT command with the SSID and bSSID parameters indicating the key information of the unique WIFI hotspot.
  • the data card executes the command, it returns the obtained hotspot information to the PC side software, including the authentication mode, encryption algorithm, network type and signal. Intensity, PC side software displays this information and can be modified.
  • the AT command Before the connection to the WIFI hotspot AT command is sent, the AT command is required to set the authentication mode, encryption algorithm, authentication mode and key to the data card for connection.
  • the parameter setting AT command and the connection WIFI hotspot AT command correspond to the SSID and bSSID parameters carried by both commands.
  • the PC-side software can issue the disconnection of the network connection AT command.
  • the parameters of the command only need to specify the type of the network connection to be disconnected, or set to any type. Only one of the connections will take effect at the same time, that is, stay connected.
  • the NDIS network card After the 2G/3G network connection is successful, or after the WIFI connection is successful, the NDIS network card is placed in a connected state, and the IP is allocated through the DHCP server, so that the computer can perform data services through the data card. When the data service is no longer performed, the disconnection operation can be performed. At this time, the NDIS network card is placed in an unconnected state, and the data card enters an idle state without affecting the use of other network connections on the computer.
  • the problem that the PC side software with the hardware WIFI chip T+W data card is difficult to control is solved, and the unified AT command set is used to conveniently connect between the 2G/3G network and the WIFI network. And switching, simple and effective.
  • FIG. 2 is a structural block diagram of a hardware WIFI-based data card software according to a preferred embodiment of the preferred embodiment.
  • the WLAN protocol is used under the cooperation of the SDIO driver.
  • Control WIFI chip to connect WIFI hotspot;
  • 2G/3G protocol ⁇ support PDP activation function, used to control 2G/3G chip to connect to cellular network;
  • NDIS protocol ⁇ based on USB driver can enumerate NIC device after data card is inserted into computer, used to do A bridge for data interaction between computers and data cards.
  • the AT command set, through the overall control of the above three, to achieve data card can be used in the 2G/3G network environment, can also be used in the WIFI network environment, and can be easily switched to use, enhanced data Applicability of card products.
  • the module for connecting the wireless network having the cellular type includes a 2G/3G protocol and a 2G/3G chip, and the module for connecting the wireless network having the WIFI type includes a WLAN protocol, an SDIO driver, and a WIFI card;
  • the wireless network connection command is generated by the data transceiver and its control module under the control of the extended AT command module. After the extended AT command module receives the new AT command from the AT engine, the data transceiver and its control module are controlled based on the API interface.
  • FIG. 3 is a flowchart of initializing the AT command.
  • Network type identifier
  • the WIFI hotspot information reporting format is:
  • a TAINF ⁇ ssid>, ⁇ bssid>, ⁇ rssi>
  • AT A TCO cis ⁇ type>, ⁇ mode>[, ⁇ ssid>, ⁇ bssid>] ⁇ type>: Type of network to be connected: 1 WIFI 2 TD/EDGE
  • ⁇ mode> indicates whether to connect to the network or cancel the network connection: 1 connection 0 cancel the network connection
  • connection parameters need to be set before connecting.
  • APN Address Translation
  • AT+CGDCONT AT+CGDCONT
  • WIFI WIFI network
  • AT A TTAPCFGS ⁇ ssid>, ⁇ bssid>, ⁇ auth>, ⁇ encr>, ⁇ autype>
  • Encryption algorithm Includes: 0 NONE 1 TKIP 2 CCMP 3 WEP_OPEN 4 WEP_SHARE 5 WEP104 6 YES
  • ⁇ autype>i iE mode Includes: 0 NONE 1 (U) SIM Certification 2 WEB Certification
  • ⁇ id> Asynchronous AT command processing number, used to indicate the result of active reporting, from 0 to 127 cycles. Then, the actual connection processing result will notify the PC side software through the active reporting of A TACK, and there is also a unique key value indication, so that the PC side software can judge the processing result of the request, and prevent the result from being wrong.
  • the reporting format of A TACK is as follows:
  • FIG. 5 is a flowchart of canceling the connection AT command. Referring to FIG. 5, if the connection process is in progress, the connection can be canceled.
  • the AT command is the same as the AT command used when the network is connected, but only one parameter needs to be changed, ⁇ mode> parameter.
  • Figure 6 is a flow chart of disconnecting the AT command. Referring to Figure 6, when the status reporting network is connected, the 2G/3G network is connected to A TMODE: 2, 4 and the WIFI network is connected to A TMODE: l, 4
  • the PC side software can issue the following command to the data card to disconnect the operation:
  • the embodiment of the present invention further provides a control device, which is used in a mobile terminal, the device includes: a first receiving module, configured to receive a first AT command sent by a user terminal; and a determining module, configured to determine whether the first AT command indicates Connecting to the wireless network to obtain a first determination result; and generating a module, configured to generate a first wireless network connection instruction when the first determination result is yes.
  • the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and receives the first AT command sent by the user terminal, and indicates that the first AT command is connected to the wireless network.
  • Generating a first wireless network connection command thereby implementing high robustness control of the behavior of the mobile terminal controlling the connection to the wireless network; and this manner can be performed between the user terminal and the mobile terminal through the established AT command transmission channel
  • the information exchange does not need to establish a PPPOE transmission channel, which reduces the consumption of a certain time resource due to the establishment of the PPPOE transmission channel and the occupation of a certain transmission resource and processing resource between the mobile terminal and the user terminal, and thus To a certain extent, efficient control of the behavior of the mobile terminal to control the connection to the wireless network is achieved.
  • the wireless network may be a WIFI network
  • the generating module may include: a first parsing unit, configured to parse the WIFI hotspot identification parameter from the first AT command when the first determining result is yes;
  • the first generating unit is configured to generate a first wireless network connection command for indicating a connection to the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter.
  • the mobile terminal may be provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type
  • the generating module may include - a second analyzing unit, setting When the first judgment result is yes, the network type parameter is parsed from the first AT command; the second generating unit is configured to generate, when the network type parameter is the first network type, generate a first wireless network connection command of a network type wireless network; a third generating unit configured to: when the network type parameter is the second network type, generate a second network to control the second module to connect to the wireless network having the second network type A wireless network connection command.
  • the apparatus may further include: a first control module, configured to: before the receiving module receives the first AT command sent by the user terminal, control the first module to establish a wireless network with the first network type, under the control of the user terminal a first connection between the second sending module, configured to send, before receiving the first AT command sent by the user terminal, the third AT command carrying the connected state of the wireless network to the user terminal, when the first connection is established ???
  • a first control module configured to: before the receiving module receives the first AT command sent by the user terminal, control the first module to establish a wireless network with the first network type, under the control of the user terminal a first connection between the second sending module, configured to send, before receiving the first AT command sent by the user terminal, the third AT command carrying the connected state of the wireless network to the user terminal, when the first connection is established ???
  • the second receiving module is configured to receive the fourth AT before receiving the first AT command sent by the user terminal
  • the second control module is configured to: before the receiving module receives the first AT command sent by the user terminal, control the first module to disconnect the first connection according to the fourth AT command
  • the third sending module is configured to receive the user terminal and send the receiving Before the first AT command, when the first connection is disconnected, the user terminal is sent to carry the wireless
  • the fifth AT command of the network unconnected state enables the user terminal to generate and transmit the first AT command to the mobile terminal according to the fifth AT command.
  • the first control module may include: a control unit, configured to receive a sixth AT command sent by the user terminal before the receiving module receives the first AT command sent by the user terminal;
  • the determining unit is configured to: before the receiving module receives the first AT command sent by the user terminal, determine whether the sixth AT command indicates to connect to the wireless network, and obtain a second determination result; and the fourth generating unit is configured to receive, by the receiving module, the user terminal Before the first AT command, when the second determination result is YES, a second wireless network connection command is generated.
  • the embodiment of the invention further provides a mobile terminal, which comprises the above control device.
  • the above is only an embodiment of the present invention. It should be noted that those skilled in the art can make some improvements and refinements without departing from the principles of the embodiments of the present invention. Retouching should also be considered as the scope of protection of the embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are a control method and device, and a mobile terminal. The method is used for a mobile terminal, and the mobile terminal conducts AT command interaction with a user terminal through an AT command transmission passage which has been established between the mobile terminal and the user terminal. The method comprises: receiving a first AT command sent by a user terminal; judging whether the first AT command indicates to connect to a wireless network, and obtaining a first judgment result; and when the first judgment result is yes, generating a first wireless network connection instruction. The embodiments of the present invention can achieve high robust control of the action that a mobile terminal controls to connect to a wireless network.

Description

一种控制方法、 装置及移动终端 技术领域 本发明实施例涉及通信领域, 尤其涉及一种控制方法、 装置及移动终端。 背景技术 目前,计算机等用户终端可以将数据卡等移动终端作为无线 MODEM来访问蜂窝 网络 (如 EDGE/3G网络)。 其中, 用户终端需要通过标准 AT命令 AT+CGDCONT为 移动终端配置 APN参数, 然后采用 PPP拨号的方式来对移动终端控制连接蜂窝网络 的行为进行控制。 但是, PPP拨号需要用到计算机操作系统所提供的拨号程序, 与操 作系统强相关。 一旦拨号程序所需的服务和相关设置, 被用户或其它应用所更改, 会 导致拨号程序持续的执行失败, 甚至无法再恢复。 也就是说, 这种控制方式的鲁棒性 不高。 发明内容 有鉴于此, 本发明实施例的目的是提供一种控制方法、 装置及移动终端, 以实现 对移动终端控制连接无线网络的行为的高鲁棒性控制。 本发明实施例提供一种控制方法, 用于一移动终端, 移动终端通过一已建立在移 动终端与用户终端之间的 AT命令传输通道, 与用户终端进行 AT命令的交互, 所述方 法包括: 接收用户终端发送的第一 AT命令; 判断所述第一 AT命令是否指示连接无线 网络, 获取一第一判断结果; 当所述第一判断结果为是时, 生成第一无线网络连接指 令。 优选的, 所述无线网络为 WIFI 网络, 所述生成第一无线网络连接指令包括: 从 所述第一 AT命令中解析出 WIFI热点标识参数; 生成用于指示连接 WIFI热点的所述 第一无线网络连接指令; 其中, 所述 WIFI热点与所述 WIFI热点标识参数对应。 优选的, 所述接收用户终端发送的第一 AT命令之前, 所述方法还包括: 获取一 当前 WIFI网络的扫描结果; 向用户终端发送携带有所述扫描结果的第二 AT命令, 使 得用户终端能够从所述第二 AT命令中解析出所述扫描结果, 根据所述扫描结果生成 并向移动终端发送所述第一 AT命令。 优选的, 移动终端设置有用于连接具有第一网络类型的无线网络的第一模块和用 于连接具有第二网络类型的无线网络的第二模块, 所述生成第一无线网络连接指令包 括: 从所述第一 AT命令中解析出网络类型参数; 当所述网络类型参数为第一网络类 型时, 生成用于控制所述第一模块连接具有第一网络类型的无线网络的所述第一无线 网络连接指令; 当所述网络类型参数为第二网络类型时, 生成用于控制所述第二模块 连接具有第二网络类型的无线网络的所述第一无线网络连接指令。 优选的, 所述接收用户终端发送的第一 AT命令之前, 所述方法还包括: 在用户 终端的控制下, 控制所述第一模块建立与具有第一网络类型的无线网络之间的第一连 接; 在所述第一连接建立时, 向用户终端发送携带有无线网络已连接状态的第三 AT 命令, 使得用户终端能够根据所述第三 AT命令生成并向移动终端发送指示断开连接 的第四 AT命令; 接收所述第四 AT命令; 根据所述第四 AT命令控制所述第一模块断 开所述第一连接; 在所述第一连接断开时, 向用户终端发送携带有无线网络未连接状 态的第五 AT命令,使得用户终端能够根据所述第五 AT命令生成并向移动终端发送所 述第一 AT命令。 优选的, 所述在用户终端的控制下, 控制所述第一模块建立与具有第一网络类型 的无线网络之间的第一连接包括: 接收用户终端发送的第六 AT命令; 判断所述第六 AT命令是否指示连接无线网络, 获取一第二判断结果; 当所述第二判断结果为是时, 生成第二无线网络连接指令。 优选的, 所述第一网络类型为 WIFI和蜂窝中的一个, 所述第二网络类型为 WIFI 和蜂窝中除所述第一网络类型之外的一个。 本发明实施例提供一种控制装置, 用于一移动终端, 所述装置包括: 第一接收模 块, 设置为接收用户终端发送的第一 AT命令; 判断模块, 设置为判断所述第一 AT命 令是否指示连接无线网络, 获取一第一判断结果; 生成模块, 设置为当所述第一判断 结果为是时, 生成第一无线网络连接指令。 优选的, 所述无线网络为 WIFI 网络, 所述生成模块包括: 第一解析单元, 设置 为当所述第一判断结果为是时, 从所述第一 AT命令中解析出 WIFI热点标识参数; 第 一生成单元, 设置为生成用于指示连接 WIFI热点的所述第一无线网络连接指令; 其 中, 所述 WIFI热点与所述 WIFI热点标识参数对应。 优选的, 移动终端设置有用于连接具有第一网络类型的无线网络的第一模块和用 于连接具有第二网络类型的无线网络的第二模块,所述生成模块包括: 第二解析单元, 设置为当所述第一判断结果为是时, 从所述第一 AT命令中解析出网络类开'」 笛 二生成单元, 设置为当所述网络类型参数为第一网络类型时, 生成用于控制所述第一 模块连接具有第一网络类型的无线网络的所述第一无线网络连接指令;第三生成单元, 设置为当所述网络类型参数为第二网络类型时, 生成用于控制所述第二模块连接具有 第二网络类型的无线网络的所述第一无线网络连接指令。 优选的, 所述装置还包括: 第一控制模块, 设置为所述接收模块接收用户终端发 送的第一 AT命令之前, 在用户终端的控制下, 控制所述第一模块建立与具有第一网 络类型的无线网络之间的第一连接; 第二发送模块, 设置为所述接收模块接收用户终 端发送的第一 AT命令之前, 在所述第一连接建立时, 向用户终端发送携带有无线网 络已连接状态的第三 AT命令,使得用户终端能够根据所述第三 AT命令生成并向移动 终端发送指示断开连接的第四 AT命令; 第二接收模块, 设置为所述接收模块接收用 户终端发送的第一 AT命令之前, 接收所述第四 AT命令; 第二控制模块, 设置为所述 接收模块接收用户终端发送的第一 AT命令之前,根据所述第四 AT命令控制所述第一 模块断开所述第一连接; 第三发送模块, 设置为所述接收模块接收用户终端发送的第 一 AT命令之前, 在所述第一连接断开时, 向用户终端发送携带有无线网络未连接状 态的第五 AT命令,使得用户终端能够根据所述第五 AT命令生成并向移动终端发送所 述第一 AT命令。 优选的, 所述第一控制模块包括: 控制单元, 设置为所述接收模块接收用户终端 发送的第一 AT命令之前, 接收用户终端发送的第六 AT命令; 判断单元, 设置为所述 接收模块接收用户终端发送的第一 AT命令之前,判断所述第六 AT命令是否指示连接 无线网络, 获取一第二判断结果; 第四生成单元, 设置为所述接收模块接收用户终端 发送的第一 AT命令之前, 当所述第二判断结果为是时, 生成第二无线网络连接指令。 本发明实施例提供一种包括以上所述的控制装置的移动终端。 从以上所述可以看出, 本发明实施例至少具有如下有益效果: 移动终端通过已建 立在移动终端与用户终端之间的 AT命令传输通道与用户终端进行 AT命令的交互,通 过接收用户终端发送的第一 AT命令, 在该第一 AT命令指示连接无线网络时, 生成第 一无线网络连接指令, 从而实现了对移动终端控制连接无线网络的行为的高鲁棒性控 制。 附图说明 图 1为本发明实施例提供的一种控制方法的步骤流程图; 图 2为基于硬件 WIFI的数据卡软件结构框图; 图 3为初始化 AT命令流程图; 图 4为连接 AT命令流程图; 图 5为取消连接 AT命令流程图; 图 6为断开连接 AT命令流程图; 图 7为 WIFI热点扫描 AT命令流程图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合附图及具体实 施例对本发明实施例进行详细描述。 图 1为本发明实施例提供的一种控制方法的步骤流程图, 参照图 1, 本发明实施 例提供一种控制方法, 方法包括如下步骤: 步骤 101, 接收用户终端发送的第一 AT命令; 步骤 102, 判断该第一 AT命令是否指示连接无线网络, 获取一第一判断结果; 步骤 103, 当该第一判断结果为是时, 生成第一无线网络连接指令。 该方法用于一移动终端,移动终端通过一已建立在移动终端与用户终端之间的 AT 命令传输通道, 与用户终端进行 AT命令的交互。 可见, 移动终端通过已建立在移动终端与用户终端之间的 AT命令传输通道与用 户终端进行 AT命令的交互, 通过接收用户终端发送的第一 AT命令, 在该第一 AT命 令指示连接无线网络时, 生成第一无线网络连接指令, 从而实现了对移动终端控制连 接无线网络的行为的高鲁棒性控制。 这种方式可以通过已建立的 AT命令传输通道进行用户终端与移动终端之间的信 息交互, 不再需要建立 PPPOE传输通道, 减少了因建立 PPPOE传输通道而带来的一 定时间资源的耗费以及对移动终端与用户终端之间一定的传输资源及处理资源的占 用, 从而也就在一定程度上实现了对移动终端控制连接无线网络的行为的高效控制。 其中, 该移动终端例如可以为: 数据卡、 手机、 平板电脑等。 判断该第一 AT命令是否指示连接无线网络, 获取一第一判断结果时, 可以从第 一 AT命令中解析出第一 AT命令中字符" AT"后面的指示符, 如果是代表标准 AT命令 的" +", 则该第一判断结果为否; 如果是自定义的特定字符 (如" Λ"), 则该第一判断结 果为是。 又例如: 从第一 AT命令中解析出第一 AT命令中字符" AT"后面的指示符,如果是 自定义的特定字符, 则从该第一 AT命令中解析出该特定字符后面的命令名称, 如果 是自定义的代表无线网络连接的名称(如" TCO顺"), 则该第一判断结果为是; 否则, 该第一判断结果为否。 又例如:从第一 AT命令中解析出第一 AT命令中字符" AT"后面的指示符和命令名 称, 如果该指示符是代表标准 AT命令的 "+"且该命令名称是预设的某标准 AT命令名 称, 则从该第一 AT命令中解析出某自定义的参数, 如果该参数表示连接(如 <mode>, 1表示连接), 则该第一判断结果为是; 否则, 该第一判断结果为否。 无线网络是例如: WIFI网络, 2G/3G等蜂窝网络等。 移动终端上可以内置无线芯片, 例如 WIFI芯片或 EDGE/3G双模芯片; 或者, 也 可以外置无线模组, 例如 WIFI模组或 EDGE/3G双模模组。 相应地, 该第一无线网络 连接指令应当为该无线芯片或无线模组能够识别的指令并且该无线芯片或无线模组能 够在该第一无线网络连接指令的控制下连接无线网络。 有鉴于本领域技术人员可以采用各种方式来设计并生成该第一无线网络连接指 令, 在此不再赘述。 在本发明实施例的步骤 102和步骤 103中, 对于无线网络为 WIFI网络情况, 该 第一 AT命令如果指示连接无线网络, 则可以有各种情形, 例如: 情形一, 第一 AT命令中可以不指示连接哪个 WIFI热点, 相应地, 移动终端生成 的第一无线网络连接指令中可以携带预设的 WIFI热点连接条件, 例如信号强度大于 一定门限。 或者, 情形二, 第一 AT命令中可以携带 WIFI热点连接条件, 例如信号强度大于一定门 限, 相应地, 移动终端生成的第一无线网络连接指令中也可以携带该条件。 或者, 情形三, 第一 AT命令中可以携带 WIFI热点标识参数(例如 SSID和 bSSID), 以 便指示连接哪个 WIFI热点, 相应地, 可以有: 生成第一无线网络连接指令包括: 从第一 AT命令中解析出 WIFI热点标识参数; 生成用于指示连接 WIFI热点的第一无线网络连接指令; 其中, 该 WIFI热点与上述 WIFI热点标识参数对应。 由此, 就可以实现对移动终端控制连接特定 WIFI热点的行为的控制。 考虑到移 动终端控制设置于自身的 WIFI芯片连接 WIFI网络的情况,这也增强了用户终端对移 动终端连接 WIFI网络行为的控制能力。 与上述情形对应, 第一无线网络连接指令应当为移动终端内置的无线芯片或外置 的无线模组能够识别的指令并且该无线芯片或无线模组能够在第一无线网络连接指令 的控制下执行相应的操作 (例如连接到满足该条件信息的 WIFI热点, 连接到指示连 接的 WIFI热点)。 有鉴于本领域技术人员可以采用各种方式来设计并生成第一无线网 络连接指令, 在此不再赘述。 进一步地, 考虑到用户终端在指示连接 WIFI网络之前, 可能需要知道 WIFI网络 的扫描情况, 有鉴于此, 接收用户终端发送的第一 AT命令之前, 该方法还可以包括: 获取一当前 WIFI网络的扫描结果; 向用户终端发送携带有扫描结果的第二 AT命令, 使得用户终端能够从该第二 AT命令中解析出扫描结果, 根据扫描结果生成并向移动 终端发送上述第一 AT命令。 其中, 该扫描结果可以为移动终端主动获取的, 也可以为在用户终端的指示下获 取的。 扫描结果可以包括扫描到的 WIFI热点标识列表, 可选地, 还可以包括列表中 每个 WIFI热点的信号强度等信息。 此外, 考虑到移动终端本身具有可以连接两类无线网络的能力, 如一类是蜂窝无 线网络、 一类是 WIFI无线网络, 则对蜂窝无线网络可以保留 PPP拨号的控制方式, 对 WIFI无线网络则采用本发明实施例中基于 AT命令的控制方式, 然而, 从计算机等 用户终端的角度来说, 两种不同方法做同一件事 (即, 使用数据卡等移动终端作为无 线 MODEM来访问网络), 增加了系统的复杂性, 耗费了一定的传输资源以及处理资 源, 在一定程度上就降低了控制的效率。 而 AT命令设计简单、 可扩展性强, 因此可 以进一步用于用户终端对移动终端控制连接不同类型无线网络的行为的控制。 这种方 式的控制效率更高,并且实现了仅通过使用 PPP拨号方式无法实现的目的。有鉴于此, 在移动终端具备控制连接到多种类型无线网络的能力时, 仍可通过基于 AT命令的方 式来控制, 例如, 使用不同的 AT命令名称来代表指示连接到不同类型的无线网络; 或者, 使用不同的参数来代表指示连接到不同类型的无线网络。对应于后者, 具体地, 可以有如下例子: 移动终端设置有用于连接具有第一网络类型的无线网络的第一模块和用于连接具 有第二网络类型的无线网络的第二模块, 生成第一无线网络连接指令包括: 从第一 AT 命令中解析出网络类型参数; 当网络类型参数为第一网络类型时, 生成用于控制第一 模块连接具有第一网络类型的无线网络的第一无线网络连接指令; 当网络类型参数为 第二网络类型时, 生成用于控制第二模块连接具有第二网络类型的无线网络的第一无 线网络连接指令。 在该例子中, 用户终端通过一条 AT命令就可以简单、 方便地对移动终端控制连 接不同类型无线网络的行为进行控制。 进一步地,考虑到用户终端可能不需要移动终端同时连接到不同类型的无线网络, 有鉴于此, 可以有: 接收用户终端发送的第一 AT命令之前, 该方法还包括: 在用户 终端的控制下, 控制第一模块建立与具有第一网络类型的无线网络之间的第一连接; 在第一连接建立时, 向用户终端发送携带有无线网络已连接状态的第三 AT命令, 使 得用户终端能够根据第三 AT命令生成并向移动终端发送指示断开连接的第四 AT命 令; 接收第四 AT命令; 根据该第四 AT命令控制第一模块断开第一连接; 在第一连接 断开时, 向用户终端发送携带有无线网络未连接状态的第五 AT命令, 使得用户终端 能够根据第五 AT命令生成并向移动终端发送上述第一 AT命令。 由此, 用户终端在确认某连接断开时才会指示连接特定类型无线网络, 从而也就 实现了用户终端对移动终端针对无线网络连接及断开的控制行为的简单控制, 简化了 控制流程, 便捷、 可靠、 高效。 其中, 在用户终端的控制下, 控制第一模块建立与具有第一网络类型的无线网络 之间的第一连接可以包括: 接收用户终端发送的第六 AT命令; 判断第六 AT命令是否 指示连接无线网络, 获取一第二判断结果; 当第二判断结果为是时, 生成第二无线网 络连接指令。 由此, 用户终端通过第二 AT命令来对移动终端控制连接特定类型无线网络的行 为进行控制, 在第一连接建立时, 通过第四 AT命令指示移动终端断开第一连接, 在 第一连接断开时又通过第一 AT命令对移动终端控制连接特定类型无线网络的行为进 行控制, 这样, 对于这两种特定类型为同一类型的情况, 用户终端就可以方便地对移 动终端控制建立及断开特定类型无线网络连接的行为进行控制; 对于这两种特定类型 为不同类型的情况, 用户终端就可以方便地对移动终端进行控制, 使得移动终端能够 控制空口处第一模块对应的无线通路与第二模块对应的无线通路之间的任意切换。 在本发明实施例中, 第一网络类型可以为 WIFI和蜂窝中的一个, 第二网络类型 可以为 WIFI和蜂窝中除第一网络类型之外的一个。 在本发明实施例中, 具体到移动终端为数据卡且无线网络为 WIFI 网络的情况, 又有另一个好处, 具体描述如下: 随着 WIFI技术的发展, AP热点的部署的逐步增加, 越来越多的终端类产品都开 始支持 WIFI功能。传统的数据卡也开始向 T+W类数据卡发展。 T即 TD-SCDMA, W 即 WLAN,意思是说相对于传统数据卡来说,通过 UI界面的操作,不仅可以连接 2G/3G 网络, 还可以在有 WIFI环境的地方, 任意切换到 WIFI上进行数据业务。 WIFI网络 相对于 2G/3G网络, 具有速度快, 无流量限制等特点。 可以丰富数据卡的使用场景。 但是这里提到的 τ+w类数据卡, 还是有一定的使用限制, 因为数据卡本身没有The present invention relates to the field of communications, and in particular, to a control method, device, and mobile terminal. BACKGROUND Currently, a user terminal such as a computer can access a cellular network (such as an EDGE/3G network) by using a mobile terminal such as a data card as a wireless MODEM. The user terminal needs to configure the APN parameter for the mobile terminal by using the standard AT command AT+CGDCONT, and then uses the PPP dialing method to control the behavior of the mobile terminal controlling the connection to the cellular network. However, PPP dialing requires the use of a dialer provided by the computer operating system, which is strongly related to the operating system. Once the services and related settings required by the dialer are changed by the user or other applications, the continuous execution of the dialer will fail or even be restored. In other words, the robustness of this control method is not high. SUMMARY OF THE INVENTION In view of this, an object of embodiments of the present invention is to provide a control method, apparatus, and mobile terminal to implement high robustness control of a mobile terminal controlling a behavior of connecting to a wireless network. The embodiment of the present invention provides a control method, which is used in a mobile terminal, and the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and the method includes: Receiving a first AT command sent by the user terminal; determining whether the first AT command indicates to connect to the wireless network, obtaining a first determination result; and when the first determination result is YES, generating a first wireless network connection instruction. Preferably, the wireless network is a WIFI network, and the generating the first wireless network connection instruction comprises: parsing a WIFI hotspot identification parameter from the first AT command; generating the first wireless for indicating a connection to a WIFI hotspot The network connection command; wherein, the WIFI hotspot corresponds to the WIFI hotspot identification parameter. Preferably, before the receiving the first AT command sent by the user terminal, the method further includes: acquiring a scan result of the current WIFI network; sending a second AT command carrying the scan result to the user terminal, so that the user terminal The scan result can be parsed from the second AT command, and the first AT command is generated and transmitted to the mobile terminal according to the scan result. Preferably, the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, the generating the first wireless network connection instruction comprising: Parsing a network type parameter in the first AT command; generating, when the network type parameter is a first network type, the first wireless for controlling the first module to connect to a wireless network having a first network type a network connection instruction; when the network type parameter is a second network type, generating the first wireless network connection instruction for controlling the second module to connect to a wireless network having a second network type. Preferably, before the receiving the first AT command sent by the user terminal, the method further includes: controlling, by the user terminal, the first between the first module and the wireless network having the first network type Connecting, when the first connection is established, transmitting, to the user terminal, a third AT command carrying a connected state of the wireless network, so that the user terminal can generate and send a disconnection indication to the mobile terminal according to the third AT command. a fourth AT command; receiving the fourth AT command; controlling, according to the fourth AT command, the first module to disconnect the first connection; when the first connection is disconnected, transmitting to the user terminal The fifth AT command of the wireless network not connected state enables the user terminal to generate and transmit the first AT command to the mobile terminal according to the fifth AT command. Preferably, the controlling, by the user terminal, the first connection between the first module and the wireless network having the first network type is: receiving a sixth AT command sent by the user terminal; determining the Whether the six AT command indicates that the wireless network is connected to obtain a second determination result; when the second determination result is YES, the second wireless network connection instruction is generated. Preferably, the first network type is one of WIFI and a cell, and the second network type is one of WIFI and a cell except the first network type. The embodiment of the present invention provides a control device, which is used in a mobile terminal, where the device includes: a first receiving module, configured to receive a first AT command sent by a user terminal; and a determining module, configured to determine the first AT command Whether the connection to the wireless network is instructed to obtain a first determination result; and the generating module is configured to generate a first wireless network connection instruction when the first determination result is YES. Preferably, the wireless network is a WIFI network, and the generating module includes: a first parsing unit, configured to parse the WIFI hotspot identification parameter from the first AT command when the first determining result is yes; The first generating unit is configured to generate the first wireless network connection instruction for indicating a connection to the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter. Preferably, the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, the generating module comprising: a second analyzing unit, setting When the first determination result is YES, the network class is extracted from the first AT command. a second generating unit, configured to: when the network type parameter is a first network type, generate the first wireless network connection instruction for controlling the first module to connect to a wireless network having a first network type; And a unit, configured to: when the network type parameter is a second network type, generate the first wireless network connection instruction for controlling the second module to connect to a wireless network having a second network type. Preferably, the device further includes: a first control module, configured to: before the receiving module receives the first AT command sent by the user terminal, control, by the user terminal, the first module to establish and have the first network a first connection between the wireless networks of the type; the second sending module is configured to: before the receiving, receiving, by the receiving module, the first AT command sent by the user terminal, when the first connection is established, sending the wireless network to the user terminal a third AT command of the connected state, so that the user terminal can generate and send a fourth AT command indicating disconnection to the mobile terminal according to the third AT command; and the second receiving module is configured to receive the user terminal by the receiving module Before the first AT command is sent, the fourth AT command is received; the second control module is configured to: before the receiving module receives the first AT command sent by the user terminal, control the first according to the fourth AT command The module disconnects the first connection; the third sending module is configured to receive, before the receiving module receives the first AT command sent by the user terminal And transmitting, when the first connection is disconnected, a fifth AT command carrying a wireless network unconnected state to the user terminal, so that the user terminal can generate and send the first AT command to the mobile terminal according to the fifth AT command. . Preferably, the first control module includes: a control unit, configured to receive a sixth AT command sent by the user terminal before the receiving module receives the first AT command sent by the user terminal; and the determining unit is configured as the receiving module Before receiving the first AT command sent by the user terminal, determining whether the sixth AT command indicates to connect to the wireless network, and obtaining a second determination result; the fourth generating unit is configured to receive, by the receiving module, the first AT sent by the user terminal Before the command, when the second determination result is YES, a second wireless network connection instruction is generated. Embodiments of the present invention provide a mobile terminal including the above control device. As can be seen from the above, the embodiment of the present invention has at least the following beneficial effects: The mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and is sent by the receiving user terminal. The first AT command, when the first AT command indicates to connect to the wireless network, generates a first wireless network connection command, thereby achieving high robustness control of the behavior of the mobile terminal controlling the connected wireless network. BRIEF DESCRIPTION OF DRAWINGS FIG. 1 is a flow chart of steps of a control method according to an embodiment of the present invention; FIG. 2 is a block diagram of a software structure of a data card based on hardware WIFI; 3 is a flow chart of initializing AT commands; FIG. 4 is a flow chart for connecting AT commands; FIG. 5 is a flow chart for canceling connection AT commands; FIG. 6 is a flow chart for disconnecting AT commands; The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. FIG. 1 is a flowchart of a method for controlling a method according to an embodiment of the present invention. Referring to FIG. 1, an embodiment of the present invention provides a control method, where the method includes the following steps: Step 101: Receive a first AT command sent by a user terminal; Step 102: Determine whether the first AT command indicates to connect to the wireless network, and obtain a first determination result. Step 103: When the first determination result is yes, generate a first wireless network connection instruction. The method is applied to a mobile terminal, and the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel established between the mobile terminal and the user terminal. It can be seen that the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and receives the first AT command sent by the user terminal, and indicates that the first AT command is connected to the wireless network. The first wireless network connection command is generated, thereby achieving high robustness control of the behavior of the mobile terminal controlling the connection to the wireless network. In this way, the information exchange between the user terminal and the mobile terminal can be performed through the established AT command transmission channel, and the PPPOE transmission channel is no longer needed, thereby reducing the consumption of a certain time resource caused by establishing the PPPOE transmission channel and The certain transmission resources and processing resources are occupied between the mobile terminal and the user terminal, thereby achieving an efficient control of the behavior of the mobile terminal controlling the connection to the wireless network to a certain extent. The mobile terminal may be, for example, a data card, a mobile phone, a tablet, or the like. Determining whether the first AT command indicates to connect to the wireless network, and when obtaining a first determination result, the indicator following the character "AT" in the first AT command may be parsed from the first AT command, if it is a standard AT command "+", the first judgment result is No; if it is a custom specific character (such as " Λ "), the first judgment result is YES. For another example: parsing an indicator following the character "AT" in the first AT command from the first AT command, and if it is a customized specific character, parsing the command name following the specific character from the first AT command If it is a custom name representing the wireless network connection (such as "TCO 顺"), the first judgment result is yes; otherwise, the first judgment result is no. For another example, the indicator and the command name following the character "AT" in the first AT command are parsed from the first AT command, if the indicator is "+" representing the standard AT command and the command name is a preset The standard AT command name parses a custom parameter from the first AT command. If the parameter indicates a connection (such as <mode>, 1 indicates a connection), the first judgment result is yes; otherwise, the first The result of a judgment is no. The wireless network is, for example, a WIFI network, a cellular network such as 2G/3G, and the like. A wireless chip can be built in the mobile terminal, such as a WIFI chip or an EDGE/3G dual-mode chip; or an external wireless module, such as a WIFI module or an EDGE/3G dual-mode module. Correspondingly, the first wireless network connection command should be an instruction that can be recognized by the wireless chip or the wireless module and the wireless chip or the wireless module can be connected to the wireless network under the control of the first wireless network connection instruction. The first wireless network connection instruction may be designed and generated in various manners by those skilled in the art, and details are not described herein again. In the step 102 and the step 103 of the embodiment of the present invention, if the wireless network is a WIFI network, if the first AT command indicates that the wireless network is connected, there may be various situations, for example: Case 1, the first AT command may be The first wireless network connection command generated by the mobile terminal may carry a preset WIFI hotspot connection condition, for example, the signal strength is greater than a certain threshold. Or, in the second case, the first AT command may carry the WIFI hotspot connection condition, for example, the signal strength is greater than a certain threshold, and correspondingly, the first wireless network connection command generated by the mobile terminal may also carry the condition. Or, in the third case, the first AT command may carry WIFI hotspot identification parameters (such as SSID and bSSID) to indicate which WIFI hotspot is connected, and accordingly, may have: The generating the first wireless network connection command includes: parsing the WIFI hotspot identification parameter from the first AT command; generating a first wireless network connection instruction for indicating the connection of the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter. Thereby, control of the behavior of the mobile terminal controlling the connection of a specific WIFI hotspot can be realized. Considering that the mobile terminal controls the setting of its own WIFI chip to connect to the WIFI network, this also enhances the control capability of the user terminal to connect the mobile terminal to the WIFI network. Corresponding to the above situation, the first wireless network connection command should be an instruction that can be recognized by the wireless chip built in the mobile terminal or an external wireless module, and the wireless chip or the wireless module can be executed under the control of the first wireless network connection instruction. Corresponding operations (such as connecting to a WIFI hotspot that satisfies the condition information, connecting to a WIFI hotspot indicating the connection). The first wireless network connection instruction can be designed and generated in various manners by those skilled in the art, and details are not described herein again. Further, it is considered that the user terminal may need to know the scanning condition of the WIFI network before instructing to connect to the WIFI network. In this regard, before receiving the first AT command sent by the user terminal, the method may further include: acquiring a current WIFI network. Scanning result; transmitting a second AT command carrying the scan result to the user terminal, so that the user terminal can parse the scan result from the second AT command, and generate and send the first AT command to the mobile terminal according to the scan result. The scan result may be acquired by the mobile terminal or may be obtained by the user terminal. The scan result may include a scanned list of WIFI hotspot identifiers, and optionally, information such as signal strength of each WIFI hotspot in the list. In addition, considering that the mobile terminal itself has the ability to connect two types of wireless networks, such as a cellular wireless network and a WIFI wireless network, the PPP dialing control mode can be reserved for the cellular wireless network, and the WIFI wireless network is used for the WIFI wireless network. In the embodiment of the present invention, the control method based on the AT command is used. However, from the perspective of a user terminal such as a computer, two different methods do the same thing (ie, using a mobile terminal such as a data card as a wireless MODEM to access the network), The complexity of the system consumes a certain amount of transmission resources and processing resources, which reduces the efficiency of control to a certain extent. The AT command is simple in design and extensible, so it can be further used for the control of the behavior of the mobile terminal controlling the connection of different types of wireless networks by the user terminal. This type of control is more efficient and achieves the goal that cannot be achieved only by using PPP dialing. In view of this, when the mobile terminal has the ability to control connection to multiple types of wireless networks, it can still be controlled by means of an AT command, for example, using different AT command names to indicate connection to different types of wireless networks; Or, use different parameters to represent the connection to a different type of wireless network. Corresponding to the latter, specifically, there may be the following examples: The mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, and generating the first wireless network connection instruction comprises: from the first AT command Parsing the network type parameter; when the network type parameter is the first network type, generating a first wireless network connection instruction for controlling the first module to connect to the wireless network having the first network type; and when the network type parameter is the second network type And generating, by the second module, a first wireless network connection instruction for controlling the second module to connect to the wireless network having the second network type. In this example, the user terminal can control the behavior of the mobile terminal to control different types of wireless networks simply and conveniently through an AT command. Further, in consideration of the fact that the user terminal may not need to connect to the different types of wireless networks at the same time, in view of the above, the method may further include: before receiving the first AT command sent by the user terminal, the method further includes: under the control of the user terminal Controlling, by the first module, a first connection with the wireless network having the first network type; when the first connection is established, transmitting, to the user terminal, a third AT command carrying the connected state of the wireless network, so that the user terminal can enable Generating and transmitting to the mobile terminal a fourth AT command indicating disconnection according to the third AT command; receiving a fourth AT command; controlling the first module to disconnect the first connection according to the fourth AT command; when the first connection is disconnected And transmitting, to the user terminal, a fifth AT command carrying a wireless network unconnected state, so that the user terminal can generate and send the first AT command to the mobile terminal according to the fifth AT command. Therefore, the user terminal instructs to connect to a specific type of wireless network when confirming that the connection is disconnected, thereby implementing simple control of the control behavior of the mobile terminal for the wireless network connection and disconnection of the mobile terminal, and simplifying the control process. Convenient, reliable and efficient. The controlling, by the user terminal, the first connection between the first module and the wireless network having the first network type may include: receiving a sixth AT command sent by the user terminal; determining whether the sixth AT command indicates the connection The wireless network obtains a second determination result; when the second determination result is YES, generates a second wireless network connection instruction. Thereby, the user terminal controls, by the second AT command, the behavior of the mobile terminal controlling the connection to the specific type of wireless network, and when the first connection is established, instructing the mobile terminal to disconnect the first connection by using the fourth AT command, in the first connection When disconnected, the behavior of the mobile terminal to control a specific type of wireless network is controlled by the first AT command, so that the user terminal can conveniently establish and disconnect the mobile terminal for the case where the two specific types are of the same type. Controlling the behavior of a specific type of wireless network connection; for the case where the two specific types are different types, the user terminal can conveniently control the mobile terminal, so that the mobile terminal can control the wireless path corresponding to the first module at the air interface. Any switching between the wireless channels corresponding to the second module. In the embodiment of the present invention, the first network type may be one of the WIFI and the cellular, and the second network type may be one of the WIFI and the cellular except the first network type. In the embodiment of the present invention, when the mobile terminal is a data card and the wireless network is a WIFI network, there is another advantage, and the specific description is as follows: With the development of the WIFI technology, the deployment of the AP hotspot is gradually increased, and more and more The more terminal products are starting to support WIFI. Traditional data cards have also begun to evolve into T+W data cards. T is TD-SCDMA, W is WLAN, which means that compared to the traditional data card, through the operation of the UI interface, not only can connect 2G/3G network, but also can switch to WIFI in any place with WIFI environment. Data business. Compared with 2G/3G networks, WIFI networks have the characteristics of fast speed and no traffic restriction. Can enrich the use of the data card. However, the τ+w data card mentioned here still has certain usage restrictions, because the data card itself does not.
WIFI芯片, 所以连接 WIFI网络时需要借用所连接用户终端 (如计算机) 上的无线网 卡, 如笔记本电脑自带的内置无线网卡, 如果用户终端没有无线网卡, 就无法连接 WIFI网络, 只能当传统数据卡用。 针对这一使用不便的地方, 可以在数据卡上添加 WIFI芯片, 由数据卡控制自身 上设置的 WIFI芯片连接 WIFI网络,但是, 目前用户终端无法对数据卡控制连接 WIFI 网络的行为进行控制。 由此, 具体到移动终端为数据卡的情况, 本发明实施例的另一个好处是提供对数 据卡控制连接 WIFI网络的行为的控制方式。 又, 数据卡在插入用户终端时, 可以枚举出 NDIS网卡设备, 该设备默认是非连 接状态, 而在 WIFI连接成功后, 该设备会置为连接状态, 于是该设备就成为数据传 输的通道, 数据卡再通过 DHCP服务端来为用户终端分配 IP, 这样用户终端就可以通 过数据卡来进行数据业务。这样也就解决了带硬件 WIFI芯片 T+W类数据卡的用户终 端侧软件难于控制的问题。 这样, 用户终端在没有无线网卡或无线网卡暂不可用或暂 不启用的情况下, 仍然可以通过数据卡访问 WIFI 网络, 从而拓展了数据卡的应用场 景。 为了将本发明实施例进一步阐述清楚, 下面以用户终端为个人计算机 (PC机)、 移动终端为数据卡、 第一模块和第二模块内置于数据卡的情况为例, 提供本发明实施 例的较佳实施方式。 本较佳实施方式提供一种基于 AT命令的控制方法,满足带硬件 WIFI数据卡连接 操作要求。 为了解决上述问题, 本发明提出一种基于 AT命令的控制方法, 其核心包括一组 AT命令集。 PC侧软件可以通过相关新增的 AT命令来操作数据卡, 数据卡接受 AT命 令后按命令给出的参数执行, 将执行结果返回给 PC侧软件, 同时若数据卡在执行 AT 命令后有状态的改变, 则主动上报相应的 AT命令给 PC侧软件, PC侧软件再根据上 报结果决定下一步发什么 AT命令来进行控制。 新增的 AT命令包括当前连接状态上报 AT命令, WIFI热点扫描 AT命令和网络连 接 AT命令。 首先, 当数据卡插入计算机, 会枚举三个 COM端口类设备和一个 NDIS网卡类 设备。 其中, COM端口类设备是 AT命令传输的通道。 NDIS网卡类设备默认是非连 接状态, 当无线连接成功后, 会置为连接状态, 是数据卡与计算机之间数据传输的通 道。 关于当前连接状态上报 AT命令: 当 COM端口类设备可用后, PC侧软件给数据卡下发状态上报使能 AT命令, 数 据卡收到该命令后会立即开始主动上报当前状态。其中, 上报的第一位指示网络类型, 是 2G/3G网络还是 WIFI网络, 第二位表示当前网络类型下的状态。 第一步, 若数据卡在插入计算机后初始化成功, 2G/3G网络或 WIFI网络已准备 好且无异常, 则上报初始化成功。 否则上报初始化失败, 不能连接网络。 第二步, 数据卡会自动上报网络未连接状态, 指示 PC侧软件可以开始连接网络。 也就是说,数据卡在收到 PC侧软件下发的状态上报使能 AT命令后,正常情况下, 会先后上报针对 2G/3G网络连接类型的初始化成功、 网络未连接状态, 以及会先后上 报针对 WIFI网络连接类型的初始化成功、 网络未连接状态。 此外, 数据卡具有的其他状态上报功能包括: 正在连接时上报网络正在连接, 连 接成功后上报网络已连接, 正在断开连接时上报正在断开连接, 正在连接时若再取消 则进入正在取消连接状态, 连接断开后则再上报网络未连接, 此时可以再发起连接。 当数据卡进入正在扫描 AP热点的状态时,会上报正在扫描 AP状态, 目的是告知 PC侧软件, 此时连接 AT命令或断开连接 AT命令可能无法响应, 需要延迟执行。 当 扫描结束后, 重新上报扫描前的状态。 关于 WIFI热点扫描 AT命令: 由 PC侧软件在数据卡上报 WIFI网络初始化成功后通过 AT命令进行使能设置。 若设置时的 AT命令中包含时间参数且参数值不为零, 则根据参数值使能数据卡 上的定时器, 当定时器超时后, 数据卡自动进行 WIFI热点的扫描, 以 TAINF主动上 报 AT命令。 上报 AT命令的前二位参数表示 WIFI热点的 SSID和 bSSID, 用于区分唯一的 WIFI热点, 第三位参数表示该 WIFI热点当前的信号强度。 若设置时 AT命令中包含的时间参数为零时, 则立即进行一次 WIFI热点的扫描, 并主动上报扫描结果, 上报格式同定时扫描上报。 此种模式在 PC侧软件需要立即获 取当前周边 WIFI热点信息时使用。 若设置时 AT命令中还包含 SSID和 bSSID参数时, 则指示数据卡根据 SSID和 bSSID的值, 数据卡立即获取指定 WIFI热点的当前信号强度并提供给 PC侧软件。 关于网络连接类 AT命令: 网络连接类 AT命令包括网络连接 AT命令, 取消网络连接 AT命令和断开网络连 接 AT命令。 当数据卡主动上报网络未连接状态后, PC侧软件可以进行网络连接 AT命令的下 发。 命令的第一位参数是连接网络类型, 表示当前的连接操作是连接 2G/3G网络还是 WIFI网络。 因为考虑到若正在连接过程中, 有取消连接的场景。 第二位参数的含义表示当前 的动作是连接网络还是取消连接网络, 用于区分。 当连接的网络类型是 WIFI 网络时第三位和第四位参数才有效, 用于指定唯一的 待连接 WIFI热点。 网络连接类 AT命令还包含参数获取 AT命令和连接时参数设置 AT命令。 参数获取 AT命令带有标示唯一 WIFI热点关键信息的 SSID和 bSSID参数, 数据 卡执行该命令后, 会给 PC侧软件返回获取到的热点信息, 信息包括鉴权方式, 加密 算法, 网络类型和信号强度, PC侧软件将这些信息展示, 并可以修改。 在下发连接 WIFI热点 AT命令前, 需要通过参数设置 AT命令, 将鉴权方式, 加 密算法, 认证方式和密钥再设置到数据卡中, 供连接时使用。 参数设置 AT命令和连接 WIFI热点 AT命令通过两个命令都携带的 SSID和 bSSID 参数进行对应。 当数据卡主动上报网络已连接状态后, PC侧软件可以进行断开网络连接 AT命令 的下发。 命令的参数只需要指定当前待断开网络连接的类型, 或者设置为任意类型。 连接在同一时刻只有一种会生效,即保持连接状态。不论 2G/3G网络连接成功后, 还是 WIFI连接成功后, 再将 NDIS网卡置为连接状态, 并通过 DHCP服务端来分配 IP, 这样计算机就可以通过数据卡来进行数据业务。 当不再进行数据业务时, 可以进 行断开操作, 这时会将 NDIS网卡置为未连接状态, 数据卡进入空闲状态, 同时也不 会影响到计算机上其它网络连接的使用。 采用本较佳实施方式, 解决了带硬件 WIFI芯片 T+W类数据卡的 PC侧软件难于 控制的问题, 使用统一的一套 AT命令集, 可以方便在 2G/3G网络和 WIFI网络之间 连接和切换, 简单有效。 WIFI chip, so when connecting to WIFI network, you need to borrow the wireless network card on the connected user terminal (such as computer), such as the built-in wireless network card that comes with the laptop. If the user terminal does not have a wireless network card, you can't connect to the WIFI network. For data cards. For this inconvenient place, a WIFI chip can be added to the data card, and the WIFI chip set on the data card itself is connected to the WIFI network. However, at present, the user terminal cannot control the behavior of the data card to control the connection to the WIFI network. Therefore, specific to the case where the mobile terminal is a data card, another advantage of the embodiment of the present invention is to provide a control method for controlling the behavior of the data card to connect to the WIFI network. Moreover, when the data card is inserted into the user terminal, the NDIS network card device can be enumerated. The device is in a non-connected state by default, and after the WIFI connection is successful, the device is placed in a connected state, and the device becomes a channel for data transmission. The data card then allocates IP to the user terminal through the DHCP server, so that the user terminal can perform data service through the data card. This also solves the problem that the user terminal side software with the hardware WIFI chip T+W type data card is difficult to control. In this way, the user terminal can still access the WIFI network through the data card without the wireless network card or the wireless network card is temporarily unavailable or temporarily disabled, thereby expanding the application scenario of the data card. In order to further clarify the embodiment of the present invention, the following is an example of the embodiment of the present invention, in which the user terminal is a personal computer (PC), the mobile terminal is a data card, and the first module and the second module are built in the data card. Preferred embodiment. The preferred embodiment provides a control method based on the AT command, which satisfies the requirements for the connection operation of the hardware WIFI data card. In order to solve the above problem, the present invention proposes a control method based on an AT command, the core of which includes a set of AT command sets. The PC side software can operate the data card through the related new AT command. After the data card accepts the AT command, it executes according to the parameters given by the command, returns the execution result to the PC side software, and if the data card has a status after executing the AT command. The change, the initiative to report the corresponding AT command to the PC side software, PC side software and then according to the report results to decide what AT command to send next to control. The newly added AT commands include the current connection status reporting AT command, the WIFI hotspot scanning AT command, and the network connection AT command. First, when a data card is inserted into the computer, three COM port class devices and one NDIS NIC class device are enumerated. Among them, the COM port class device is the channel for AT command transmission. The NDIS network card device defaults to the non-connected state. When the wireless connection is successful, it is set to the connection state, which is the channel for data transmission between the data card and the computer. Reporting the AT command on the current connection status: When the COM port class device is available, the PC side software sends the status report to the data card to enable the AT command. After receiving the command, the data card will immediately report the current status. The first bit of the report indicates the network type, whether it is a 2G/3G network or a WIFI network, and the second bit indicates the status under the current network type. In the first step, if the data card is successfully initialized after being inserted into the computer, and the 2G/3G network or the WIFI network is ready and there is no abnormality, the report is successfully initialized. Otherwise, the escalation initialization fails and the network cannot be connected. In the second step, the data card automatically reports that the network is not connected, indicating that the PC side software can start to connect to the network. That is to say, after the data card is reported to be enabled by the PC-side software to enable the AT command, the normalization will be reported to the 2G/3G network connection type, the network is not connected, and the network will be reported. The initialization of the WIFI network connection type is successful and the network is not connected. In addition, other status reporting functions of the data card include: When the connection is being made, the reporting network is connected. After the connection is successful, the reporting network is connected. When the connection is disconnected, the reporting is disconnected. If the connection is canceled, the connection is canceled. Status, after the connection is disconnected, the network is not reported, and the connection can be initiated again. When the data card enters the state of scanning the AP hotspot, it will report that the AP status is being scanned. The purpose is to inform the PC side software. At this time, connecting the AT command or disconnecting the AT command may fail to respond and need to be delayed. When the scan ends, the status before the scan is re-reported. About the WIFI hotspot scanning AT command: The PC side software reports the WIFI network initialization on the data card and then enables the setting by the AT command. If the AT command in the setting contains the time parameter and the parameter value is not zero, the timer on the data card is enabled according to the parameter value. When the timer expires, the data card automatically scans the WIFI hotspot, and the ATINF actively reports the AT. command. The first two parameters of the reported AT command indicate the SSID and bSSID of the WIFI hotspot, which are used to distinguish the unique WIFI hotspot, and the third parameter indicates the current signal strength of the WIFI hotspot. If the time parameter included in the AT command is set to zero, the WIFI hotspot scan is performed immediately, and the scan result is reported automatically, and the report format is reported with the same timed scan. This mode is used when the PC side software needs to immediately obtain the current surrounding WIFI hotspot information. If the AT command also includes the SSID and bSSID parameters, the data card is instructed to obtain the current signal strength of the specified WIFI hotspot and provide the PC side software according to the values of the SSID and the bSSID. About the network connection class AT command: The network connection class AT command includes the network connection AT command, the cancel network connection AT command, and the disconnect network connection AT command. After the data card actively reports that the network is not connected, the PC side software can send the network connection AT command. The first parameter of the command is the connection network type, indicating whether the current connection operation is to connect to the 2G/3G network or the WIFI network. Because it is considered that if there is a connection process, there is a scene of canceling the connection. The meaning of the second parameter indicates whether the current action is to connect to the network or to disconnect the network for differentiation. The third and fourth parameters are valid when the connected network type is a WIFI network, and is used to specify a unique WIFI hotspot to be connected. The network connection class AT command also contains parameters to get the AT command and the parameter setting AT command when connecting. The parameter acquires the AT command with the SSID and bSSID parameters indicating the key information of the unique WIFI hotspot. After the data card executes the command, it returns the obtained hotspot information to the PC side software, including the authentication mode, encryption algorithm, network type and signal. Intensity, PC side software displays this information and can be modified. Before the connection to the WIFI hotspot AT command is sent, the AT command is required to set the authentication mode, encryption algorithm, authentication mode and key to the data card for connection. The parameter setting AT command and the connection WIFI hotspot AT command correspond to the SSID and bSSID parameters carried by both commands. After the data card actively reports that the network is connected, the PC-side software can issue the disconnection of the network connection AT command. The parameters of the command only need to specify the type of the network connection to be disconnected, or set to any type. Only one of the connections will take effect at the same time, that is, stay connected. After the 2G/3G network connection is successful, or after the WIFI connection is successful, the NDIS network card is placed in a connected state, and the IP is allocated through the DHCP server, so that the computer can perform data services through the data card. When the data service is no longer performed, the disconnection operation can be performed. At this time, the NDIS network card is placed in an unconnected state, and the data card enters an idle state without affecting the use of other network connections on the computer. By adopting the preferred embodiment, the problem that the PC side software with the hardware WIFI chip T+W data card is difficult to control is solved, and the unified AT command set is used to conveniently connect between the 2G/3G network and the WIFI network. And switching, simple and effective.
<本较佳实施方式的优选实施例> 图 2为本较佳实施方式的优选实施例的基于硬件 WIFI的数据卡软件结构框图, 参照图 2, 其中 WLAN协议桟用来在 SDIO驱动的配合下控制 WIFI芯片连接 WIFI 热点; 2G/3G协议桟支持 PDP激活功能, 用于控制 2G/3G芯片连接蜂窝网络; NDIS 协议桟基于 USB驱动可以在数据卡插入计算机后枚举出网卡设备,用来做计算机和数 据卡之间数据交互的桥梁。 其中的 AT命令集, 通过对以上三者进行统筹控制, 以达 到数据卡既可以在 2G/3G网络环境中使用, 又可以在 WIFI网络环境下使用, 并且可 以方便的进行切换使用, 增强了数据卡类的产品的适用性。 这里,用于连接具有蜂窝类型的无线网络的模块包括 2G/3G协议桟和 2G/3G芯片, 用于连接具有 WIFI类型的无线网络的模块包括 WLAN协议桟、 SDIO驱动和 WIFI 心片; 无线网络连接指令由数据收发及其控制模块在扩展 AT命令模块的控制下生成, 该扩展 AT命令模块从 AT引擎接收到新增 AT命令后, 基于 API接口对该数据收发及 其控制模块进行控制, 而对于接收到指示连接无线网络的新增 AT命令的情况, 该扩 展 AT命令模块控制该数据收发及其控制模块生成无线网络连接指令。 下面结合图 3~7对新增加的 AT命令在本较佳实施方式中的应用过程进行详细的 说明: 图 3为初始化 AT命令流程图, 参照图 3, 上电初始化过程和定时扫描上报过程包 括以下步骤: 开机 AT端口可用后, PC侧软件向数据卡发送如下 AT命令: ATATMODE=<n> <Preferred embodiment of the preferred embodiment> FIG. 2 is a structural block diagram of a hardware WIFI-based data card software according to a preferred embodiment of the preferred embodiment. Referring to FIG. 2, the WLAN protocol is used under the cooperation of the SDIO driver. Control WIFI chip to connect WIFI hotspot; 2G/3G protocol 桟 support PDP activation function, used to control 2G/3G chip to connect to cellular network; NDIS protocol 桟 based on USB driver can enumerate NIC device after data card is inserted into computer, used to do A bridge for data interaction between computers and data cards. The AT command set, through the overall control of the above three, to achieve data card can be used in the 2G/3G network environment, can also be used in the WIFI network environment, and can be easily switched to use, enhanced data Applicability of card products. Here, the module for connecting the wireless network having the cellular type includes a 2G/3G protocol and a 2G/3G chip, and the module for connecting the wireless network having the WIFI type includes a WLAN protocol, an SDIO driver, and a WIFI card; The wireless network connection command is generated by the data transceiver and its control module under the control of the extended AT command module. After the extended AT command module receives the new AT command from the AT engine, the data transceiver and its control module are controlled based on the API interface. And in the case of receiving a new AT command indicating connection to the wireless network, the extended AT command module controls the data transceiver and its control module to generate a wireless network connection command. The application process of the newly added AT command in the preferred embodiment will be described in detail below with reference to FIG. 3 to FIG. 3: FIG. 3 is a flowchart of initializing the AT command. Referring to FIG. 3, the power-on initialization process and the timing scan reporting process include The following steps: After the AT port is available, the PC side software sends the following AT command to the data card: AT A TMODE=<n>
<n>的取值: 0 取消 ATMODE的上报 1使能 ATMODE的上报 图 3中 <n>的取值为 1, 即使能状态上报。 使能成功后 (即数据卡向 PC侧软件发送 ATMODE: 1 OK) 开始 ATMODE状态的 主动上报, 意义如下: ATMODE: <linkstatus>,<netstatus> Value of <n>: 0 Cancel the report of A TMODE 1 Enable the report of A TMODE. The value of <n> in Figure 3 is 1, even if the status can be reported. After the enable is successful (that is, the data card sends A TMODE to the PC side software: 1 OK), the active reporting of the A TMODE state begins, and the meaning is as follows: ATMODE: <linkstatus>, <netstatus>
<linkstatus>: 连接类型标识: 1 WIFI 2 <linkstatus>: Connection type identifier: 1 WIFI 2
TD/EDGE TD/EDGE
<netstatus>: 网络类型标识: <netstatus>: Network type identifier:
0初始化成功 0 initialization succeeded
1初始化失败, 不能连接 1 initialization failed, can not connect
2网络未连接 2 network is not connected
3网络正在连接 3 network is connecting
4网络已连接 4 network is connected
5正在取消连接 6正在断开连接 5 is canceling the connection 6 is disconnecting
11正在扫描 WIFI热点, 当<1^^&^;8>=1时 11 is scanning WIFI hotspot, when <1^^&^;8>=1
生效 当 WIFI网络为初始化成功状态ΛTMODE:1,0上报后, PC侧软件可以向 数据卡发送如下 AT命令, 控制 AINF的上报以及上报的频率: ATATAINF=<n>,[<time>,<ssid>,<bssid>] <n>: 0取消 ATAINF的上报 1使能 ATAINF的上报 <time>: 上报时间间隔, 单位秒, 大小 0~65535 若为 0表示立即上报一次。 当 <η>=1时生效 <ssid>: WIFI网络 SSID <bssid>: WIFI网络 bSSID 命令执行成功后会立即上报 WIFI热点信息一次, 但做为一个响应上报。 此后根 据设置的时间间隔定时主动上报 WIFI热点信息。 After the WIFI network is initialized successfully Λ TMODE: 1, 0 is reported, the PC side software can send the following AT command to the data card to control the reporting of the AINF and the frequency of reporting: AT A TAINF=<n>, [<time> , <ssid>, <bssid>] <n>: 0 Cancel the reporting of A TAINF 1 Enable the reporting of A TAINF <time>: Reporting interval, in seconds, size 0~65535 If 0, it will be reported immediately. When <η>=1, the <ssid>: WIFI network SSID <bssid>: The WIFI network bSSID command will report the WIFI hotspot information once, but it will be reported as a response. Thereafter, the WIFI hotspot information is actively reported according to the set time interval.
WIFI热点信息上报格式为: The WIFI hotspot information reporting format is:
ATAINF: <ssid>,<bssid>,<rssi> A TAINF: <ssid>, <bssid>, <rssi>
<ssid>: WIFI网络 SSID <ssid>: WIFI Network SSID
<bssid>: WIFI网络 bSSID <rssi>: WIFI网络信号强度, 单位 dbm 当数据卡设置的定时时间超时后,会进入 WIFI热点扫描状态,上报 ATMODE:l,l l, 参照图 7, 扫描完毕后会按照以上格式上报当前可用的 WIFI热点信息, 扫描并上报完 毕后, 会再上报进入扫描状态前的状态, 如进入前为 WIFI 网络未连接状态, 则完毕 后上报 ATMODE:l,2; 如进入前为 WIFI网络已连接状态, 则完毕后上报 ATMODE:l,4。 网络连接过程, 取消网络连接过程和断开网络连接过程包括以下步骤: 图 4为连接 AT命令流程图, 参照图 4, 当状态上报网络未连接后, 包括 2G/3G 网络未连接 ATMODE:2,2和 WIFI网络未连接 ATMODE:l,2两种情况, PC侧软件可以 向数据卡发送如下命令进行连接指示: <bssid>: WIFI network bSSID <rssi>: WIFI network signal strength, unit dbm When the data card setting timeout expires, it will enter the WIFI hotspot scanning state, report ATMODE: l, ll, refer to Figure 7, after scanning Report the currently available WIFI hotspot information according to the above format. After scanning and reporting, it will report the status before entering the scanning state. If the WIFI network is not connected before entering, report it to A TMODE: l, 2; Before the WIFI network is connected, report A TMODE: l, 4 after completion. The network connection process, the process of canceling the network connection process and disconnecting the network connection includes the following steps: Figure 4 is a flow chart of connecting AT commands. Referring to Figure 4, when the status reporting network is not connected, including 2G/3G network is not connected to A TMODE: 2, 2 and WIFI network is not connected to A TMODE: l, 2, PC The side software can send the following command to the data card to connect the indication:
ATATCO顺 =<type>,<mode>[,<ssid>,<bssid>] <type>: 待连接的网络的类型: 1 WIFI 2 TD/EDGE AT A TCO cis = <type>, <mode>[, <ssid>, <bssid>] <type>: Type of network to be connected: 1 WIFI 2 TD/EDGE
<mode>: 说明是连接网络还是取消网络连接: 1 连接 0 取消网络连接 <mode>: indicates whether to connect to the network or cancel the network connection: 1 connection 0 cancel the network connection
<ssid>: WLAN网络 SSID, ¾<type>=l是生效 <ssid>: WLAN network SSID, 3⁄4<type>=l is in effect
<bssid>: WLAN网络 bSSID, 当<type>=l是生效 不论连接 2G/3G网络还是 WIFI网络, 连接前需要先进行连接参数的设置。 当连 接 2G/3G网络时需要设置 APN, 使用标准 AT命令 AT+CGDCONT进行设置。 当连接 WIFI网络, 需要设置鉴权方式, 加密算法, 认证方式和密钥信息, 可以使用以下 AT 命令进行设置: <bssid>: WLAN network bSSID, when <type>=l is effective Regardless of whether the 2G/3G network or the WIFI network is connected, the connection parameters need to be set before connecting. When connecting a 2G/3G network, you need to set the APN and set it using the standard AT command AT+CGDCONT. When connecting to a WIFI network, you need to set the authentication mode, encryption algorithm, authentication mode and key information. You can use the following AT commands to set:
ATATTAPCFGS=<ssid>,<bssid>,<auth>,<encr>,<autype> AT A TTAPCFGS=<ssid>,<bssid>,<auth>,<encr>,<autype>
<ssid>: WLAN网络 SSID <bssid>: WLAN网络 bSSID <auth>: 鉴权方式 包括: 0 NONE 1 IEEE8021X 2 WPA_PSK 3 WPA_EAP 4 WPA2_PSK 5 WPA2_EAP <ssid>: WLAN network SSID <bssid>: WLAN network bSSID <auth>: Authentication method Includes: 0 NONE 1 IEEE8021X 2 WPA_PSK 3 WPA_EAP 4 WPA2_PSK 5 WPA2_EAP
<encr>: 加密算法 包括: 0 NONE 1 TKIP 2 CCMP 3 WEP_OPEN 4 WEP_SHARE 5 WEP104 6 YES <encr>: Encryption algorithm Includes: 0 NONE 1 TKIP 2 CCMP 3 WEP_OPEN 4 WEP_SHARE 5 WEP104 6 YES
<autype>i iE方式 包括: 0 NONE 1 (U) SIM认证 2 WEB认证 <autype>i iE mode Includes: 0 NONE 1 (U) SIM Certification 2 WEB Certification
<wepkey0>: WEP加密密钥 1或 WPA/WPA2鉴权密钥 ¾<encr>= TKIP或<encr>=CCMP时生效 <wepkeyl>: WEP加密密钥 2 <wepkey2>: WEP加密密钥 3 <wepkey0>: WEP encryption key 1 or WPA/WPA2 authentication key 3⁄4<encr>= TKIP or <encr>=CCMP effective <wepkeyl>: WEP encryption key 2 <wepkey2>: WEP encryption key 3
<wepkey3>: WEP加密密钥 4 <wepkeyindex>: WEP加密密钥索引 ¾<encr>= WEP— OPEN或<6 1">=1\\¾?_811 《£时生效 因为网络连接的动作执行时间较长, 如果用同步 AT命令, PC侧软件会有阻塞, 导致其它 AT命令处理的不及时。 因此网络连接 AT命令执行结果以异步方式上报, 命 令下发数据卡后立即返回的响应中, 会有唯一的键值标示, 如下所示: <wepkey3>: WEP encryption key 4 <wepkeyindex>: WEP encryption key index 3⁄4<encr>= WEP- OPEN or <6 1">= 1 \\3⁄4?_811 "The time is effective because of the action time of the network connection Longer, if the synchronous AT command is used, the PC side software will be blocked, causing other AT commands to be processed in a timely manner. Therefore, the network connection AT command execution result is reported in an asynchronous manner, and the response returned immediately after the command is sent to the data card will be There is a unique key-value label, as shown below:
<CR><LF>ATCO顺: <CR><LF> A TCO 顺:
<CR><LF>ACK: <id><CR><LF> <CR><LF>ACK: <id><CR><LF>
<CR><LF>OK<CR><LF> 其中 <id>: 异步 AT命令处理编号, 用于标示主动上报响应结果, 从 0~127循环。 然后实际的连接处理结果会通过 ATACK的主动上报来通知 PC侧软件, 其中也有 唯一键值标示, 从而使 PC侧软件可以判断是那条请求的处理结果, 防止出现结果错 舌。 ATACK的上报格式如下: <CR><LF>OK<CR><LF> where <id>: Asynchronous AT command processing number, used to indicate the result of active reporting, from 0 to 127 cycles. Then, the actual connection processing result will notify the PC side software through the active reporting of A TACK, and there is also a unique key value indication, so that the PC side software can judge the processing result of the request, and prevent the result from being wrong. The reporting format of A TACK is as follows:
ATACK: <id>,<result>[,<err>] <id>: 异步 AT命令处理编号, 用于标示主动上报响应结果: 从 0~127循环, -11 表示 WIFI热点扫描结果 A TACK: <id>, <result>[,<err>] <id>: Asynchronous AT command processing number, used to indicate the result of active reporting: From 0 to 127 cycles, -11 indicates WIFI hotspot scan results
<result>: 异步命令处理结果: 0 OK I ERROR <result>: Asynchronous command processing result: 0 OK I ERROR
<err>: 错误码, 当 result !=0时上报 图 5为取消连接 AT命令流程图,参照图 5,如果正在连接过程中,可以取消连接, AT命令与网络连接时所使用的 AT命令相同,只是有一位参数需要变更, <mode>参数。 图 6为断开连接 AT命令流程图,参照图 6,当状态上报网络已连接后,包括 2G/3G 网络已连接 ATMODE:2,4和 WIFI网络已连接 ATMODE:l,4两种情况, PC侧软件可以 向数据卡下发如下命令进行断开连接操作: <err>: error code, reported when result !=0 FIG. 5 is a flowchart of canceling the connection AT command. Referring to FIG. 5, if the connection process is in progress, the connection can be canceled. The AT command is the same as the AT command used when the network is connected, but only one parameter needs to be changed, <mode> parameter. Figure 6 is a flow chart of disconnecting the AT command. Referring to Figure 6, when the status reporting network is connected, the 2G/3G network is connected to A TMODE: 2, 4 and the WIFI network is connected to A TMODE: l, 4 The PC side software can issue the following command to the data card to disconnect the operation:
ATATDISCONN=<type> AT A TDISCONN=<type>
<type>: 待断开网络的类型: 0 ALL 1 WIFI 2 TD/EDGE 此命令也是异步执行命令。 执行过程中会上报网络正在断开连接的状态。 若 ^TACK指示断开命令执行成功, 则上报网络未连接状态。 否则断开失败, 仍然是网络 已连接状态。 本发明实施例还提供一种控制装置, 用于一移动终端, 该装置包括: 第一接收模块, 设置为接收用户终端发送的第一 AT命令; 判断模块, 设置为判断第一 AT命令是否指示连接无线网络, 获取一第一判断结 果; 生成模块, 设置为当第一判断结果为是时, 生成第一无线网络连接指令。 可见, 移动终端通过已建立在移动终端与用户终端之间的 AT命令传输通道与用 户终端进行 AT命令的交互, 通过接收用户终端发送的第一 AT命令, 在该第一 AT命 令指示连接无线网络时, 生成第一无线网络连接指令, 从而实现了对移动终端控制连 接无线网络的行为的高鲁棒性控制; 又这种方式可以通过已建立的 AT命令传输通道进行用户终端与移动终端之间的 信息交互, 不再需要建立 PPPOE传输通道, 减少了因建立 PPPOE传输通道而带来的 一定时间资源的耗费以及对移动终端与用户终端之间一定的传输资源及处理资源的占 用, 从而也就在一定程度上实现了对移动终端控制连接无线网络的行为的高效控制。 其中, 无线网络可以为 WIFI网络, 该生成模块可以包括: 第一解析单元, 设置为当第一判断结果为是时, 从第一 AT 命令中解析出 WIFI 热点标识参数; 第一生成单元, 设置为生成用于指示连接 WIFI热点的第一无线网络连接指令; 其中, 该 WIFI热点与 WIFI热点标识参数对应。 此外, 移动终端可以设置有用于连接具有第一网络类型的无线网络的第一模块和 用于连接具有第二网络类型的无线网络的第二模块, 该生成模块可以包括- 第二解析单元, 设置为当第一判断结果为是时, 从第一 AT命令中解析出网络类 型参数; 第二生成单元, 设置为当网络类型参数为第一网络类型时, 生成用于控制第一模 块连接具有第一网络类型的无线网络的第一无线网络连接指令; 第三生成单元, 设置为当网络类型参数为第二网络类型时, 生成用于控制第二模 块连接具有第二网络类型的无线网络的第一无线网络连接指令。 优选地, 该装置还可以包括: 第一控制模块, 设置为接收模块接收用户终端发送 的第一 AT命令之前, 在用户终端的控制下, 控制第一模块建立与具有第一网络类型 的无线网络之间的第一连接; 第二发送模块, 设置为接收模块接收用户终端发送的第一 AT命令之前, 在第一 连接建立时, 向用户终端发送携带有无线网络已连接状态的第三 AT命令, 使得用户 终端能够根据第三 AT命令生成并向移动终端发送指示断开连接的第四 AT命令; 第二接收模块, 设置为接收模块接收用户终端发送的第一 AT命令之前, 接收第 四 AT命令; 第二控制模块, 设置为接收模块接收用户终端发送的第一 AT命令之前, 根据第 四 AT命令控制第一模块断开第一连接; 第三发送模块, 设置为接收模块接收用户终端发送的第一 AT命令之前, 在第一 连接断开时, 向用户终端发送携带有无线网络未连接状态的第五 AT命令, 使得用户 终端能够根据第五 AT命令生成并向移动终端发送第一 AT命令。 优选地, 第一控制模块可以包括: 控制单元, 设置为接收模块接收用户终端发送的第一 AT命令之前, 接收用户终 端发送的第六 AT命令; 判断单元, 设置为接收模块接收用户终端发送的第一 AT命令之前, 判断第六 AT 命令是否指示连接无线网络, 获取一第二判断结果; 第四生成单元, 设置为接收模块接收用户终端发送的第一 AT命令之前, 当第二 判断结果为是时, 生成第二无线网络连接指令。 本发明实施例还提供一种移动终端, 该移动终端包括以上的控制装置。 以上所述仅是本发明实施例的实施方式, 应当指出, 对于本技术领域的普通技术 人员来说, 在不脱离本发明实施例原理的前提下, 还可以作出若干改进和润饰, 这些 改进和润饰也应视为本发明实施例的保护范围。 <type>: Type of network to be disconnected: 0 ALL 1 WIFI 2 TD/EDGE This command is also an asynchronous execution command. During the execution, the status of the network being disconnected is reported. If ^TACK indicates that the disconnection command is successfully executed, the network is not connected. Otherwise, the disconnection fails and the network is still connected. The embodiment of the present invention further provides a control device, which is used in a mobile terminal, the device includes: a first receiving module, configured to receive a first AT command sent by a user terminal; and a determining module, configured to determine whether the first AT command indicates Connecting to the wireless network to obtain a first determination result; and generating a module, configured to generate a first wireless network connection instruction when the first determination result is yes. It can be seen that the mobile terminal performs an AT command interaction with the user terminal through an AT command transmission channel that has been established between the mobile terminal and the user terminal, and receives the first AT command sent by the user terminal, and indicates that the first AT command is connected to the wireless network. Generating a first wireless network connection command, thereby implementing high robustness control of the behavior of the mobile terminal controlling the connection to the wireless network; and this manner can be performed between the user terminal and the mobile terminal through the established AT command transmission channel The information exchange does not need to establish a PPPOE transmission channel, which reduces the consumption of a certain time resource due to the establishment of the PPPOE transmission channel and the occupation of a certain transmission resource and processing resource between the mobile terminal and the user terminal, and thus To a certain extent, efficient control of the behavior of the mobile terminal to control the connection to the wireless network is achieved. The wireless network may be a WIFI network, and the generating module may include: a first parsing unit, configured to parse the WIFI hotspot identification parameter from the first AT command when the first determining result is yes; The first generating unit is configured to generate a first wireless network connection command for indicating a connection to the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter. Furthermore, the mobile terminal may be provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, the generating module may include - a second analyzing unit, setting When the first judgment result is yes, the network type parameter is parsed from the first AT command; the second generating unit is configured to generate, when the network type parameter is the first network type, generate a first wireless network connection command of a network type wireless network; a third generating unit configured to: when the network type parameter is the second network type, generate a second network to control the second module to connect to the wireless network having the second network type A wireless network connection command. Preferably, the apparatus may further include: a first control module, configured to: before the receiving module receives the first AT command sent by the user terminal, control the first module to establish a wireless network with the first network type, under the control of the user terminal a first connection between the second sending module, configured to send, before receiving the first AT command sent by the user terminal, the third AT command carrying the connected state of the wireless network to the user terminal, when the first connection is established ??? enabling the user terminal to generate and send a fourth AT command indicating disconnection to the mobile terminal according to the third AT command; the second receiving module is configured to receive the fourth AT before receiving the first AT command sent by the user terminal The second control module is configured to: before the receiving module receives the first AT command sent by the user terminal, control the first module to disconnect the first connection according to the fourth AT command; the third sending module is configured to receive the user terminal and send the receiving Before the first AT command, when the first connection is disconnected, the user terminal is sent to carry the wireless The fifth AT command of the network unconnected state enables the user terminal to generate and transmit the first AT command to the mobile terminal according to the fifth AT command. Preferably, the first control module may include: a control unit, configured to receive a sixth AT command sent by the user terminal before the receiving module receives the first AT command sent by the user terminal; The determining unit is configured to: before the receiving module receives the first AT command sent by the user terminal, determine whether the sixth AT command indicates to connect to the wireless network, and obtain a second determination result; and the fourth generating unit is configured to receive, by the receiving module, the user terminal Before the first AT command, when the second determination result is YES, a second wireless network connection command is generated. The embodiment of the invention further provides a mobile terminal, which comprises the above control device. The above is only an embodiment of the present invention. It should be noted that those skilled in the art can make some improvements and refinements without departing from the principles of the embodiments of the present invention. Retouching should also be considered as the scope of protection of the embodiments of the present invention.

Claims

权 利 要 求 书 Claim
1. 一种控制方法, 用于一移动终端, 移动终端通过一已建立在移动终端与用户终 端之间的 AT命令传输通道, 与用户终端进行 AT命令的交互, 所述方法包括: 接收用户终端发送的第一 AT命令; A control method for a mobile terminal, the mobile terminal performs an AT command interaction with a user terminal through an AT command transmission channel established between the mobile terminal and the user terminal, the method comprising: receiving a user terminal The first AT command sent;
判断所述第一 AT命令是否指示连接无线网络, 获取一第一判断结果; 当所述第一判断结果为是时, 生成第一无线网络连接指令。  Determining whether the first AT command indicates that the wireless network is connected to obtain a first determination result; when the first determination result is YES, generating a first wireless network connection instruction.
2. 根据权利要求 1所述的方法, 其中, 所述无线网络为 WIFI网络, 所述生成第 一无线网络连接指令包括: 2. The method according to claim 1, wherein the wireless network is a WIFI network, and the generating the first wireless network connection instruction comprises:
从所述第一 AT命令中解析出 WIFI热点标识参数;  Parsing the WIFI hotspot identification parameter from the first AT command;
生成用于指示连接 WIFI热点的所述第一无线网络连接指令; 其中, 所述 WIFI热点与所述 WIFI热点标识参数对应。  And generating, by the first wireless network connection instruction, the WIFI hotspot, and the WIFI hotspot identification parameter.
3. 根据权利要求 2所述的方法, 其中, 所述接收用户终端发送的第一 AT命令之 前, 所述方法还包括: The method according to claim 2, wherein before the receiving the first AT command sent by the user terminal, the method further includes:
获取一当前 WIFI网络的扫描结果;  Obtaining a scan result of a current WIFI network;
向用户终端发送携带有所述扫描结果的第二 AT命令, 使得用户终端能够 从所述第二 AT命令中解析出所述扫描结果, 根据所述扫描结果生成并向移动 终端发送所述第一 AT命令。  Transmitting, to the user terminal, a second AT command carrying the scan result, so that the user terminal can parse the scan result from the second AT command, generate and send the first to the mobile terminal according to the scan result AT command.
4. 根据权利要求 1所述的方法, 其中, 移动终端设置有用于连接具有第一网络类 型的无线网络的第一模块和用于连接具有第二网络类型的无线网络的第二模 块, 所述生成第一无线网络连接指令包括: 4. The method according to claim 1, wherein the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, Generating the first wireless network connection command includes:
从所述第一 AT命令中解析出网络类型参数;  Parsing a network type parameter from the first AT command;
当所述网络类型参数为第一网络类型时, 生成用于控制所述第一模块连接 具有第一网络类型的无线网络的所述第一无线网络连接指令;  And when the network type parameter is a first network type, generating the first wireless network connection instruction for controlling the first module to connect to a wireless network having a first network type;
当所述网络类型参数为第二网络类型时, 生成用于控制所述第二模块连接 具有第二网络类型的无线网络的所述第一无线网络连接指令。  And when the network type parameter is the second network type, generating the first wireless network connection instruction for controlling the second module to connect to the wireless network having the second network type.
5. 根据权利要求 4所述的方法, 其中, 所述接收用户终端发送的第一 AT命令之 前, 所述方法还包括: 在用户终端的控制下, 控制所述第一模块建立与具有第一网络类型的无线 网络之间的第一连接; The method according to claim 4, wherein, before the receiving the first AT command sent by the user terminal, the method further includes: Controlling, by the user terminal, the first module to establish a first connection with a wireless network having a first network type;
在所述第一连接建立时, 向用户终端发送携带有无线网络已连接状态的第 三 AT命令,使得用户终端能够根据所述第三 AT命令生成并向移动终端发送指 示断开连接的第四 AT命令;  And transmitting, by the user terminal, a third AT command carrying the connected state of the wireless network, so that the user terminal can generate and send the fourth terminal indicating disconnection to the mobile terminal according to the third AT command. AT command;
接收所述第四 AT命令;  Receiving the fourth AT command;
根据所述第四 AT命令控制所述第一模块断开所述第一连接; 在所述第一连接断开时, 向用户终端发送携带有无线网络未连接状态的第 五 AT命令,使得用户终端能够根据所述第五 AT命令生成并向移动终端发送所 述第一 AT命令。  Controlling, by the fourth AT command, the first module to disconnect the first connection; when the first connection is disconnected, transmitting, to the user terminal, a fifth AT command carrying a wireless network unconnected state, so that the user The terminal is capable of generating and transmitting the first AT command to the mobile terminal according to the fifth AT command.
6. 根据权利要求 5所述的方法, 其中, 所述在用户终端的控制下, 控制所述第一 模块建立与具有第一网络类型的无线网络之间的第一连接包括- 接收用户终端发送的第六 AT命令; The method according to claim 5, wherein, under the control of the user terminal, controlling the first module to establish a first connection with a wireless network having a first network type comprises: receiving a user terminal to send The sixth AT command;
判断所述第六 AT命令是否指示连接无线网络, 获取一第二判断结果; 当所述第二判断结果为是时, 生成第二无线网络连接指令。  Determining whether the sixth AT command indicates that the wireless network is connected to obtain a second determination result; when the second determination result is YES, generating a second wireless network connection instruction.
7. 根据权利要求 4至 6中任一项所述的方法, 其中, The method according to any one of claims 4 to 6, wherein
所述第一网络类型为 WIFI 和蜂窝中的一个, 所述第二网络类型为 WIFI 和蜂窝中除所述第一网络类型之外的一个。  The first network type is one of WIFI and a cell, and the second network type is one of WIFI and a cell other than the first network type.
8. 一种控制装置, 用于一移动终端, 所述装置包括: 8. A control device for a mobile terminal, the device comprising:
第一接收模块, 设置为接收用户终端发送的第一 AT命令;  a first receiving module, configured to receive a first AT command sent by the user terminal;
判断模块, 设置为判断所述第一 AT命令是否指示连接无线网络, 获取一 第一判断结果;  The determining module is configured to determine whether the first AT command indicates to connect to the wireless network, and obtain a first determination result;
生成模块, 设置为当所述第一判断结果为是时, 生成第一无线网络连接指 令。  And generating a module, configured to generate a first wireless network connection instruction when the first determination result is YES.
9. 根据权利要求 8所述的装置, 其中, 所述无线网络为 WIFI网络, 所述生成模 块包括- 第一解析单元, 设置为当所述第一判断结果为是时, 从所述第一 AT命令 中解析出 WIFI热点标识参数; 第一生成单元, 设置为生成用于指示连接 WIFI热点的所述第一无线网络 连接指令; 其中, 所述 WIFI热点与所述 WIFI热点标识参数对应。 The device according to claim 8, wherein the wireless network is a WIFI network, and the generating module includes: a first parsing unit, configured to: when the first determining result is yes, from the first The WIFI hotspot identification parameter is parsed in the AT command; The first generating unit is configured to generate the first wireless network connection instruction for indicating a connection to the WIFI hotspot; wherein the WIFI hotspot corresponds to the WIFI hotspot identification parameter.
10. 根据权利要求 8所述的装置, 其中, 移动终端设置有用于连接具有第一网络类 型的无线网络的第一模块和用于连接具有第二网络类型的无线网络的第二模 块, 所述生成模块包括- 第二解析单元, 设置为当所述第一判断结果为是时, 从所述第一 AT命令 中解析出网络类型参数; 10. The apparatus according to claim 8, wherein the mobile terminal is provided with a first module for connecting a wireless network having a first network type and a second module for connecting a wireless network having a second network type, The generating module includes: a second parsing unit, configured to parse the network type parameter from the first AT command when the first determining result is YES;
第二生成单元, 设置为当所述网络类型参数为第一网络类型时, 生成用于 控制所述第一模块连接具有第一网络类型的无线网络的所述第一无线网络连接 指令;  a second generating unit, configured to: when the network type parameter is the first network type, generate the first wireless network connection instruction for controlling the first module to connect to a wireless network having a first network type;
第三生成单元, 设置为当所述网络类型参数为第二网络类型时, 生成用于 控制所述第二模块连接具有第二网络类型的无线网络的所述第一无线网络连接 指令。  And a third generating unit, configured to: when the network type parameter is the second network type, generate the first wireless network connection instruction for controlling the second module to connect to the wireless network having the second network type.
11. 根据权利要求 10所述的装置, 其中, 所述装置还包括: The device according to claim 10, wherein the device further comprises:
第一控制模块, 设置为所述接收模块接收用户终端发送的第一 AT命令之 前, 在用户终端的控制下, 控制所述第一模块建立与具有第一网络类型的无线 网络之间的第一连接;  a first control module, configured to control, before the receiving module receives the first AT command sent by the user terminal, under the control of the user terminal, to control the first module to establish a first relationship with the wireless network having the first network type Connection
第二发送模块, 设置为所述接收模块接收用户终端发送的第一 AT命令之 前, 在所述第一连接建立时, 向用户终端发送携带有无线网络已连接状态的第 三 AT命令,使得用户终端能够根据所述第三 AT命令生成并向移动终端发送指 示断开连接的第四 AT命令; 第二接收模块, 设置为所述接收模块接收用户终端发送的第一 AT命令之 前, 接收所述第四 AT命令;  a second sending module, configured to: before receiving the first AT command sent by the user terminal, the receiving module sends a third AT command carrying the connected state of the wireless network to the user terminal, so that the user is The terminal can generate and send a fourth AT command indicating disconnection to the mobile terminal according to the third AT command, and the second receiving module is configured to receive the first AT command sent by the user terminal before the receiving module receives the Fourth AT command;
第二控制模块, 设置为所述接收模块接收用户终端发送的第一 AT命令之 前, 根据所述第四 AT命令控制所述第一模块断开所述第一连接;  a second control module, configured to control the first module to disconnect the first connection according to the fourth AT command, before the receiving module receives the first AT command sent by the user terminal;
第三发送模块, 设置为所述接收模块接收用户终端发送的第一 AT命令之 前, 在所述第一连接断开时, 向用户终端发送携带有无线网络未连接状态的第 五 AT命令,使得用户终端能够根据所述第五 AT命令生成并向移动终端发送所 述第一 AT命令。  a third sending module, configured to send, before the receiving module receives the first AT command sent by the user terminal, a fifth AT command carrying a wireless network unconnected state to the user terminal, when the first connection is disconnected, The user terminal is capable of generating and transmitting the first AT command to the mobile terminal according to the fifth AT command.
12. 根据权利要求 11所述的装置, 其中, 所述第一控制模块包括: 控制单元, 设置为所述接收模块接收用户终端发送的第一 AT命令之前, 接收用户终端发送的第六 AT命令; The device according to claim 11, wherein the first control module comprises: The control unit is configured to receive the sixth AT command sent by the user terminal before the receiving module receives the first AT command sent by the user terminal;
判断单元, 设置为所述接收模块接收用户终端发送的第一 AT命令之前, 判断所述第六 AT命令是否指示连接无线网络, 获取一第二判断结果; 第四生成单元, 设置为所述接收模块接收用户终端发送的第一 AT命令之 前, 当所述第二判断结果为是时, 生成第二无线网络连接指令。  a determining unit, configured to determine, before the receiving module receives the first AT command sent by the user terminal, whether the sixth AT command indicates to connect to the wireless network, and obtain a second determination result; and the fourth generating unit is configured to receive the Before receiving the first AT command sent by the user terminal, the module generates a second wireless network connection command when the second determination result is YES.
13. 一种移动终端, 包括如权利要求 8至 12中任一项所述的控制装置。 A mobile terminal comprising the control device according to any one of claims 8 to 12.
PCT/CN2013/079717 2013-01-25 2013-07-19 Control method and device, and mobile terminal WO2013174312A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310028657.4A CN103974458A (en) 2013-01-25 2013-01-25 Control method and device and mobile terminal
CN201310028657.4 2013-01-25

Publications (2)

Publication Number Publication Date
WO2013174312A2 true WO2013174312A2 (en) 2013-11-28
WO2013174312A3 WO2013174312A3 (en) 2014-01-16

Family

ID=49624409

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/079717 WO2013174312A2 (en) 2013-01-25 2013-07-19 Control method and device, and mobile terminal

Country Status (2)

Country Link
CN (1) CN103974458A (en)
WO (1) WO2013174312A2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104602362A (en) * 2014-12-08 2015-05-06 深圳市广和通实业发展有限公司 WIFI based Point to Point Protocol (PPP) dial-up networking method and system
CN109661020A (en) * 2018-11-07 2019-04-19 深圳市有方科技股份有限公司 Adjusting method, adjustment equipment and the computer readable storage medium of Internet of Things battery saving mode

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI589169B (en) * 2015-09-18 2017-06-21 Wireless network communication system and communication method thereof
US10911979B2 (en) * 2018-04-09 2021-02-02 Mediatek Inc. AT commands for 5G session management

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070036138A1 (en) * 2005-08-03 2007-02-15 Chia-Ching Lin VoIP communication module
CN101150471A (en) * 2007-10-29 2008-03-26 中兴通讯股份有限公司 Broadband radio access system and method
CN101409932A (en) * 2008-11-25 2009-04-15 中国网络通信集团公司 Voice call method for pluggable mobile terminal
CN101902827A (en) * 2010-07-03 2010-12-01 中兴通讯股份有限公司 Method for establishing grouped data connection and wireless communication terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321194A (en) * 2008-07-04 2008-12-10 嘉兴闻泰通讯科技有限公司 Dual-module network card apparatus
CN101350832A (en) * 2008-08-29 2009-01-21 深圳华为通信技术有限公司 Data communication method, communication appliance, terminal and communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070036138A1 (en) * 2005-08-03 2007-02-15 Chia-Ching Lin VoIP communication module
CN101150471A (en) * 2007-10-29 2008-03-26 中兴通讯股份有限公司 Broadband radio access system and method
CN101409932A (en) * 2008-11-25 2009-04-15 中国网络通信集团公司 Voice call method for pluggable mobile terminal
CN101902827A (en) * 2010-07-03 2010-12-01 中兴通讯股份有限公司 Method for establishing grouped data connection and wireless communication terminal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104602362A (en) * 2014-12-08 2015-05-06 深圳市广和通实业发展有限公司 WIFI based Point to Point Protocol (PPP) dial-up networking method and system
CN104602362B (en) * 2014-12-08 2018-04-10 深圳市广和通无线股份有限公司 PPP dial-up networking methods and system based on WIFI
CN109661020A (en) * 2018-11-07 2019-04-19 深圳市有方科技股份有限公司 Adjusting method, adjustment equipment and the computer readable storage medium of Internet of Things battery saving mode

Also Published As

Publication number Publication date
WO2013174312A3 (en) 2014-01-16
CN103974458A (en) 2014-08-06

Similar Documents

Publication Publication Date Title
US11582592B2 (en) Communication device
US20230319952A1 (en) Communication Device
JP6324982B2 (en) Wifi direct service method using NFC and apparatus therefor
EP2574134B1 (en) Method for Using Legacy Wi-Fi and Wi-Fi P2P Simultaneously
US9042940B2 (en) Technique for executing communication of object data with mobile device
KR101915314B1 (en) Method and apparatus for wi-fi connecting using wi-fi protected setup in a portable terminal
WO2022143153A1 (en) Wi-fi configuration method and electronic device
EP2557825A2 (en) Method and apparatus for forming wi-fi p2p group using wi-fi direct
KR20150098633A (en) Method for setting communication in wi-fi direct service system, and apparatus therefor
CN108811035B (en) Method for accessing wireless fidelity Wi-Fi (wireless fidelity) by user equipment and Wi-Fi access node
KR20120025114A (en) Apparatus and method for determining validity of wifi connection in wireless communication system
US8295223B2 (en) Wireless connection method and device
WO2013071709A1 (en) Wireless broadband data card supporting accessing network in 3g and wi-fi manners
WO2013174312A2 (en) Control method and device, and mobile terminal
JP2012100171A (en) Communication device, its control method and program
KR101921142B1 (en) Apparatus and method for connecting with wi-fi network
KR20180121457A (en) Method and apparatus for wi-fi connecting using wi-fi protected setup in a portable terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13793429

Country of ref document: EP

Kind code of ref document: A2

122 Ep: pct application non-entry in european phase

Ref document number: 13793429

Country of ref document: EP

Kind code of ref document: A2