CN113542404A - Government affair hall device data exchange method - Google Patents

Government affair hall device data exchange method Download PDF

Info

Publication number
CN113542404A
CN113542404A CN202110793277.4A CN202110793277A CN113542404A CN 113542404 A CN113542404 A CN 113542404A CN 202110793277 A CN202110793277 A CN 202110793277A CN 113542404 A CN113542404 A CN 113542404A
Authority
CN
China
Prior art keywords
data
message
server
notification
application server
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
CN202110793277.4A
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.)
Chaozhou Zhuoshu Big Data Industry Development Co Ltd
Original Assignee
Chaozhou Zhuoshu Big Data Industry Development 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 Chaozhou Zhuoshu Big Data Industry Development Co Ltd filed Critical Chaozhou Zhuoshu Big Data Industry Development Co Ltd
Priority to CN202110793277.4A priority Critical patent/CN113542404A/en
Publication of CN113542404A publication Critical patent/CN113542404A/en
Pending legal-status Critical Current

Links

Images

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/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/2871Implementation details of single intermediate entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the field of government affair service, and particularly provides a data exchange method for a government affair hall device, which is characterized in that a middleware based on an MQTT protocol is used for processing data notification, and the change condition of the data can be notified to related devices by using a publish/subscribe mode of a message queue; the first interaction mode is as follows: reading data from a server side when the equipment initializes the data, opening a network with the server after equipment software is installed, and walking a server gateway program; the second interaction mode is as follows: the device firstly requests the application server, the application server stores the data and issues a theme message to the MQTT server, so that the device can acquire a message notification according to the theme and then pull the stored data from the application server. Compared with the prior art, the method and the system shield the network environment among the devices, do not need communication among the devices any more, and only need to connect the devices into the MQTT server and the application server.

Description

