CN109729154B - Simple message subscription and publishing service method based on controller - Google Patents

Simple message subscription and publishing service method based on controller Download PDF

Info

Publication number
CN109729154B
CN109729154B CN201811528599.0A CN201811528599A CN109729154B CN 109729154 B CN109729154 B CN 109729154B CN 201811528599 A CN201811528599 A CN 201811528599A CN 109729154 B CN109729154 B CN 109729154B
Authority
CN
China
Prior art keywords
terminal device
controller
data
message subscription
simple message
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
CN201811528599.0A
Other languages
Chinese (zh)
Other versions
CN109729154A (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.)
Sichuan Energy Industry Investment Group Co ltd
Original Assignee
Sichuan Energy Industry Investment Group 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 Sichuan Energy Industry Investment Group Co ltd filed Critical Sichuan Energy Industry Investment Group Co ltd
Priority to CN201811528599.0A priority Critical patent/CN109729154B/en
Publication of CN109729154A publication Critical patent/CN109729154A/en
Application granted granted Critical
Publication of CN109729154B publication Critical patent/CN109729154B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a simple message subscription and publishing service method based on a controller, which comprises the following steps: establishing an intranet communication connection between the controller and each terminal device based on an intranet communication protocol; the controller acquires the topic subscribed by each terminal device and analyzes the data requirement of each terminal device; the controller acquires a plurality of data issued by each terminal device; the controller selects matched data from the plurality of data issued by the terminal equipment according to the data requirements of the terminal equipment and sends the matched data to the corresponding terminal equipment; and each terminal device receives the data. The invention establishes a set of simple message subscription and publishing service method flow based on the controller through a unified communication protocol, and can enable each terminal device to still complete simple message subscription and publishing based on the controller under the condition that a remote server network is disconnected, namely, the autonomous communication between each terminal device under the server-free network is realized.

Description

