CN107231425A - A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements - Google Patents

A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements Download PDF

Info

Publication number
CN107231425A
CN107231425A CN201710450640.6A CN201710450640A CN107231425A CN 107231425 A CN107231425 A CN 107231425A CN 201710450640 A CN201710450640 A CN 201710450640A CN 107231425 A CN107231425 A CN 107231425A
Authority
CN
China
Prior art keywords
mqtt
module
thread
data
wireless communication
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.)
Pending
Application number
CN201710450640.6A
Other languages
Chinese (zh)
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.)
HARBIN XINZHONG NEW ELECTRONICS CO Ltd
Original Assignee
HARBIN XINZHONG NEW ELECTRONICS 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 HARBIN XINZHONG NEW ELECTRONICS CO Ltd filed Critical HARBIN XINZHONG NEW ELECTRONICS CO Ltd
Priority to CN201710450640.6A priority Critical patent/CN107231425A/en
Publication of CN107231425A publication Critical patent/CN107231425A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C2201/00Transmission systems of control signals via wireless link
    • G08C2201/60Security, fault tolerance
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/164Implementing security features at a particular protocol layer at the network layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/166Implementing security features at a particular protocol layer at the transport layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

The present invention proposes a kind of application of wireless communication apparatus based on MQTT agreements and method and the wireless communication apparatus in water regulator, belongs to wireless communication technique field.The communication of the invention that MQTT protocol realization water regulators etc. are used between equipment and control software and the notice of reaching the standard grade for realizing the equipment such as water regulator, the offline notice of equipment is realized by MQTT words of the deceased mechanism, firmware upgrade is realized by HTTP.Realized present invention can apply to wireless telecommunications the need for all in the equipment of data transfer.

Description