Government affair hall device data exchange method
Technical Field
The invention relates to the field of government affair services, and particularly provides a data exchange method for government affair hall equipment.
Background
The device data exchange of the government affair service hall generally adopts a point-to-point mode, namely a sender directly transmits data to a receiver, and most of the data calculation and storage stay on the device.
Firstly, the network environment of a government affair hall is complex, and a government affair intranet, the internet, a wired network and a wireless network are mixed, so that equipment can be linked in different networks, and the work of opening the network is complex; secondly, the quality of the equipment in the government affair hall is uneven, the computing power of some old equipment is weak, and the response time of some complex business logic cannot keep up with the functional requirements; third, the placement positions of the devices are variable, and the requirements of power-off and power-off may also occur every night, which may cause the network address of the devices to change, configuration information to be lost, and the like, while some placement positions are difficult to be controlled by hands, and the processing of field implementers is difficult.
In the data exchange mode, in order to keep the synchronous update of the data of each device, a long connection or polling request mode is mostly used, but the data does not need to be changed for a long time, so that a large number of idle long connections or invalid polling requests occur, when the data of the devices is large, the idle invalid connections occupy a large amount of resources, the network load is increased, and the response speed of the devices is slowed down.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a data exchange method for government hall equipment with strong practicability.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a data exchange method for government hall devices is characterized in that data notification is processed based on a middleware of an MQTT protocol, and the change condition of data can be notified to related devices by using a publish/subscribe mode of a message queue;
the first interaction mode is as follows: reading data from a server side when the equipment initializes the data, opening a network with the server after equipment software is installed, and walking a server gateway program;
the second interaction mode is as follows: the device firstly requests the application server, the application server stores the data and issues a theme message to the MQTT server, so that the device can acquire a message notification according to the theme and then pull the stored data from the application server.
Furthermore, in the first interaction mode, the device software configuration only needs to configure the address of the server, and then other basic configuration data can be directly pulled from the server, the configuration data are pulled once when the device is started, the configuration data are pulled and updated at intervals of one time, and the pulled basic configuration data are temporarily stored.
Further, in the first interaction mode, after the equipment program is started and networked, the equipment program is registered on the middleware of the MQTT server side, the equipment communicates based on topics message themes, the equipment registers the received message themes and sends a notice with the message themes.
Further, in the first interaction mode, the transmission of the message only carries part of the key data, which is used as a notification, and after the receiver obtains the notification, the receiver uses the HTTP mode to obtain the required data from the server through the API interface.
Furthermore, in the second interaction mode, the device triggering notification firstly passes through the application server, and after the application server carries out complex business logic processing and conversion, the persistent data is stored in the database, and the temporary data is stored in the cache;
then, when the processing structure is returned, the processing result notification is issued, other devices needing the notification receive the notification and then request the application server, the application server processes the data again to obtain the desired data, the data transmission can be decoupled, the interaction between the client and the server is simply changed, the logic association between the devices is not needed, and the development and debugging are performed between the client and the server every time.
Further, in the second interaction mode, when the third party needs to be docked, the third party transmits the data to the application server through the API, and the application server sends the data to the specific equipment through the message;
when equipment needs to be transferred to a third party, the standard of the standard data transmission interface is specified in advance, and the third party only needs to provide a trigger interface according to the standard.
Further, in MQTT, a mechanism of once data compensation in the middle is needed to avoid the problem of data loss, which needs to be compensated according to the service scenario.
Further, when data needs to be displayed on the device for a long time, a timing task needs to be used on the device side to pull the data in batches.
Further, when data with high real-time requirement is received by the device, the device needs to actively trigger the message mechanism again to feed back the success of the acquisition notification, and certainly, the notification process may also have a failure.
Further, after the device sends the trigger message, a timer receiving the feedback is added, and the task of the timer can be ended only after the feedback is received;
if the timer does not receive the feedback, the message needs to be triggered and sent again;
therefore, the target device also needs to add a processing mechanism for repeating the message data, and the message data repeated manually is processed and only processed once, but each time the message is received, the success should be fed back.
Compared with the prior art, the data exchange method for the government hall equipment has the following outstanding beneficial effects:
the data communication route completely shields the network environment between the devices, communication between the devices is not needed, and the devices are only connected into the MQTT server and the application server. Because the MQTT protocol message has the characteristics of low occupied bandwidth, light weight, high reliability and the like, the resource occupied by message transmission is less, and when no message is triggered, the MQTT protocol message does not need to be connected with an application server all the time to acquire the latest data, and the pressure of the application server can be reduced. After correct data compensation measures are added, the accuracy and the timing of data are guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of a government hall device data exchange method;
FIG. 2 is a schematic diagram of a first interaction mode in a government hall device data exchange method;
fig. 3 is a schematic diagram of a second interaction mode in the government hall device data exchange method.
Detailed Description
The present invention will be described in further detail with reference to specific embodiments in order to better understand the technical solutions of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A preferred embodiment is given below:
as shown in fig. 1-3, in the government hall device data exchange method in this embodiment, a middleware based on MQTT (message queue telemetry transport) protocol is added to process data notification, and using the publish/subscribe mode of its message queue, the related device can be notified of data change rapidly.
The data are read from the server side firstly when the equipment initialization data are installed, and after the equipment software is installed, only the network between the equipment software and the server needs to be opened, and the gateway program of the server is moved, so that the security loopholes can be avoided to a great extent. The device software configuration only needs to configure the address of the server, and then other basic configuration data can be directly pulled from the server, and the configuration data can be pulled again at an interval of one hour or even longer after being pulled once when the device is started, because the data is not changed temporarily in general.
The pulled basic configuration data can be temporarily stored without occupying too much hard disk space. Thus, the configuration work can be completely performed by the instructor service terminal, and the equipment does not need to be run for configuration at the time of each change.
After the relevant device programs of the hall are started and networked, the relevant device programs are registered on the middleware of the MQTT server side, and all devices communicate based on topics message themes: the device registers the received message subject and sends a notification with the message subject. And when the receiver acquires the notification, the receiver acquires the required data from the server end through an API (application programming interface) by using modes such as HTTP (hyper text transport protocol) and the like.
As shown in fig. 2, first, a device registers on an MQTT server and subscribes to a topic. The simplest and most direct way when a device wants to notify other devices is to send a subject message interface directly through an MQTT message server, and the other devices can receive the notification. The single MQTT message publishing/subscribing mode is suitable for a simple device notification scene, and simple one-to-one and one-to-many device interaction can be realized; but limited by the lightweight and more complex business scenarios of MQTT, it is most of the time impossible for us to send large amounts of business data through messages. The MQTT component is added to provide reliable network service for the Internet of things equipment in low-bandwidth and unstable network environments, and meanwhile, the requirement on power consumption is far smaller than that of HTTP. The order of the devices can also support millions of clients, which makes more efficient use of hardware resources. Compared with the method of simply using HTTP to carry out communication, the method of using MQTT to receive the notification and using HTTP to pull data can accept resources better, and the pushing is a better solution compared with the polling method.
Another interaction mode is extended on the basis again: the device firstly requests the application server, the application server stores the data and issues a theme message to the MQTT server, so that the device can acquire a message notification according to the theme and then pull the stored data from the application server. This way of application is more elegant and efficient: the device triggering notification firstly passes through the application server, the application server processes and converts complex business logic, then stores the persistent data in the database and temporarily stores the data in the cache, then returns to the processing structure and simultaneously issues the processing result notification, other devices needing the notification receive the notification and then request the application server, and processes the data again through the application server to take the desired data.
As shown in fig. 3, the above is a manner of processing data transmission inside the system, but in many cases, a software system, a hardware device, and the like in a hall may need to be interfaced with other third parties, and at this time, an application server needs to be used as an external path to provide an API interface for calling, and as shown in the following description, the third party transmits data to the application server through the interface, and the application server transmits the data to a specific device through a message. When the device needs to be transferred to the third party, the third party only needs to specify the standard of the standard data transmission interface in advance and provide a trigger interface according to the standard when the third party is dominant.
The method is not without defects in the cooperative application of the MQTT, firstly, point-to-point communication cannot be achieved, the method can be intercepted by an unknown third party, a message does not have user attributes, whether the sending of message data is correct or not cannot be distinguished, if the third party program is successfully registered on the MQTT server, all message data in a system can be monitored without limitation, the message can be sent randomly, the disorder of the system is caused, and therefore the third party access still needs to be safer by using a traditional interface API form.
Secondly, MQTT does not support offline messages, and messages based on MQTT may also have a problem of data loss, so a mechanism of data compensation at one time in the middle is needed, which needs to compensate according to a service scenario, and there are two general cases:
when the data needs to be displayed on the equipment for a long time, the data needs to be pulled in batches by using a timing task at the equipment end so as to achieve the purpose of data compensation.
When data with high real-time requirement is received by the device, in order to ensure that the data is accurately notified to the target device, the device needs to actively trigger the message mechanism again to feed back that the notification is successfully obtained, and certainly, the notification process may also have a failure condition. After the device sends the trigger message, a timer which receives the feedback is added, and the task of the timer can be ended only after the feedback is received. However, if the timer expires and no feedback is received, the sending of the message needs to be triggered again. Therefore, the target device also needs to add a processing mechanism for repeating the message data, and the message data repeated manually is processed and only processed once, but each time the message is received, the success should be fed back.
The above embodiments are only specific ones of the present invention, and the scope of the present invention includes but is not limited to the above embodiments, and any suitable changes or substitutions that are made by a person of ordinary skill in the art and are in accordance with the claims of a government hall device data exchange method of the present invention shall fall within the scope of the present invention.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (10)