Simple message subscription and publishing service method based on controller
Technical Field
The invention relates to the technical field of communication, in particular to a simple message subscription and publishing service method based on a controller.
Background
The Internet of things is regarded as application extension of the Internet, application innovation is the core of development of the Internet of things, and innovation taking user experience as the core is the soul of development of the Internet of things. The internet of things is a network which connects any object with the internet through various sensing technologies (radio frequency identification (RFID), a sensor, a navigation Global Positioning System (GPS), a camera and a laser scanner) and various communication means (wired, wireless, long-distance and short-distance communication modes) so as to realize remote monitoring, automatic alarm, control, diagnosis and maintenance and further realize the integration of management, control and operation.
In recent years, with the wider application of the internet of things equipment, the control and management of the internet of things equipment are important means for realizing the intelligent application in the field of the internet of things. In order to realize the control function of the internet of things equipment, the terminal and the internet of things equipment need to be bound firstly, and meanwhile, network sharing of a remote server is needed to realize communication of each terminal equipment.
In the existing internet of things technology, message subscription and publication among terminal devices are based on a remote server, short-distance communication equipment must communicate with the remote server through a controller, and a network must be smooth. If the network is not smooth or the network is disconnected, the communication between the terminal devices cannot be realized.
Disclosure of Invention
At least one of the objectives of the present invention is to overcome the above problems in the prior art, and provide a simple message subscription and publication service method based on a controller, which can complete simple message subscription and publication between terminal devices based on the controller even when a remote server network is disconnected, thereby implementing autonomous communication in a serverless network.
In order to achieve the above object, the present invention adopts the following aspects.
A controller-based simple message subscription publication service method, the method comprising:
establishing an intranet communication connection between the controller and each terminal device based on an intranet communication protocol, wherein the intranet communication protocol comprises a fixed head with two bytes, a communication address with two bytes, a function code with one byte, a packet identifier with two bytes, multi-byte content and a check code with two bytes;
setting a controller and each terminal device connected in the intranet communication connection to adopt a unified clock, acquiring a theme subscribed by each terminal device in a first clock period by the controller, and analyzing the data requirement of each terminal device from the theme subscribed by each terminal device;
the controller acquires a plurality of data issued by each terminal device in a second clock period;
the controller selects data matched with the data requirements from the plurality of data issued by each terminal device according to the data requirements of each terminal device and sends the data to the corresponding terminal device;
and each terminal device receives the data to realize the message subscription and publication among the terminal devices.
Preferably, in the simple message subscription and publication service method based on a controller, the controller obtains a topic subscribed by each terminal in a first clock cycle, and the method specifically includes:
the controller acquires a theme to be subscribed of each terminal device in a timing query mode in a first clock period;
or the controller reads the historical data of the subscription theme of each terminal device in the first clock cycle.
Preferably, in the simple message subscription and publication service method based on a controller, the terminal device includes: one or more of a sensor, a switch device, an LED display screen, and a single lamp controller.
In summary, due to the adoption of the technical scheme, the invention at least has the following beneficial effects:
through a unified communication protocol, a set of simple message subscription and publishing service method flow based on a controller is established, so that simple message subscription and publishing can be still completed among terminal devices based on the controller under the condition that a remote server network is disconnected, namely, autonomous communication among the terminal devices under a server-free network is realized.
Drawings
Fig. 1 is a flowchart of a simple message subscription publication service method based on a controller according to an exemplary embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and embodiments, so that the objects, technical solutions and advantages of the present invention will be more clearly understood. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 illustrates a simple message subscription-publishing service method based on a controller according to an exemplary embodiment of the present invention. The method of this embodiment mainly includes:
establishing an intranet communication connection between the controller and each terminal device based on an intranet communication protocol, wherein the intranet communication protocol comprises a fixed head with two bytes, a communication address with two bytes, a function code with one byte, a packet identifier with two bytes, multi-byte content and a check code with two bytes;
setting a controller and each terminal device connected in the intranet communication connection to adopt a unified clock, acquiring a theme subscribed by each terminal device in a first clock period by the controller, and analyzing the data requirement of each terminal device from the theme subscribed by each terminal device;
the controller acquires a plurality of data issued by each terminal device in a second clock period;
the controller selects data matched with the data requirements from the plurality of data issued by each terminal device according to the data requirements of each terminal device and sends the data to the corresponding terminal device;
and each terminal device receives the data to realize the message subscription and publication among the terminal devices.
Specifically, to implement the above simple message subscription or publication based on the controller, an intranet communication connection between the controller and each terminal device needs to be established, where the intranet communication connection enables the controller and each terminal device to communicate based on a unified intranet communication protocol, as shown in table 1, the intranet communication protocol includes a fixed header of two bytes, a communication address of two bytes, a function code of one byte, a packet identifier of two bytes, a content of multiple bytes, and a check code of two bytes.
Item Fixing head Communication address Function code Bag identification Content length Content providing method and apparatus CRC16
Size and breadth 2B 2B 1B 2B 2B NB 2B
TABLE 1
Wherein, the communication address is 0x0000 to represent the controller address, and non-0 x0000 to represent the terminal device address. The packet identifier is sent and received and is defined, and the responder copies the packet identifier. CRC16 represents a check value (check code) generated from the fixed header to the content. Therefore, communication between the controller and each terminal device can be carried out based on the uniform language. In a specific communication process, a unified clock is set for the controller and each terminal device in the intranet communication connection, and the controller is set to actively communicate with each terminal device within a first preset time interval (for example, half an hour) so as to obtain a theme subscribed by each terminal device (presented in the content of a communication protocol and needs to be analyzed by the controller). Or the controller directly reads the historical subscription records of the terminal devices to obtain the topics to be subscribed by the terminal devices, and if the controller obtains the topics to be subscribed by the terminal devices in a mode of reading the historical subscription records, the subscribed topics of the terminal devices need to be initially set in the controller for subsequent information reading. And the controller analyzes the data requirements of each terminal device from the topics subscribed by each terminal device.
The controller then obtains data issued by each terminal device in a second clock cycle, wherein each data is associated with a corresponding topic (the associated topic can be parsed from the data content). And the step of acquiring the data published by each terminal device is within 1-5 minutes after the step of acquiring the subscription theme of each terminal device is completed, and the step can also be within 1-5 minutes before the step of acquiring the subscription theme of each terminal device is performed. And then the controller screens the data issued by each terminal device according to the analyzed data requirements of each terminal device, selects the data matched with the data requirements and sends the data to the corresponding terminal device. For example, the controller analyzes the data requirement of the controller from the topic subscribed by the terminal device-sensor to be A, and the controller analyzes the data requirement of the controller from the topic subscribed by the terminal device-switch to be B; then, data issued by the terminal device and the sensor are acquired, and a plurality of data issued by the terminal device and the sensor comprise B, and then a plurality of data issued by the terminal device and the switch are acquired, and a is comprised in the plurality of data. The data B issued by the terminal device-sensor is sent to the terminal device-switch directly according to the terminal device-switch data requirements. And according to the data requirement A of the terminal device-sensor, selecting A from the data issued by the terminal device-switch and sending the selected A to the terminal device-sensor. And finally, each terminal device receives the data sent by the controller, and corresponding operation is completed.
In the above embodiment, through a unified communication protocol and based on the relay of the controller, information exchange and transmission between terminal devices can be realized at one time, and simple message subscription and publication are realized.
The foregoing is merely a detailed description of specific embodiments of the invention and is not intended to limit the invention. Various alterations, modifications and improvements will occur to those skilled in the art without departing from the spirit and scope of the invention.