A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements
Technical field
The present invention relates to the application of a kind of wireless communication apparatus and method and the wireless communication apparatus, belong to wireless telecommunications Technical field.
Background technology
Majority College Students ' Apartments drinking water, shower at present, unit logistics bathroom, factory's shower room etc. are all passed through with water Water regulator uses progress water pipe control, not only convenient use, also using water wisely.Currently being used between water regulator and system software has Line networked mode works, and this networking mode needs extensive wiring to realize networking, not only increases wiring cost, while also increasing Difficulty of construction.On the other hand, used certainly the existing wireless communication apparatus applied to fixed range (such as school, factory) more Networking model (such as ZigBee) and CoAP agreements, adhoc mode need independent networking, and construction cost is higher, and CoAP agreements are not Convenient to be docked with other products, its adaptability is limited.
The content of the invention
The present invention is in order to solve the problem of wiring cost is high, difficulty of construction is big, and the present invention proposes a kind of based on MQTT associations The wireless communication apparatus and method of view, and the water regulator based on the wireless communication apparatus.
A kind of wireless communication apparatus based on MQTT agreements, the technical scheme taken is as follows:
The wireless communication apparatus includes:
Data transmit-receive thread for setting up MQTT data transmit-receive threads sets up module;
Connection establishment module for setting up connection between the MQTT data transmit-receives thread and MQTT proxy servers;
The message subscribing module of message subscribing is carried out for the MQTT data transmit-receives thread;
The information registering module of testament message is registered for the MQTT data transmit-receives thread;
The message queue that message queue and MQTT reception message queues are sent for setting up MQTT sets up module;
Serial data receiving thread for setting up serial data receiving thread sets up module;
Serial ports and the initialization of (a) serial ports mould of serial ports receipt completion signal amount are initialized for the serial data receiving thread Block;
The data cache module for receiving data buffer storage is set up for the serial data receiving thread;
The caching mutex module for receiving data buffer storage mutex is set up for the serial data receiving thread;
Data processing threads for setting up data processing threads set up module.
Further, the wireless communication apparatus also includes:
The outer of the peripheral equipment control order that MQTT proxy servers are issued is received for the MQTT data transmit-receives thread Portion's equipment control command receiving module;
Peripheral equipment control order for the peripheral equipment control Order receiver module to be received is pushed into described MQTT receives the order push-in module of message queue;
The outside that peripheral equipment control order is extracted from MQTT reception message queues for data processing threads is set Standby control command extraction module;
The peripheral equipment control command analysis module of the peripheral equipment control order is parsed for data processing threads;
Judge that the peripheral equipment control order is intended for the command determination of correspondence external equipment for data processing threads Module;
The order sending module of peripheral equipment control order is sent to the external equipment for data processing threads;
The implementing result receiving module of the command execution results of the external equipment is received for serial data receiving thread;
The data that the command execution results are saved in the reception data buffer storage are protected for serial data receiving thread Storing module;
The letter of the serial ports receipt completion signal amount is sent to MQTT data transmit-receives thread for serial data receiving thread Number sending module;
The signal receiving module of the serial ports receipt completion signal amount is received for the MQTT data transmit-receives thread;
Received for the MQTT data transmit-receives thread after the serial ports receipt completion signal amount, read the reception data Data cached data read module in caching;
The news release module given out information for the MQTT data transmit-receives thread to MQTT proxy servers.
Further, the wireless communication apparatus also includes:
The order that the control command of MQTT proxy servers issue is received for the MQTT data transmit-receives thread receives mould Block;
Control command for the Order receiver module to be received is pushed into the control that the MQTT receives message queue Order push-in module;
The control command that control command is extracted from MQTT reception message queues for data processing threads extracts mould Block;
The control command parsing module of the control command is parsed for data processing threads;
The order for performing its control command extracted from MQTT reception message queues for data processing threads is held Row module;
The knot of its implementing result for performing the control command is issued to MQTT proxy servers for data processing threads Fruit release module.
Further, the wireless communication apparatus also includes:
The upgrading life of the firmware upgrade order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread Make receiving module;
Firmware upgrade order for the upgrade command receiving module to be received is pushed into the MQTT and receives message team The upgrade command push-in module of row;
The upgrade command that firmware upgrade order is extracted from MQTT reception message queues for data processing threads is carried Modulus block;
Firmware upgrade thread for setting up firmware upgrade thread sets up module;
The link block of HTTP file servers is connected for the firmware upgrade thread;
The file download module of firmware file is downloaded for firmware upgrade thread;
The file verification module of file integrality is verified for firmware upgrade thread;
The mark writing module of upgrading mark is write for firmware upgrade thread.
The wireless communication apparatus also includes:
Network layer encryption module for network layer encryption;
The transport layer encrypting module encrypted for transport layer;
Application layer encryption module for application layer encryption.
A kind of wireless communication method based on MQTT agreements, the technical scheme taken is as follows,
The wireless communication method includes:
Data transmit-receive thread establishment step for setting up MQTT data transmit-receive threads;
Connection establishment step for setting up connection between the MQTT data transmit-receives thread and MQTT proxy servers;
The message subscribing step of message subscribing is carried out for the MQTT data transmit-receives thread;
The information registering step of testament message is registered for the MQTT data transmit-receives thread;
For setting up, MQTT sends message queue and MQTT receives the message queue establishment step of message queue;
Serial data receiving thread establishment step for setting up serial data receiving thread;
The initialization of (a) serial ports step of serial ports and serial ports receipt completion signal amount is initialized for the serial data receiving thread Suddenly;
The data buffer storage step for receiving data buffer storage is set up for the serial data receiving thread;
The caching mutex step for receiving data buffer storage mutex is set up for the serial data receiving thread;
Data processing threads establishment step for setting up data processing threads.
Further, the wireless communication method also includes:
The outer of the peripheral equipment control order that MQTT proxy servers are issued is received for the MQTT data transmit-receives thread Portion's equipment control command receiving step;
Peripheral equipment control order for the peripheral equipment control order receiving step to be received is pushed into described MQTT receives the order push-in step of message queue;
The outside that peripheral equipment control order is extracted from MQTT reception message queues for data processing threads is set Standby control command extraction step;
The peripheral equipment control command analysis step of the peripheral equipment control order is parsed for data processing threads;
Judge that the peripheral equipment control order is intended for the command determination of correspondence external equipment for data processing threads Step;
The order forwarding step of peripheral equipment control order is sent to the external equipment for data processing threads;
The implementing result receiving step of the command execution results of the external equipment is received for serial data receiving thread;
The data that the command execution results are saved in the reception data buffer storage are protected for serial data receiving thread Deposit step;
The letter of the serial ports receipt completion signal amount is sent to MQTT data transmit-receives thread for serial data receiving thread Number hair step;
The signal receiving step of the serial ports receipt completion signal amount is received for the MQTT data transmit-receives thread;
Received for the MQTT data transmit-receives thread after the serial ports receipt completion signal amount, read the reception data Data cached data reading step in caching;
The news release step given out information for the MQTT data transmit-receives thread to MQTT proxy servers.
Further, the wireless communication method also includes:
The order that the control command of MQTT proxy servers issue is received for the MQTT data transmit-receives thread receives step Suddenly;
Control command for the order receiving step to be received is pushed into the control that the MQTT receives message queue Order push-in step;
The control command that control command is extracted from MQTT reception message queues for data processing threads extracts step Suddenly;
The control command analyzing step of the control command is parsed for data processing threads;
The order for performing its control command extracted from MQTT reception message queues for data processing threads is held Row step;
The knot of its implementing result for performing the control command is issued to MQTT proxy servers for data processing threads Fruit issuing steps.
Further, the wireless communication method also includes:
The upgrading life of the firmware upgrade order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread Make receiving step;
Firmware upgrade order for the upgrade command receiving step to be received is pushed into the MQTT and receives message team The upgrade command push-in step of row;
The upgrade command that firmware upgrade order is extracted from MQTT reception message queues for data processing threads is carried Take step;
Firmware upgrade thread establishment step for setting up firmware upgrade thread;
The Connection Step of HTTP file servers is connected for the firmware upgrade thread;
The file downloading step of firmware file is downloaded for firmware upgrade thread;
The file verification step of file integrality is verified for firmware upgrade thread;
The mark write step of upgrading mark is write for firmware upgrade thread.
The wireless communication method also includes:
Network layer encryption step for network layer encryption;
The transport layer encrypting step encrypted for transport layer;
Application layer encryption step for application layer encryption.
A kind of water regulator based on wireless communication apparatus of the present invention, the technical scheme taken is as follows,
The water regulator include core processor, display module, read-write card module, clock module, wireless communication apparatus, after Stand-by power source, power supply, water meter detection module and gate valve control module;The display control signal output end of the core processor is with showing Show that the control signal input of module is connected;The read-write control signal output end of the core processor and the control of read-write card module Signal input part processed is connected;The clock signal output terminal phase of the clock signal input terminal of the core processor and clock module Even;The wireless control signal output end of the core processor is connected with the control signal input of wireless communication apparatus;It is described Electrical signal and back of the power supply signal input and stand-by power supply signal input part of core processor respectively at power supply The electrical signal of power supply is connected;The signal of the water meter detection signal input part and water meter detection module of the core processor Output end is connected;The valve driving control signal output end of the core processor is inputted with the control signal of valve drive module End is connected.
Further, the water regulator sends prompt messages using the news release pattern of wireless communication apparatus;
The water regulator sends water regulator work state information by the news release pattern of the wireless communication apparatus;Institute State the transmission that news release pattern carries out water regulator work state information using transmission form at most once;
The water regulator sends consumption flowing water information by the news release pattern of the wireless communication apparatus;The message Release model carries out the transmission of consumption flowing water information using transmission form only once;
The water regulator obtains Working mode set or change information by the subscription massage pattern of wireless communication apparatus;Institute State subscription massage pattern and pattern setting or the acquisition of change information are operated using acquisition form at least one times;
The water regulator obtains user account information by the subscription massage pattern of wireless communication apparatus;The subscription message Pattern carries out the acquisition of user account information using acquisition form at least one times.
Beneficial effect of the present invention:
Wireless communication apparatus and method proposed by the present invention based on MQTT agreements pass through TCP/IP nets using WiFi patterns Network is connected and the data cube computation between MQTT protocol realizations equipment and control software, and its advantage has:
(1) wireless communication apparatus proposed by the present invention prolongs compared with the wireless telecommunications of traditional transparent transmission mode in the absence of fixation When, effectively improve the response speed of wireless telecommunications;Meanwhile, when application data bag exceedes data buffering, the present invention proposes wireless The data buffering size of communication device is unrestricted, can be set according to MQTT agreements and carry out sweetly disposition.
(2) wireless communication apparatus proposed by the present invention downloads firmware file using http protocol and realizes firmware upgrade, effectively Reduce the complexity of system upgrade.
(3) wireless communication apparatus proposed by the present invention is by MQTT data transmit-receive threads, serial data receiving thread, at data Four thread compositions of thread and firmware upgrade thread are managed, during plant running, the time is expended by different thread process Operation, effectively save the operating time, largely improve the real-time of wireless communication apparatus.Meanwhile, multithreading operation Communication process and data processing are separated, the coupling between communication process and data processing is reduced, improves communication process With the stability of data processing, on the other hand, the communication processing section of the wireless communication apparatus is divided into general program realization, without Be concerned about specific data, be easy to program portable into other similar applications, add wireless communication apparatus of the present invention it is actual should Popularity.
(4) wireless communication apparatus proposed by the present invention passes through network layer encryption module, transport layer encrypting module and application layer The layered encryption mode of encrypting module, improves communication security, solves existing transparent transmission mode wireless communication apparatus communications security Poor the problem of.Wherein, encrypted form includes network layer encryption, transport layer encryption and application layer encryption, wherein, network layer encryption, WEP is supported, WPA/WPA2, many kinds of cipher modes of PSK/Enterprise have encrypted all layers in addition to IP, improve network peace Quan Xing.Transport layer is encrypted, and is encrypted using TLS, encrypts MQTT packets, MQTT proxy server certificates, build built in wireless module With MQTT proxy server negotiation communication keys during vertical connection, man-in-the-middle attack is prevented.Application layer encryption, supports user name password The certification of mode, very high user's application safety.
(5) wireless communication apparatus proposed by the present invention is compared with zigbee wireless communication apparatus, and it is logical using Wi-Fi mode Crossing TCP/IP network organizings has versatility, can directly use existing wireless network resource, reduces the cost of investment of networking; Compared with CoAP wireless communication apparatus, enriched very much using the product of MQTT agreements, other products can be facilitated to access this product Other users system is accessed with this product, without doing more secondary development again, adaptability, the autgmentability of product is improved And reliability, it is ensured that communication quality.
(6) when the number of devices of application wireless communication apparatus of the present invention is more, system work can greatly be reduced Make pressure, reduce the configuration requirement to equipment such as network and computers, reduce project construction cost.
The present invention proposes a kind of water regulator based on wireless communication apparatus, and water regulator and control are realized by wireless communication apparatus Data cube computation between software processed, its advantage has:
(1) contact between water regulator and control software is realized by wireless communication apparatus, big in water regulator usage amount In the case of, effectively reduce wiring cost and difficulty of construction.
(2) water regulator proposed by the present invention just produces communication data in bankcard consumption, and communicate the uncontrolled water of corresponding delay The influence of water regulator quantity in system, therefore, water regulator proposed by the present invention have higher communication quality, while can realize Multi-quantity, install and use on a large scale, with wide applicability.
(3) give out information pattern and the subscription massage pattern of water regulator use proposed by the present invention, to realize equipment and control One-to-many news release is provided between software processed, the coupling between communication and data is effectively relieved;The communication of water regulator Data are forwarded by same subject, and network control is separated with application control, is facilitated control software to be tested and misarrangement, is effectively improved The stability of water regulator operation.
(4) water regulator proposed by the present invention can notify water regulator running status automatically to control system in time, including upper Line and the situation that goes offline, while the water regulator newly networked and its information can be added automatically;Meanwhile, water regulator of the present invention is added using a variety of Encryption is respectively adopted in Internet, transport layer and application layer in close mode, improves network data security;Also, can carry out Online upgrading, supports the application program of self refresh and upgrading water regulator.
Brief description of the drawings
Fig. 1 is the functional block diagram of wireless communication apparatus of the present invention.
Fig. 2 is the system structure diagram of water regulator of the present invention.
Embodiment
With reference to specific embodiment, the present invention will be further described, but the present invention should not be limited by the examples.
A kind of wireless communication apparatus based on MQTT agreements, for realizing the communication between external equipment and control software, institute The technical scheme taken is as follows:
The wireless communication apparatus includes:
Data transmit-receive thread for setting up MQTT data transmit-receive threads sets up module;
Connection establishment module for setting up connection between the MQTT data transmit-receives thread and MQTT proxy servers;
The message subscribing module of message subscribing is carried out for the MQTT data transmit-receives thread;
The information registering module of testament message is registered for the MQTT data transmit-receives thread;
The message queue that message queue and MQTT reception message queues are sent for setting up MQTT sets up module;
Serial data receiving thread for setting up serial data receiving thread sets up module;
Serial ports and the initialization of (a) serial ports mould of serial ports receipt completion signal amount are initialized for the serial data receiving thread Block;
The data cache module for receiving data buffer storage is set up for the serial data receiving thread;
The caching mutex module for receiving data buffer storage mutex is set up for the serial data receiving thread;
Data processing threads for setting up data processing threads set up module.
The wireless communication apparatus also includes:
The outer of the peripheral equipment control order that MQTT proxy servers are issued is received for the MQTT data transmit-receives thread Portion's equipment control command receiving module;
Peripheral equipment control order for the peripheral equipment control Order receiver module to be received is pushed into described MQTT receives the order push-in module of message queue;
The outside that peripheral equipment control order is extracted from MQTT reception message queues for data processing threads is set Standby control command extraction module;
The peripheral equipment control command analysis module of the peripheral equipment control order is parsed for data processing threads;
Judge that the peripheral equipment control order is intended for the command determination of correspondence external equipment for data processing threads Module;
The order sending module of peripheral equipment control order is sent to the external equipment for data processing threads;
The implementing result receiving module of the command execution results of the external equipment is received for serial data receiving thread;
The data that the command execution results are saved in the reception data buffer storage are protected for serial data receiving thread Storing module;
The letter of the serial ports receipt completion signal amount is sent to MQTT data transmit-receives thread for serial data receiving thread Number sending module;
The signal receiving module of the serial ports receipt completion signal amount is received for the MQTT data transmit-receives thread;
Received for the MQTT data transmit-receives thread after the serial ports receipt completion signal amount, read the reception data Data cached data read module in caching;
The news release module given out information for the MQTT data transmit-receives thread to MQTT proxy servers.
The wireless communication apparatus also includes:
The order that the control command of MQTT proxy servers issue is received for the MQTT data transmit-receives thread receives mould Block;
Control command for the Order receiver module to be received is pushed into the control that the MQTT receives message queue Order push-in module;
The control command that control command is extracted from MQTT reception message queues for data processing threads extracts mould Block;
The control command parsing module of the control command is parsed for data processing threads;
The order for performing its control command extracted from MQTT reception message queues for data processing threads is held Row module;
The knot of its implementing result for performing the control command is issued to MQTT proxy servers for data processing threads Fruit release module.
The wireless communication apparatus also includes:
The upgrading life of the firmware upgrade order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread Make receiving module;
Firmware upgrade order for the upgrade command receiving module to be received is pushed into the MQTT and receives message team The upgrade command push-in module of row;
The upgrade command that firmware upgrade order is extracted from MQTT reception message queues for data processing threads is carried Modulus block;
Firmware upgrade thread for setting up firmware upgrade thread sets up module;
The link block of HTTP file servers is connected for the firmware upgrade thread;
The file download module of firmware file is downloaded for firmware upgrade thread;
The file verification module of file integrality is verified for firmware upgrade thread;
The mark writing module of upgrading mark is write for firmware upgrade thread.
The wireless communication apparatus also includes:
Network layer encryption module for network layer encryption;
The transport layer encrypting module encrypted for transport layer;
Application layer encryption module for application layer encryption.
Enter initial phase after the wireless communication apparatus operation:
In initial phase, module, serial data receiving thread are set up by data transmit-receive thread first and set up module Module, which is set up, with data processing threads sets up MQTT data transmit-receive threads, serial data receiving thread and data processing line respectively Journey.After the MQTT data transmit-receives thread is set up, MQTT data transmit-receives thread and MQTT are set up by connection establishment module first Connection between proxy server.After the completion of connection, the MQTT data transmit-receives thread is noted using message subscribing module and information Volume module carries out message subscribing and registers the testament message of oneself.Meanwhile, set up module using message queue and set up MQTT transmissions Message queue and MQTT receive message queue.After the serial data receiving thread is set up, serial data receiving thread leads to first Initialization module is crossed to initialize serial ports and serial ports receipt completion signal amount, it is then mutual using data cache module and caching Reprimand amount module sets up reception data buffer storage and receives data buffer storage mutex respectively.In addition, in initial phase, the data Handle after thread foundation, data processing threads wait MQTT to receive message queue and serial ports receipt completion signal amount.Now, initially The change stage terminates.
When the wireless communication apparatus enters the processing peripheral equipment control command phase:
The MQTT data transmit-receives thread receives MQTT proxy servers by peripheral equipment control Order receiver module and sent out The peripheral equipment control order of cloth, wherein, external equipment can be the water regulator being presented below.
Then, MQTT data transmit-receives thread is disappeared by ordering push-in module that peripheral equipment control order is pushed into MQTT and received Cease in queue.Then, data processing threads receive message queue by peripheral equipment control order extraction module from the MQTT Middle extraction peripheral equipment control order, and the external equipment control currently extracted is parsed using peripheral equipment control command analysis module System order, while judging to determine that the peripheral equipment control order needs the corresponding external equipment issued using command determination module Object (for example, judges that the order is intended for water regulator).After the determination external equipment is judged, the data processing threads Data are directly sent to external equipment by serial ports block type.External equipment receives and order is performed after order data, and passes through Serial ports returns to implementing result.The serial data receiving thread receives the command execution results by implementing result receiving module, The implementing result is a complete serial data.Then, the serial data receiving thread will be ordered using data storage module Make implementing result be saved in the reception data buffer storage, and serial ports is sent to MQTT data transmit-receives thread by signal transmitting module Receipt completion signal amount.The MQTT data transmit-receives thread receives serial ports receipt completion signal amount by signal receiving module, and Using data cached in the data read module reading reception data buffer storage, then acted on behalf of by news release module to MQTT Server gives out information.Now, the communication of peripheral equipment control is completed.
The wireless communication apparatus enters the wireless telecommunications control command that processing control software is sent to wireless communication apparatus During the stage:
First, the MQTT data transmit-receives thread receives the wireless of MQTT proxy servers issue by Order receiver module Communication Control order;Then, the MQTT data transmit-receives thread is pushed into module by described in control command push-in by control command MQTT is received in message queue.Then, data processing threads receive message team by control command extraction module from the MQTT Control command is extracted in row;Then, data processing threads are carried out using control command parsing module and command execution module successively The parsing of control command and the execution of control command.Finally, data processing threads are acted on behalf of to MQTT by result release module and taken Business device issues its implementing result for performing the control command.Now, the communication in this stage is completed.
When the wireless communication apparatus enters the firmware upgrade stage:
First, the MQTT data transmit-receives thread receives what MQTT proxy servers were issued by upgrade command receiving module Firmware upgrade order;Then, the MQTT data transmit-receives thread is pushed into module by upgrade command and is pushed into firmware upgrade order The MQTT is received in message queue;Then, data processing threads are received from the MQTT by upgrade command extraction module and disappeared Cease and firmware upgrade order is extracted in queue;And module is set up by firmware upgrade thread set up firmware upgrade thread.Complete firmware After thread of upgrading is set up, the firmware upgrade thread by link block set up firmware upgrade thread and HTTP file servers it Between connection;And the download of firmware updating file is carried out and solid to this by file download module and file verification module successively Part file completion property is verified;Finally, the firmware upgrade thread is by indicating writing module by this upgrading write-in upgrading Mark.Starting system of laying equal stress on completes upgrading.
A kind of wireless communication method based on MQTT agreements, the technical scheme taken is as follows,
The wireless communication method includes:
Data transmit-receive thread establishment step for setting up MQTT data transmit-receive threads;
Connection establishment step for setting up connection between the MQTT data transmit-receives thread and MQTT proxy servers;
The message subscribing step of message subscribing is carried out for the MQTT data transmit-receives thread;
The information registering step of testament message is registered for the MQTT data transmit-receives thread;
For setting up, MQTT sends message queue and MQTT receives the message queue establishment step of message queue;
Serial data receiving thread establishment step for setting up serial data receiving thread;
The initialization of (a) serial ports step of serial ports and serial ports receipt completion signal amount is initialized for the serial data receiving thread Suddenly;
The data buffer storage step for receiving data buffer storage is set up for the serial data receiving thread;
The caching mutex step for receiving data buffer storage mutex is set up for the serial data receiving thread;
Data processing threads establishment step for setting up data processing threads.
The wireless communication method also includes:
The outer of the peripheral equipment control order that MQTT proxy servers are issued is received for the MQTT data transmit-receives thread Portion's equipment control command receiving step;
Peripheral equipment control order for the peripheral equipment control order receiving step to be received is pushed into described MQTT receives the order push-in step of message queue;
The outside that peripheral equipment control order is extracted from MQTT reception message queues for data processing threads is set Standby control command extraction step;
The peripheral equipment control command analysis step of the peripheral equipment control order is parsed for data processing threads;
Judge that the peripheral equipment control order is intended for the command determination of correspondence external equipment for data processing threads Step;
The order forwarding step of peripheral equipment control order is sent to the external equipment for data processing threads;
The implementing result receiving step of the command execution results of the external equipment is received for serial data receiving thread;
The data that the command execution results are saved in the reception data buffer storage are protected for serial data receiving thread Deposit step;
The letter of the serial ports receipt completion signal amount is sent to MQTT data transmit-receives thread for serial data receiving thread Number hair step;
The signal receiving step of the serial ports receipt completion signal amount is received for the MQTT data transmit-receives thread;
Received for the MQTT data transmit-receives thread after the serial ports receipt completion signal amount, read the reception data Data cached data reading step in caching;
The news release step given out information for the MQTT data transmit-receives thread to MQTT proxy servers.
The wireless communication method also includes:
The order that the control command of MQTT proxy servers issue is received for the MQTT data transmit-receives thread receives step Suddenly;
Control command for the order receiving step to be received is pushed into the control that the MQTT receives message queue Order push-in step;
The control command that control command is extracted from MQTT reception message queues for data processing threads extracts step Suddenly;
The control command analyzing step of the control command is parsed for data processing threads;
The order for performing its control command extracted from MQTT reception message queues for data processing threads is held Row step;
The knot of its implementing result for performing the control command is issued to MQTT proxy servers for data processing threads Fruit issuing steps.
The wireless communication method also includes:
The upgrading life of the firmware upgrade order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread Make receiving step;
Firmware upgrade order for the upgrade command receiving step to be received is pushed into the MQTT and receives message team The upgrade command push-in step of row;
The upgrade command that firmware upgrade order is extracted from MQTT reception message queues for data processing threads is carried Take step;
Firmware upgrade thread establishment step for setting up firmware upgrade thread;
The Connection Step of HTTP file servers is connected for the firmware upgrade thread;
The file downloading step of firmware file is downloaded for firmware upgrade thread;
The file verification step of file integrality is verified for firmware upgrade thread;
The mark write step of upgrading mark is write for firmware upgrade thread.
The wireless communication method also includes:
Network layer encryption step for network layer encryption;
The transport layer encrypting step encrypted for transport layer;
Application layer encryption step for application layer encryption.
Network layer encryption, supports WEP, and WPA/WPA2, many kinds of cipher modes of PSK/Enterprise have been encrypted in addition to IP All layers, improve internet security.Transport layer is encrypted, and is encrypted using TLS, encryption MQTT packets, built in wireless module MQTT proxy server certificates, set up when connecting and MQTT proxy server negotiation communication keys, prevent man-in-the-middle attack.Using Layer encryption, supports the certification of user name pin mode, very high user's application safety.
The wireless communication method sets up MQTT data transmit-receive threads, serial data receiving thread in initial phase And data processing threads.After the MQTT data transmit-receives thread is set up, initially set up MQTT data transmit-receives thread and acted on behalf of with MQTT Connection between server, after the completion of connection, the MQTT data transmit-receives thread carries out message subscribing, and registers the testament of oneself Message.After testament message is subscribed to and registered to MQTT data transmit-receive threads completion message, the MQTT data transmit-receives thread is built Vertical MQTT sends message queue and MQTT receives message queue.After the serial data receiving thread is set up, serial data first Receiving thread is initialized to serial ports and serial ports receipt completion signal amount, is then set up to receive data buffer storage and receive data and is delayed Deposit mutex.In initial phase, after the data processing threads are set up, data processing threads wait MQTT to receive message team Row and serial ports receipt completion signal amount.Now, initial phase terminates.
In the processing peripheral equipment control command phase, first, the MQTT data transmit-receives thread receives MQTT agency's clothes The peripheral equipment control order of business device issue, wherein, external equipment can be the water regulator being presented below.
Then, MQTT data transmit-receives thread receives peripheral equipment control order push-in MQTT in message queue.Then, number Peripheral equipment control order is extracted from MQTT reception message queues according to processing thread, and parses the outside currently extracted and is set Standby control command, while judging to determine that the peripheral equipment control order needs the corresponding external equipment object issued (such as, to sentence The disconnected order is intended for water regulator).After the determination external equipment is judged, the data processing threads directly pass through serial ports Block type sends data to external equipment.External equipment receives and order is performed after order data, and returns to execution by serial ports As a result.Now, the serial data receiving thread receives the command execution results, and the implementing result is a complete serial ports number According to.Then, command execution results are saved in the reception data buffer storage by the serial data receiving thread, and to MQTT data Receiving or sending thread sends serial ports receipt completion signal amount.The MQTT data transmit-receives thread receives serial ports receipt completion signal amount, and It is data cached in the reading reception data buffer storage, then given out information to MQTT proxy servers.Now, peripheral equipment control Communication complete.
When handling the wireless telecommunications control command stage, first, the MQTT data transmit-receives thread receives MQTT agency's clothes The wireless telecommunications control command of business device issue;Then, control command is pushed into the MQTT and connect by the MQTT data transmit-receives thread Receive in message queue.Then, data processing threads extract control command from MQTT reception message queues;Then, data Processing thread parsing control command simultaneously performs the control command.Finally, data processing threads issue it to MQTT proxy servers Perform the implementing result of the control command.Now, the communication in this stage is completed.
At the firmware upgrade stage, first, the MQTT data transmit-receives thread receives consolidating for MQTT proxy servers issue Part upgrade command;Then, firmware upgrade order is pushed into the MQTT and received in message queue by the MQTT data transmit-receives thread; Then, firmware upgrade order is extracted in the logical reception message queue from the MQTT of data processing threads;And set up firmware upgrade line Journey.Complete after firmware upgrade thread sets up, the firmware upgrade thread set up firmware upgrade thread and HTTP file servers it Between connection;And carry out the download of firmware updating file and firmware file completion property is verified;Finally, the firmware Thread of upgrading indicates this upgrading write-in upgrading.Starting system of laying equal stress on completes upgrading.
A kind of water regulator based on wireless communication apparatus of the present invention, the water regulator passes through based on the wireless of MQTT agreements Communication device realizes the communication between water regulator and control software, realizes that water regulator is reached the standard grade notice, logical by the wireless communication apparatus Cross MQTT words of the deceased mechanism and realize the offline notice of water regulator, and firmware upgrade is realized by HTTP.Specifically, the water regulator bag Include core processor, display module, read-write card module, clock module, wireless communication apparatus, back-up source, power supply, water meter detection Module and gate valve control module;The display control signal output end of the core processor and the control signal of display module are inputted End is connected;The read-write control signal output end of the core processor is connected with reading and writing the control signal input of card module;Institute The clock signal input terminal of core processor is stated with the clock signal output terminal of clock module to be connected;The nothing of the core processor Line control signal output end is connected with the control signal input of wireless communication apparatus;The power supply signal of the core processor is defeated Enter electrical signal of the end with stand-by power supply signal input part respectively at power supply with the electrical signal of back power supply to be connected; The water meter detection signal input part of the core processor is connected with the signal output part of water meter detection module;The core processing The valve driving control signal output end of device is connected with the control signal input of valve drive module.
Wherein, the core processor is the most crucial part of whole water regulator, and control control water is coordinated by core processor The work of device each several part.
The power circuit is changed by DC voltage-stabilizing, and+5V and+3.3V operating voltages are provided for water regulator, meanwhile, core Processor can monitor whether power circuit normally runs, and when power circuit occurs abnormal, core processor can be preserved in time Field data, and close valve.
The back-up source is used in abnormity of power supply, and power down process working power and clock power are provided for water regulator.
During water regulator is consumed, the water that user consumes is detected by the water meter detection module;In valve In the state of closing, by the water meter detection module detection water lines whether leak.
The startup and closing of motor-driven valve or magnetic valve that the valve driving circuit is used in control water lines.
The clock module is used under offline condition, and the time is provided for water regulator work.
The display module is used to show the information such as working condition, the warning message of water regulator.
The read-write card module, the card for being supported water regulator is written and read operation.
On the other hand, data interaction is carried out by wireless network between water regulator and control software, allows water regulator will Various data are uploaded in control software by the wireless communication apparatus based on MQTT agreements, control software can also by based on The wireless communication apparatus of MQTT agreements directly controls water regulator to complete various operations, it is possible to which various data are downloaded into water regulator In.Specifically:
On the water regulator after electricity, core processor brings into operation, first, core processor detection each several part hardware module Working condition, if there is hardware anomalies, core processor provides corresponding alarm, and passes through wireless communication apparatus profit Prompt messages are sent to control software with the pattern that releases news of MQTT agreements.
If there is no exception, water regulator enters normal operating conditions, and the working condition of water regulator periodically is passed through into nothing The water regulator work state information is sent to control software by line communication device using the pattern that releases news of MQTT agreements.Its In, the news release pattern carries out the transmission of water regulator work state information using transmission form " at most once ", this Transmission form advantageously reduces network traffics, reduces network space-consuming.
The mode of operation of the water regulator mainly includes charge type such as timing type, metering type, metering type etc.;Valve controlling Type such as motor-driven valve, magnetic valve, shearing-proof valve etc.;Consume unit price, identity information, charge unit etc..The work of the water regulator Pattern can be set or be changed by control software, when control software needs that the mode of operation of water regulator is set or changed When, control software issues Working mode set using the pattern that gives out information of MQTT agreements by wireless communication apparatus to water regulator Or change information, wherein, now the pattern that gives out information of the MQTT agreements is using at least one times " transmission form to water regulator Send Working mode set or change information.On the other hand, when controller needs to set or changes mode of operation, the water regulator Working mode set or change information are obtained using the subscription massage pattern of MQTT agreements by wireless communication apparatus;It is described to subscribe to Massage pattern is operated pattern setting or the acquisition of change information using acquisition form " at least one times ", it is ensured that information is arrived Reach.
In the case of water regulator normal work, water regulator has detected card when swiping the card, and the read-write card module of water regulator is read User profile on card taking piece, judges whether the subscriber card of this water regulator, if the subscriber card of this water regulator, the water regulator User account information is obtained to control software using the subscription massage pattern of MQTT agreements by wireless communication apparatus;It is described to subscribe to Massage pattern carries out the acquisition of user account information using acquisition form " at least one times ".Control software judges that user profile has After effect, by wireless communication apparatus to passing account-related information under water regulator and the amount of money of withholding.Then, water regulator opens valve, Start charging, and in charging process, the amount of money or correspondence consumption figure of charging are shown by display module.
When terminating consumption, the both of which that water regulator has terminates consumption:The first pattern, detects the secondary brush of subscriber card Card, terminates consumption after giving change;Second of pattern, the amount of money of withholding has been consumed.Terminate after consumption, water regulator control valve is closed, together Shi Shengcheng consumes flowing water information, and subsequent water regulator will consume issue of the flowing water Information Pull wireless communication apparatus by MQTT agreements Massage pattern is uploaded to system software, and the news release pattern carries out consumption flowing water letter using the transmission form of " only once " The transmission of breath.
In the state of water regulator normal work parallel-connection network, system controlling software can develop to water regulator, close valve Operation;Locked, unlock operation, under locking state, water regulator stops receiving bankcard consumption.These operations are assisted by MQTT The pattern of giving out information of view is handed down to water regulator.System software can actively gather the state of water regulator, pass through MQTT agreements Massage pattern is subscribed to obtain to water regulator.
Although the present invention is disclosed as above with preferred embodiment, it is not limited to the present invention, any to be familiar with this The people of technology, without departing from the spirit and scope of the present invention, can do various changes and modification, therefore the protection of the present invention What scope should be defined by claims is defined.