1. A data exchange method for government hall devices is characterized in that data notification is processed based on a middleware of an MQTT protocol, and the change condition of the data can be notified to related devices by using a publish/subscribe mode of a message queue;
the first interaction mode is as follows: reading data from a server side when the equipment initializes the data, opening a network with the server after equipment software is installed, and walking a server gateway program;
the second interaction mode is as follows: the device firstly requests the application server, the application server stores the data and issues a theme message to the MQTT server, so that the device can acquire a message notification according to the theme and then pull the stored data from the application server.
2. A government hall device data exchange method according to claim 1, wherein in the first interaction mode, device software configuration only needs to configure the address of the server, and then other basic configuration data can be directly pulled from the server, and when the device is started, the configuration data are pulled once and then pulled and updated at intervals, and the pulled basic configuration data are temporarily stored.
3. A government hall device data exchange method according to claim 2, characterized in that in the first interaction mode, the device program registers on the MQTT server middleware after being powered on and networked, each device communicates based on topics message topic, registers the received message topic, and sends a notification with the message topic.
4. A government hall device data exchange method according to claim 3, characterized in that in the first interaction mode, the transmission of the message only carries part of key data, which is used as a notification, and when the receiver obtains the notification, the HTTP mode is used to obtain the required data from the server side through the API interface.
5. A government hall device data exchange method according to claim 4, characterized in that in the second interaction mode, the device trigger notification first passes through the application server, and after the application server performs the processing and conversion of the complex business logic, the persistent data is stored in the database and the temporary data is stored in the cache;
then, when the processing structure is returned, the processing result notification is issued, other devices needing the notification receive the notification and then request the application server, the application server processes the data again to obtain the desired data, the data transmission can be decoupled, the interaction between the client and the server is simply changed, the logic association between the devices is not needed, and the development and debugging are performed between the client and the server every time.
6. A government hall device data exchange method according to claim 5, characterized in that in the second interaction mode, when a third party needs to be docked, the third party transmits data to the application server through the API interface, and the application server sends the data to a specific device through a message;
when equipment needs to be transferred to a third party, the standard of the standard data transmission interface is specified in advance, and the third party only needs to provide a trigger interface according to the standard.
7. A government hall device data exchange method according to claim 6, wherein in MQTT, a mechanism of data compensation in the middle is needed to avoid the problem of data loss, which needs to be compensated according to the service scene.
8. A government hall device data exchange method according to claim 7, wherein when the data needs to be presented for a long time on the device, the data needs to be pulled in batch by using a timing task on the device side.
9. A government hall device data exchange method according to claim 8, wherein when the real-time requirement is high, the device needs to actively trigger the message mechanism again to feed back the success of the acquisition notification after receiving the data, and the notification process may also fail.
10. A government hall device data exchange method according to claim 9, wherein the device adds a timer which receives feedback after sending the trigger message, and the task of the timer is ended only after receiving feedback;
if the timer does not receive the feedback, the message needs to be triggered and sent again;
therefore, the target device also needs to add a processing mechanism for repeating the message data, and the message data repeated manually is processed and only processed once, but each time the message is received, the success should be fed back.
CN202110793277.4A 2021-07-14 2021-07-14 Government affair hall device data exchange method Pending CN113542404A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110793277.4A CN113542404A (en) 2021-07-14 2021-07-14 Government affair hall device data exchange method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110793277.4A CN113542404A (en) 2021-07-14 2021-07-14 Government affair hall device data exchange method

