CN105959967B - Control instruction generation method and system based on WI-FI module - Google Patents

Control instruction generation method and system based on WI-FI module Download PDF

Info

Publication number
CN105959967B
CN105959967B CN201610251270.9A CN201610251270A CN105959967B CN 105959967 B CN105959967 B CN 105959967B CN 201610251270 A CN201610251270 A CN 201610251270A CN 105959967 B CN105959967 B CN 105959967B
Authority
CN
China
Prior art keywords
module
event notification
event
generating
control instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610251270.9A
Other languages
Chinese (zh)
Other versions
CN105959967A (en
Inventor
丁全全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mxchip Information Technology Co Ltd
Original Assignee
Shanghai Mxchip Information Technology Co Ltd
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 Shanghai Mxchip Information Technology Co Ltd filed Critical Shanghai Mxchip Information Technology Co Ltd
Priority to CN201610251270.9A priority Critical patent/CN105959967B/en
Publication of CN105959967A publication Critical patent/CN105959967A/en
Application granted granted Critical
Publication of CN105959967B publication Critical patent/CN105959967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a control instruction generation method based on a WI-FI module, which comprises the following steps: detecting whether a system meets a preset event trigger condition; the event triggering condition comprises that network parameters of the system change or a control state changes; if so, generating a corresponding event notification according to an event triggering condition met by the system, and sending the event notification to the upper computer. It can be seen that, in this embodiment, if it is detected that the system meets the preset event triggering condition, a corresponding notification is generated, and the event notification is sent to the upper computer, so that the upper computer can timely know that the system state of the WI-FI module has changed, and accordingly, corresponding processing is performed, and convenience and user experience of the user are improved; the invention also discloses a control instruction generation system based on the WI-FI module.

Description

Control instruction generation method and system based on WI-FI module
Technical Field
The invention relates to the technical field of control command generation, in particular to a control instruction generation method and system based on a WI-FI module.
Background
In the application of the internet of things AT present, a WiFi module and an upper computer are mainly communicated through a serial port, the passing protocols of the serial port are also various, and the most widely used instruction is an AT instruction. However, for the whole system of the internet of things, the AT instruction cannot meet the current application, and the traditional AT instruction set cannot rapidly inform the upper computer of the system state change of the WiFi module.
Therefore, how to make the upper computer know the system status change of the WiFi module is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a control instruction generation method and a control instruction generation system based on a WiFi module, so that an upper computer can know the system state change of the WiFi module in time.
In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions:
a control instruction generation method based on a WI-FI module comprises the following steps:
detecting whether a system meets a preset event trigger condition; the event triggering condition comprises that network parameters of the system change or a control state changes;
if so, generating a corresponding event notification according to an event triggering condition met by the system, and sending the event notification to the upper computer.
Wherein, the generating of the corresponding event notification according to the event trigger condition satisfied by the system includes:
and if the change of the connection state of the WI-FI module and the terminal is detected, generating an event notification corresponding to the connection state.
Wherein, the generating of the corresponding event notification according to the event trigger condition satisfied by the system includes:
and if the change of the network configuration state of the WI-FI module is detected, generating an event notification corresponding to the network configuration state.
Wherein, the generating of the corresponding event notification according to the event trigger condition satisfied by the system includes:
and if the identified network data source of the WI-FI module is detected to be changed, generating an event notification corresponding to the identified network data source.
Wherein, still include:
receiving a factory parameter setting instruction;
and setting the factory parameters of the WI-FI module according to the factory parameter setting instruction.
A control instruction generation system based on a WI-FI module comprises:
the detection module is used for detecting whether the system meets a preset event trigger condition; if yes, triggering an event notification generation module; the event triggering condition comprises that network parameters of the system change or a control state changes;
and the event notification generation module is used for generating a corresponding event notification according to the event trigger condition met by the system and sending the event notification to the upper computer.
Wherein the event notification generation module comprises:
and the first event notification generation unit is used for generating an event notification corresponding to the connection state when detecting that the connection state of the WI-FI module and the terminal is changed.
Wherein the event notification generation module comprises:
and the second event notification generation unit is used for generating an event notification corresponding to the network configuration state when detecting that the network configuration state of the WI-FI module changes.
Wherein the event notification generation module comprises:
and the third event notification generating unit is used for generating an event notification corresponding to the identification network data source when detecting that the identification network data source of the WI-FI module is changed.
Wherein, this system still includes:
the receiving module is used for receiving a factory parameter setting instruction;
and the setting module is used for setting the factory parameters of the WI-FI module according to the factory parameter setting instruction.
According to the scheme, the control instruction generation method based on the WI-FI module provided by the embodiment of the invention comprises the following steps: detecting whether a system meets a preset event trigger condition; the event triggering condition comprises that network parameters of the system change or a control state changes; if so, generating a corresponding event notification according to an event triggering condition met by the system, and sending the event notification to the upper computer. It can be seen that, in this embodiment, if it is detected that the system meets the preset event triggering condition, a corresponding notification is generated, and the event notification is sent to the upper computer, so that the upper computer can timely know that the system state of the WI-FI module has changed, and accordingly, corresponding processing is performed, and convenience and user experience of the user are improved; the invention also discloses a control instruction generation system based on the WI-FI module.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a control instruction generation method based on a WI-FI module according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a control instruction generating system based on a WI-FI module according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a control instruction generation method and a control instruction generation system based on a WiFi module, which are used for realizing that an upper computer can know the system state change of the WiFi module in time.
Referring to fig. 1, a control instruction generating method based on a WI-FI module according to an embodiment of the present invention includes:
s101, detecting whether a system meets a preset event trigger condition; the event triggering condition comprises that network parameters of the system change or a control state changes;
if yes, executing S102, generating a corresponding event notification according to an event triggering condition met by the system, and sending the event notification to an upper computer; if not, S101 is continuously executed.
The control instruction generation method based on the WI-FI module provided by the embodiment of the invention comprises the following steps: detecting whether a system meets a preset event trigger condition; the event triggering condition comprises that network parameters of the system change or a control state changes; if so, generating a corresponding event notification according to an event triggering condition met by the system, and sending the event notification to the upper computer. It can be seen that, in this embodiment, if it is detected that the system meets the preset event trigger condition, a corresponding notification is generated, and the event notification is sent to the upper computer, so that the upper computer can timely know that the system state of the WI-FI module has changed, and accordingly, corresponding processing is performed, and convenience and user experience of the user are improved.
Wherein, the generating of the corresponding event notification according to the event trigger condition satisfied by the system includes:
if the change of the connection state of the WI-FI module and the terminal is detected, generating an event notification corresponding to the connection state;
specifically, the connection state between the WI-FI module and the terminal includes: the terminal and the WI-FI module establish a link or the terminal and the WI-FI module fail to connect.
If the change of the network configuration state of the WI-FI module is detected, generating an event notification corresponding to the network configuration state;
specifically, the network configuration state of the WI-FI module includes: starting, success, failure and other states of easy link network configuration of the WI-FI module; and starting, success, failure and the like of wps network configuration of the WI-FI module.
And if the identified network data source of the WI-FI module is detected to be changed, generating an event notification corresponding to the identified network data source.
Specifically, the identification network data source of the WI-FI module includes: identifying a source of network data (TCP) or identifying a source of network data (UNICAST).
It should be noted that, referring to table 1, the event types of the event trigger condition include other event types besides the event types of 1 to 4, 7, and 9. For example: if the WI-FI module is detected to be linked or disconnected with a Client under a TCP Server, linked or disconnected with a Server under a TCP Client, linked or disconnected under a UDP UNICAST mode or to be restarted, an event notification can be generated and sent to the upper computer.
TABLE 1
Specifically, the event notification includes current network parameters and control status. The format of the event message is:
+EVENT=<TYPE>,[para-1,para-2,para-3,......]<CR><LF>。
wherein < TYPE > is the event TYPE, [ para-n ] is the event parameter, < CR > is ASCII code 0x0d, < LF > is ASCII code 0x0 a.
Based on the technical scheme, if a factory parameter setting instruction is received; the factory parameters of the WI-FI module can be set according to the factory parameter setting instruction.
Specifically, in this embodiment, the manufacturer may not only query the factory parameters by sending a query instruction to the WI-FI module, but also reset the factory parameters by sending a factory parameter setting instruction to the WI-FI module, so that the manufacturer may use the factory conveniently without always bothering the original factory.
Specifically, the serial port control command system in this embodiment further includes, in addition to the above-mentioned factory parameter setting instruction and event notification: basic instructions, network instructions and pass-through instructions. Referring to table 2, the table is a list of basic instructions, and may specifically include a basic management instruction, a uart management instruction, and a power management instruction; referring to table 3, the table is a list of network commands, which may specifically include a basic network command, a WiFi configuration command, a TCP/UDP configuration command, and a socket sending command; referring to table 4, a list of factory restoration instructions includes the factory parameter setting instructions described above; and the transparent transmission instruction is to exit the AT mode and enter the transparent transmission mode.
TABLE 2
TABLE 3
TABLE 4
It should be noted that the instruction format is:
AT + instructions employ ASCII code based command lines.
Wherein: a) < >: indicating the parts that must be included
b) [ ]: representing optional parts
Specifically, the command message format is:
AT+<CMD>[op][para-1,para-2,para-3,......]<CR>
wherein: a) AT +: representing command message prefixes
b) CMD: representing instruction strings
c) [ op ]: representing instruction operators, the designation being parameter setting or query. Can be as follows:
1. means parameter setting
2. Means parameter query without
d) [ para-n ] input at parameter setting, and "?" at query command "
e) < CR >: end symbol, carriage return, ASCII code 0x0d
In particular, the format of the response message
+<RSP>=[para-1,para-2,para-3,......]<CR><LF>
Wherein: a) +: response message prefix
b) RSP: a corresponding string comprising 1. "OK": indicating success; "ERR": indicating a failure;
c) para-n parameters returned upon query, or error codes upon error occurrence
d) < CR > ASCII code 0x0d
e) < LF >. ASCII code 0x0a
In the following, the control instruction generating system provided by the embodiment of the present invention is introduced, and the control instruction generating system described below and the control instruction generating method described above may be referred to each other.
Referring to fig. 2, a control instruction generating system based on a WI-FI module according to an embodiment of the present invention includes:
the detection module 100 is configured to detect whether a system meets a preset event trigger condition; if yes, triggering an event notification generation module; the event triggering condition comprises that network parameters of the system change or a control state changes;
the event notification generating module 200 is configured to generate a corresponding event notification according to an event trigger condition met by the system, and send the event notification to an upper computer.
In the above technical solution, the event notification generation module includes:
and the first event notification generation unit is used for generating an event notification corresponding to the connection state when detecting that the connection state of the WI-FI module and the terminal is changed.
Based on the above technical solution, the event notification generation module includes:
and the second event notification generation unit is used for generating an event notification corresponding to the network configuration state when detecting that the network configuration state of the WI-FI module changes.
Based on the above technical solution, the event notification generation module includes:
and the third event notification generating unit is used for generating an event notification corresponding to the identification network data source when detecting that the identification network data source of the WI-FI module is changed.
Based on the above technical scheme, still include:
the receiving module is used for receiving a factory parameter setting instruction;
and the setting module is used for setting the factory parameters of the WI-FI module according to the factory parameter setting instruction.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (6)