Claims (10)

1. a kind of wireless communication apparatus based on MQTT agreements, it is characterised in that the wireless communication apparatus includes:
Data transmit-receive thread for setting up MQTT data transmit-receive threads sets up module;
Connection establishment module for setting up connection between the MQTT data transmit-receives thread and MQTT proxy servers;
The message subscribing module of message subscribing is carried out for the MQTT data transmit-receives thread;
The information registering module of testament message is registered for the MQTT data transmit-receives thread;
The message queue that message queue and MQTT reception message queues are sent for setting up MQTT sets up module;
Serial data receiving thread for setting up serial data receiving thread sets up module;
The initialization of (a) serial ports module of serial ports and serial ports receipt completion signal amount is initialized for the serial data receiving thread;
The data cache module for receiving data buffer storage is set up for the serial data receiving thread;
The caching mutex module for receiving data buffer storage mutex is set up for the serial data receiving thread;
Data processing threads for setting up data processing threads set up module.
2. the wireless communication apparatus according to claim 1 based on MQTT agreements, it is characterised in that the wireless communication apparatus Also include:
The outside that the peripheral equipment control order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread is set Standby control command receiving module;
Peripheral equipment control order for the peripheral equipment control Order receiver module to be received is pushed into the MQTT and connect Receive the order push-in module of message queue;
The external equipment control of peripheral equipment control order is extracted from MQTT reception message queues for data processing threads Order extraction module processed;
The peripheral equipment control command analysis module of the peripheral equipment control order is parsed for data processing threads;
Judge that the peripheral equipment control order is intended for the command determination module of correspondence external equipment for data processing threads;
The order sending module of peripheral equipment control order is sent to the external equipment for data processing threads;
The implementing result receiving module of the command execution results of the external equipment is received for serial data receiving thread;
The data that the command execution results are saved in the reception data buffer storage are preserved into mould for serial data receiving thread Block;
Sent out for the signal that serial data receiving thread sends the serial ports receipt completion signal amount to MQTT data transmit-receives thread Send module;
The signal receiving module of the serial ports receipt completion signal amount is received for the MQTT data transmit-receives thread;
Received for the MQTT data transmit-receives thread after the serial ports receipt completion signal amount, read the reception data buffer storage In data cached data read module;
The news release module given out information for the MQTT data transmit-receives thread to MQTT proxy servers.
3. the wireless communication apparatus according to claim 1 based on MQTT agreements, it is characterised in that the wireless communication apparatus Also include:
The Order receiver module of the control command of MQTT proxy servers issue is received for the MQTT data transmit-receives thread;
Control command for the Order receiver module to be received is pushed into the control command that the MQTT receives message queue It is pushed into module;
The control command extraction module of control command is extracted from MQTT reception message queues for data processing threads;
The control command parsing module of the control command is parsed for data processing threads;
The order for performing its control command extracted from MQTT reception message queues for data processing threads performs mould Block;
Sent out for the result that data processing threads issue its implementing result for performing the control command to MQTT proxy servers Cloth module.
4. the wireless communication apparatus according to claim 1 based on MQTT agreements, it is characterised in that the wireless communication apparatus Also include:
The upgrade command that the firmware upgrade order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread connects Receive module;
Firmware upgrade order for the upgrade command receiving module to be received is pushed into the MQTT and receives message queue Upgrade command is pushed into module;
The upgrade command that firmware upgrade order is extracted from MQTT reception message queues for data processing threads extracts mould Block;
Firmware upgrade thread for setting up firmware upgrade thread sets up module;
The link block of HTTP file servers is connected for the firmware upgrade thread;
The file download module of firmware file is downloaded for firmware upgrade thread;
The file verification module of file integrality is verified for firmware upgrade thread;
The mark writing module of upgrading mark is write for firmware upgrade thread.
5. a kind of wireless communication method based on MQTT agreements, it is characterised in that the wireless communication method includes:
Data transmit-receive thread establishment step for setting up MQTT data transmit-receive threads;
Connection establishment step for setting up connection between the MQTT data transmit-receives thread and MQTT proxy servers;
The message subscribing step of message subscribing is carried out for the MQTT data transmit-receives thread;
The information registering step of testament message is registered for the MQTT data transmit-receives thread;
For setting up, MQTT sends message queue and MQTT receives the message queue establishment step of message queue;
Serial data receiving thread establishment step for setting up serial data receiving thread;
The initialization of (a) serial ports step of serial ports and serial ports receipt completion signal amount is initialized for the serial data receiving thread;
The data buffer storage step for receiving data buffer storage is set up for the serial data receiving thread;
The caching mutex step for receiving data buffer storage mutex is set up for the serial data receiving thread;
Data processing threads establishment step for setting up data processing threads.
6. the wireless communication method according to claim 6 based on MQTT agreements, it is characterised in that the wireless communication method Also include:
The outside that the peripheral equipment control order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread is set Standby control command receiving step;
Peripheral equipment control order for the peripheral equipment control order receiving step to be received is pushed into the MQTT and connect Receive the order push-in step of message queue;
The external equipment control of peripheral equipment control order is extracted from MQTT reception message queues for data processing threads Order extraction step processed;
The peripheral equipment control command analysis step of the peripheral equipment control order is parsed for data processing threads;
Judge that the peripheral equipment control order is intended for the command determination step of correspondence external equipment for data processing threads;
The order forwarding step of peripheral equipment control order is sent to the external equipment for data processing threads;
The implementing result receiving step of the command execution results of the external equipment is received for serial data receiving thread;
The data that the command execution results are saved in the reception data buffer storage are preserved for serial data receiving thread and walked Suddenly;
Sent out for the signal that serial data receiving thread sends the serial ports receipt completion signal amount to MQTT data transmit-receives thread Step;
The signal receiving step of the serial ports receipt completion signal amount is received for the MQTT data transmit-receives thread;
Received for the MQTT data transmit-receives thread after the serial ports receipt completion signal amount, read the reception data buffer storage In data cached data reading step;
The news release step given out information for the MQTT data transmit-receives thread to MQTT proxy servers.
7. the wireless communication method according to claim 1 based on MQTT agreements, it is characterised in that the wireless communication method Also include:
The order receiving step of the control command of MQTT proxy servers issue is received for the MQTT data transmit-receives thread;
Control command for the order receiving step to be received is pushed into the control command that the MQTT receives message queue It is pushed into step;
The control command extraction step of control command is extracted from MQTT reception message queues for data processing threads;
The control command analyzing step of the control command is parsed for data processing threads;
The order for performing its control command extracted from MQTT reception message queues for data processing threads performs step Suddenly;
Sent out for the result that data processing threads issue its implementing result for performing the control command to MQTT proxy servers Cloth step.
8. the wireless communication method according to claim 1 based on MQTT agreements, it is characterised in that the wireless communication method Also include:
The upgrade command that the firmware upgrade order of MQTT proxy servers issue is received for the MQTT data transmit-receives thread connects Receive step;
Firmware upgrade order for the upgrade command receiving step to be received is pushed into the MQTT and receives message queue Upgrade command is pushed into step;
The upgrade command that firmware upgrade order is extracted from MQTT reception message queues for data processing threads extracts step Suddenly;
Firmware upgrade thread establishment step for setting up firmware upgrade thread;
The Connection Step of HTTP file servers is connected for the firmware upgrade thread;
The file downloading step of firmware file is downloaded for firmware upgrade thread;
The file verification step of file integrality is verified for firmware upgrade thread;
The mark write step of upgrading mark is write for firmware upgrade thread.
9. a kind of water regulator based on any wireless communication apparatus of Claims 1-4, it is characterised in that the water regulator Including core processor, display module, read-write card module, clock module, wireless communication apparatus, back-up source, power supply, water meter inspection Survey module and gate valve control module;The display control signal output end of the core processor and the control signal of display module are defeated Enter end to be connected;The read-write control signal output end of the core processor is connected with reading and writing the control signal input of card module; The clock signal input terminal of the core processor is connected with the clock signal output terminal of clock module;The core processor Wireless control signal output end is connected with the control signal input of wireless communication apparatus;The power supply signal of the core processor Input and stand-by power supply signal input part are respectively at the electrical signal of power supply and the electrical signal phase of back power supply Even;The water meter detection signal input part of the core processor is connected with the signal output part of water meter detection module;The core The valve driving control signal output end of processor is connected with the control signal input of valve drive module.
10. water regulator according to claim 9, it is characterised in that the water regulator is sent out using the message of wireless communication apparatus Cloth pattern sends prompt messages;
The water regulator sends water regulator work state information by the news release pattern of the wireless communication apparatus;It is described to disappear Cease the transmission that release model carries out water regulator work state information using transmission form at most once;
The water regulator sends consumption flowing water information by the news release pattern of the wireless communication apparatus;The news release Pattern carries out the transmission of consumption flowing water information using transmission form only once;
The water regulator obtains Working mode set or change information by the subscription massage pattern of wireless communication apparatus;It is described to order Read massage pattern and pattern setting or the acquisition of change information are operated using acquisition form at least one times;
The water regulator obtains user account information by the subscription massage pattern of wireless communication apparatus;The subscription massage pattern The acquisition of user account information is carried out using acquisition form at least one times.
CN201710450640.6A 2017-06-15 2017-06-15 A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements Pending CN107231425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710450640.6A CN107231425A (en) 2017-06-15 2017-06-15 A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710450640.6A CN107231425A (en) 2017-06-15 2017-06-15 A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements

Publications (1)

Publication Number Publication Date
CN107231425A true CN107231425A (en) 2017-10-03

Family

ID=59936478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710450640.6A Pending CN107231425A (en) 2017-06-15 2017-06-15 A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements

Country Status (1)

Country Link
CN (1) CN107231425A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062230A (en) * 2018-01-04 2018-05-22 安徽大学 Serial ports transparent transmission and program updating system and its method in a kind of Internet wide
CN108337120A (en) * 2018-02-01 2018-07-27 北京安控科技股份有限公司 A kind of remote upgrade method of internet-of-things terminal equipment
WO2019224697A1 (en) * 2018-05-23 2019-11-28 Inversiones Tecnológicas De America S.A. Multi-biometric iot bridge
CN111049761A (en) * 2019-12-25 2020-04-21 哈尔滨新中新电子股份有限公司 Data processing method of wireless water controller communication module

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203260180U (en) * 2013-05-23 2013-10-30 深圳市常工电子计算机有限公司 Wireless communication network water controller
CN104052653A (en) * 2014-06-23 2014-09-17 广东天波信息技术股份有限公司 Method for state presentation based on MQTT
CN105065750A (en) * 2015-09-08 2015-11-18 陈华 Energy-saving water controller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203260180U (en) * 2013-05-23 2013-10-30 深圳市常工电子计算机有限公司 Wireless communication network water controller
CN104052653A (en) * 2014-06-23 2014-09-17 广东天波信息技术股份有限公司 Method for state presentation based on MQTT
CN105065750A (en) * 2015-09-08 2015-11-18 陈华 Energy-saving water controller

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
任亨: "基于MQTT协议的消息推送集群系统的设计与实现", 《中国优秀硕士学位论文群文数据库 信息科技辑》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062230A (en) * 2018-01-04 2018-05-22 安徽大学 Serial ports transparent transmission and program updating system and its method in a kind of Internet wide
CN108337120A (en) * 2018-02-01 2018-07-27 北京安控科技股份有限公司 A kind of remote upgrade method of internet-of-things terminal equipment
WO2019224697A1 (en) * 2018-05-23 2019-11-28 Inversiones Tecnológicas De America S.A. Multi-biometric iot bridge
US11843677B2 (en) 2018-05-23 2023-12-12 Inversiones Tecnologicas De America S.A. Multi-biometric IoT bridge
CN111049761A (en) * 2019-12-25 2020-04-21 哈尔滨新中新电子股份有限公司 Data processing method of wireless water controller communication module
CN111049761B (en) * 2019-12-25 2023-06-20 哈尔滨新中新电子股份有限公司 Data processing method of wireless water controller communication module