Publications (1)

Publication Number Publication Date
CN113542404A true CN113542404A (en) 2021-10-22

Family

ID=78127855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110793277.4A Pending CN113542404A (en) 2021-07-14 2021-07-14 Government affair hall device data exchange method

Country Status (1)

Country Link
CN (1) CN113542404A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520806A (en) * 2022-01-21 2022-05-20 特斯联科技集团有限公司 Screen application remote control interaction method and system, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113507498A (en) * 2021-06-02 2021-10-15 浪潮软件股份有限公司 Government affair hall device data exchange method and model

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113507498A (en) * 2021-06-02 2021-10-15 浪潮软件股份有限公司 Government affair hall device data exchange method and model

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520806A (en) * 2022-01-21 2022-05-20 特斯联科技集团有限公司 Screen application remote control interaction method and system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9578081B2 (en) System and method for providing an actively invalidated client-side network resource cache
US8799400B2 (en) System and method for managing multiple queues of non-persistent messages in a networked environment
US9712632B2 (en) Method for receiving data, method for sending data, mobile terminal, and server
US8688822B2 (en) Push e-mail inferred network presence
US20140372516A1 (en) System and method for providing a scalable translation between polling-based clients and connection-based message queues
US11356522B2 (en) Data transmission method, network device, terminal device, and computer readable storage medium
EP1661305B1 (en) Efficient notification of new electronic mail arrival
CN113507498A (en) Government affair hall device data exchange method and model
US20100281169A1 (en) Presence-awareness for wireless devices
CN109040017B (en) Intelligent customer service system based on MQTT and HTTP and implementation method
CN114025002A (en) MQTT information transmission method, system and communication equipment
CN113542404A (en) Government affair hall device data exchange method
US8725856B2 (en) Discovery of network services
US9106596B2 (en) Method and apparatus of configuring a data broadcast service
CN111949302B (en) Method, system and equipment for updating instantaneity of industrial computer management system
EP3920035B1 (en) Message transmission/reception method, communication device, and program
CN113630366A (en) Internet of things equipment access method and system
CN107733979B (en) Data pushing method, server and system
CN107295057B (en) Apparatus for relaying data transmission in SCADA system
CN114025005B (en) Data communication method, system, electronic equipment and storage medium
CN112333237B (en) 5G industrial module and electronic equipment
JP2019040579A (en) Message push system, client device and message push method therefor
CN115051963B (en) Message processing method and device, message queue system and electronic equipment
CN108712476B (en) Method and system for updating data based on push technology
CN116939028A (en) Message pushing method, system, equipment and storage medium

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: 20211022

RJ01 Rejection of invention patent application after publication