1. A control instruction generation method based on a WI-FI module is characterized by comprising the following steps:
detecting whether a system meets a preset event trigger condition; the event triggering condition comprises that network parameters of the system change or a control state changes;
if so, generating a corresponding event notification according to an event triggering condition met by the system, and sending the event notification to an upper computer;
wherein, the generating of the corresponding event notification according to the event trigger condition satisfied by the system includes:
if the change of the network configuration state of the WI-FI module is detected, generating an event notification corresponding to the network configuration state; if the identified network data source of the WI-FI module is detected to be changed, generating an event notification corresponding to the identified network data source; and if the WI-FI module is detected to be linked or disconnected with the Client under the TCP Server, linked or disconnected with the Server under the TCP Client, linked or disconnected under the UDP UNICAST mode or to be restarted, generating an event notification and sending the event notification to the upper computer.
2. The method according to claim 1, wherein the generating a corresponding event notification according to the event trigger condition satisfied by the system comprises:
and if the change of the connection state of the WI-FI module and the terminal is detected, generating an event notification corresponding to the connection state.
3. The control instruction generation method according to claim 1 or 2, characterized by further comprising:
receiving a factory parameter setting instruction;
and setting the factory parameters of the WI-FI module according to the factory parameter setting instruction.
4. A control instruction generation system based on a WI-FI module is characterized by comprising:
the detection module is used for detecting whether the system meets a preset event trigger condition; if yes, triggering an event notification generation module; the event triggering condition comprises that network parameters of the system change or a control state changes;
the event notification generation module is used for generating corresponding event notifications according to event trigger conditions met by the system and sending the event notifications to the upper computer;
wherein the event notification generation module comprises:
the second event notification generating unit is used for generating an event notification corresponding to the network configuration state when detecting that the network configuration state of the WI-FI module changes;
the third event notification generating unit is used for generating an event notification corresponding to the identification network data source when detecting that the identification network data source of the WI-FI module changes;
the event notification generation module is also used for generating an event notification and sending the event notification to an upper computer when detecting that the WI-FI module is linked or disconnected with the Client under a TCP Server, linked or disconnected with the Server under a TCP Client, linked or disconnected under a UDP UNICAST mode, or about to be restarted.
5. The control instruction generation system according to claim 4, wherein the event notification generation module includes:
and the first event notification generation unit is used for generating an event notification corresponding to the connection state when detecting that the connection state of the WI-FI module and the terminal is changed.
6. The control instruction generation system according to claim 4 or 5, characterized by further comprising:
the receiving module is used for receiving a factory parameter setting instruction;
and the setting module is used for setting the factory parameters of the WI-FI module according to the factory parameter setting instruction.
CN201610251270.9A 2016-04-21 2016-04-21 Control instruction generation method and system based on WI-FI module Active CN105959967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610251270.9A CN105959967B (en) 2016-04-21 2016-04-21 Control instruction generation method and system based on WI-FI module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610251270.9A CN105959967B (en) 2016-04-21 2016-04-21 Control instruction generation method and system based on WI-FI module