Claims (2)

1. A simple message subscription and publication service method based on a controller, the method comprising:
establishing an intranet communication connection between the controller and each terminal device based on an intranet communication protocol, wherein the intranet communication protocol comprises a fixed head with two bytes, a communication address with two bytes, a function code with one byte, a packet identifier with two bytes, multi-byte content and a check code with two bytes;
setting a controller and each terminal device connected in the intranet communication connection to adopt a unified clock, acquiring a theme subscribed by each terminal device in a first clock period by the controller, and analyzing the data requirement of each terminal device from the theme subscribed by each terminal device;
the controller acquires a plurality of data issued by each terminal device in a second clock period;
the controller selects data matched with the data requirements from the plurality of data issued by each terminal device according to the data requirements of each terminal device and sends the data to the corresponding terminal device;
each terminal device receives the data to realize the message subscription and publication among the terminal devices; the method for acquiring the theme subscribed by each terminal in the first clock cycle by the controller specifically includes:
the controller acquires a theme to be subscribed of each terminal device in a timing query mode in a first clock period;
or the controller reads the historical data of the subscription theme of each terminal device in the first clock cycle.
2. The controller-based simple message subscription and publication service method of claim 1, wherein the terminal device comprises: one or more of a sensor, a switch device, an LED display screen, and a single lamp controller.
CN201811528599.0A 2018-12-13 2018-12-13 Simple message subscription and publishing service method based on controller Active CN109729154B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811528599.0A CN109729154B (en) 2018-12-13 2018-12-13 Simple message subscription and publishing service method based on controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811528599.0A CN109729154B (en) 2018-12-13 2018-12-13 Simple message subscription and publishing service method based on controller

Publications (2)

Publication Number Publication Date
CN109729154A CN109729154A (en) 2019-05-07
CN109729154B true CN109729154B (en) 2021-10-15

Family

ID=66296326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811528599.0A Active CN109729154B (en) 2018-12-13 2018-12-13 Simple message subscription and publishing service method based on controller

Country Status (1)