Similar Documents

Publication Publication Date Title
CN107231425A (en) A kind of wireless communication apparatus and method and a kind of water regulator based on MQTT agreements
CN103944869B (en) Access the method and high in the clouds connector of remote resource
CN101222340B (en) Method of power state control and system
CN103177495B (en) Door lock system applied to hotels
CN105453621B (en) Method and apparatus for registering and verifying equipment in a wireless communication system
CN104780054B (en) A kind of gateway to the wake-up of control area net(CAN) network or suspend mode
CN105788050A (en) Control door lock adapter controlled by Bluetooth signals and control method implemented by control door lock adapter
CN104038803B (en) A kind of modularization intelligent TV and the exchange method applied to modularization intelligent TV
US11321708B2 (en) Inter-device credential transfer
CN107358506A (en) Product customization method, apparatus and equipment for customizing
CN104123768A (en) Safety intelligent lock system and unlocking and locking control method
CN108173860A (en) A kind of MQTT connection methods, system, terminal and the server of low side constrained devices
Saparkhojayev et al. NFC-enabled access control and management system
CN109981312A (en) Smart machine configuration method, apparatus and system
Bindroo et al. A wearable NFC wristband for remote home automation system
US20080106423A1 (en) Monitoring Systems and Methods that Incorporate Instant Messaging
CN104660644B (en) Communication means and remote terminal
CN102799999A (en) Large-range low-cost membership system realization method
CN105306493B (en) IPC service implementing method and system based on encryption mechanism
CN103281324A (en) Safety communication method for Android client side
CN103136481A (en) Intelligent energy meter information security management module
WO2017067330A1 (en) An apparatus and method for configuration management of a wireless access point
CN104054315A (en) Secure information access over network
CN104735636B (en) For answering method, the Apparatus and system that behavior is paid
CN106954281A (en) A kind of WIFI connection methods and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20171003

RJ01 Rejection of invention patent application after publication