Publications (2)

Publication Number Publication Date
CN105959967A CN105959967A (en) 2016-09-21
CN105959967B true CN105959967B (en) 2019-12-20

Family

ID=56917856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610251270.9A Active CN105959967B (en) 2016-04-21 2016-04-21 Control instruction generation method and system based on WI-FI module

Country Status (1)

Country Link
CN (1) CN105959967B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257367A (en) * 2018-10-18 2019-01-22 浙江大学台州研究院 A kind of data communication protocol and implementation method for industrial internet-of-things terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101498931A (en) * 2008-12-26 2009-08-05 北京三博中自科技有限公司 Communication method for assembly line RFID interface control unit and upper computer
CN101673100A (en) * 2009-10-19 2010-03-17 北京北方微电子基地设备工艺研究中心有限责任公司 Acquisition method and system of parameters of technique process
CN103217963A (en) * 2013-04-25 2013-07-24 四川长虹电器股份有限公司 General intelligent housing system
CN105425678A (en) * 2015-12-15 2016-03-23 华中科技大学 Quick self-checking internal inspection data acquisition device for heating furnace tube leakage flux

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9654392B2 (en) * 2013-12-26 2017-05-16 Red Hat, Inc. MAC address prefixes used on virtual machine hosts

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101498931A (en) * 2008-12-26 2009-08-05 北京三博中自科技有限公司 Communication method for assembly line RFID interface control unit and upper computer
CN101673100A (en) * 2009-10-19 2010-03-17 北京北方微电子基地设备工艺研究中心有限责任公司 Acquisition method and system of parameters of technique process
CN103217963A (en) * 2013-04-25 2013-07-24 四川长虹电器股份有限公司 General intelligent housing system
CN105425678A (en) * 2015-12-15 2016-03-23 华中科技大学 Quick self-checking internal inspection data acquisition device for heating furnace tube leakage flux