Country Link
CN (1) CN109729154B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114650309B (en) * 2022-03-08 2023-11-10 青岛瑰宝电子科技有限公司 Control method and battery BMS system control method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377686A (en) * 2010-08-10 2012-03-14 阿里巴巴集团控股有限公司 Message subscription system, method and device
CN106230914A (en) * 2016-07-26 2016-12-14 重庆锐畅科技有限公司 A kind of electronic whiteboard data-sharing systems issued based on subscription information
CN106911593A (en) * 2015-12-23 2017-06-30 中国科学院沈阳自动化研究所 A kind of industrial control network array dispatching method based on SDN frameworks
CN107888499A (en) * 2017-11-17 2018-04-06 北京邮电大学 A kind of distribution subscription system and message forwarding method based on SDN

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0621409D0 (en) * 2006-10-27 2006-12-06 Ibm Access control within a publish/subscribe system
US8135594B2 (en) * 2008-01-16 2012-03-13 International Business Machines Corporation Limiting proxy subscription propagation in a publish/subscribe message broker network
US20100268716A1 (en) * 2009-04-17 2010-10-21 Degaugue Fabien G System and methods of providing interactive expertized communications responses using single and multi-channel site-specific integration
US20130183949A1 (en) * 2012-01-13 2013-07-18 Hotlynx Llc Systems and methods for hosting anonymous virtual phone calls, text (sms) messages, and multi-media (mms) messages
GB2520514A (en) * 2013-11-22 2015-05-27 Ibm Message delivery in a messaging system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377686A (en) * 2010-08-10 2012-03-14 阿里巴巴集团控股有限公司 Message subscription system, method and device
CN106911593A (en) * 2015-12-23 2017-06-30 中国科学院沈阳自动化研究所 A kind of industrial control network array dispatching method based on SDN frameworks
CN106230914A (en) * 2016-07-26 2016-12-14 重庆锐畅科技有限公司 A kind of electronic whiteboard data-sharing systems issued based on subscription information
CN107888499A (en) * 2017-11-17 2018-04-06 北京邮电大学 A kind of distribution subscription system and message forwarding method based on SDN

Also Published As

Publication number Publication date
CN109729154A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
US10715639B2 (en) Data processing method and apparatus for performing protocol parsing in a cloud
CN109981668A (en) Common apparatus Internet of Things communication means based on the extensive agreement of MQTT
CN111031034A (en) Multi-protocol convergence edge computing gateway
CN101300534B (en) Method and system for the transmission of cyclic and acyclic data
CN110049014A (en) A kind of OpenAPI converting system and method based on more Modbus bus protocols
CN105898893B (en) Full-duplex communication method for mobile terminal and Internet of things equipment
CN101667928B (en) Client, signaling tracking server, protocol module and signaling tracking method
CN110535889B (en) Internet of things interaction system
EP3732842B1 (en) Compression context setup for data transmission for iot devices
WO2017076109A1 (en) Software upgrading method and device
CN109729154B (en) Simple message subscription and publishing service method based on controller
CN105190613A (en) Method and apparatus for providing contextual context to a user device
CN104168322A (en) Vehicle-mounted terminal data transmission method, application server, client-side and user terminal
CN111884938B (en) Router information acquisition method and device
CN106130787B (en) Service processing system based on software defined network
EP1624642A3 (en) Apparatus, method and system for providing information in accordance with one of a plurality of protocols
US10869172B2 (en) Management of communication between M2M device and M2M server with finite state transitions created by the M2M device
CN106462146A (en) Field device, method for operating a field device and cloud service
CN111614612B (en) Communication protocol implementation method, device, network management server and storage medium
US11425632B2 (en) Mechanism to provide updates to NB-IoT devices
US20140211658A1 (en) Wireless apparatus and network address report method in zigbee network
CN105263127A (en) Short message communication method and device
CN106648561B (en) Service layer information processing method and device
CN113645108B (en) Intelligent household equipment monitoring system and method
CN109684341B (en) Real-time synchronization system and method for service data

Legal Events

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