Also Published As

Publication number Publication date
CN105959967A (en) 2016-09-21

Similar Documents

Publication Publication Date Title
US10002526B1 (en) Internet-of-things systems and methods
Kodali et al. IoT based home automation using node-red
WO2016109686A1 (en) Systems and methods for mapping and visualizing wireless mesh network
CN105446305A (en) Intelligent household gateway network configuration method and intelligent household system
US20080016157A1 (en) Method and system for controlling and monitoring an apparatus from a remote computer using session initiation protocol (sip)
EP2854371A1 (en) Method and device for achieving remote manipulation
CN104495536A (en) Cloud elevator system based on cloud computing
JP5974931B2 (en) Communication device
JP6433578B2 (en) Information self-registration method, apparatus, system, and computer storage medium
EP2911340B1 (en) Method and system for removing fault of internet of things gateway
US20160029214A1 (en) Home control gateway and home control network connection method thereof
CN105959967B (en) Control instruction generation method and system based on WI-FI module
JP2019515595A (en) Data transmission method, apparatus and system
CN112180746A (en) Home equipment control method and device based on gateway, storage medium and gateway
CN106534342B (en) Connect control method, host and system
CN111405059A (en) Data transmission method of cloud equipment, electronic equipment and Internet of things system
US8595354B2 (en) Control method for wireless communications device compatible with universal serial bus mass storage device class protocol
CN103781098A (en) Wireless network adapter and method for configuring same
US20160142258A1 (en) Methods and systems for verifying installation of a device
CN113259468B (en) Network equipment configuration method and device
CN105446803A (en) Application management method and apparatus
CN112953794B (en) Network detection method, device, equipment and storage medium of router
CN113765722A (en) Configurable multi-protocol message processing method and device and electronic equipment
JP2017135499A (en) Communication configurations notifying device
CN105407029A (en) Account number shunting method and communication terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant