A method for processing data of an Internet of Things gateway of a water operation billing device
By using the data processing method of the Internet of Things gateway in water operation billing equipment, the standardization and decoupling of communication between devices is achieved, the communication complexity problem caused by the diversification of equipment brands is solved, the business process development is simplified and the efficiency is improved. System stability.
Patent Information
- Application Number
- CN202210948789.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-08-09
AI Technical Summary
In the field of water operation billing equipment, existing technology lacks unified communication protocols and data format standards, resulting in unstable communication between business systems and IoT devices, increasing development and operation and maintenance costs, and diversified equipment brands make the system complex. change.
Adopt a data processing method based on the Internet of Things gateway to realize data interaction with TCP, UDP, MQTT and other protocols through the network access module. The packet receiving and parsing module obtains the unique identifier of the device, uses the connection handle or HASH as the credential, and defines standard events and data processing. Process, using message queues for data publishing and subscription, to achieve decoupling between business systems and devices.
It achieves communication decoupling between business systems and IoT devices, reduces dependence on hardware knowledge, simplifies business process development, reduces device docking complexity, and improves system stability and reliability.
Smart Images

Figure CN115361447B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet of Things, and in particular to a processing method for performing unified format conversion of communication and message data for various types of water operation billing equipment, for realizing research and development decoupling between a background business system and an embedded device of the Internet of Things. Background Art
[0002] Water operation billing equipment is divided into two types of water meters: hot water for bathing and purified water for direct drinking. It can realize water billing and valve switch control, and is widely used in service hosting scenarios for water consumption in universities, enterprises and institutions.
[0003] In the field of service hosting and operation, the size of the personnel of the client units varies, and the brands of metering equipment used in various projects are relatively complicated. There is no unified industry standard to achieve the standardization of the display interface, operation and use process, and communication protocol of the water meter. In the implementation of the communication protocol, the common ones are TCP and UDP protocols based on the transport layer of the SI seven-layer model, MQTT, CoAP, and HTTP protocols based on the application layer to carry binary data, xml or json format, plain text, etc.; under the current industry demand for cloud computing centralized services, the original method of equipment manufacturers providing their own brand operation platforms for direct use or API docking between platforms has been difficult to meet the actual investment and operation needs due to the high cost and risk in the management and operation process.
[0004] In the water consumption service process, the control of IoT devices is only the most end-to-end service access method for users. Most of the work is concentrated on the online service APP / applet / H5 and the back-end charging and accounting logic. There is a clear distinction in knowledge areas between the development of business systems and embedded systems. It is difficult for back-end business developers to ensure the accuracy, reliability and stability of communication with IoT devices.
[0005] IoT gateway data processing generally includes two layers: lower-layer data access processing and upper-layer external application services, thereby realizing the collection and formatted distribution of the original message data of IoT devices. For water operation billing equipment, since the types of business operations carried are predictable and the types of device message data are limited, it is very suitable for standardization of communication through IoT gateways. Summary of the invention
[0006] Aiming at the diversification of communication data formats and transmission protocols of water operation metering IoT devices, the present invention proposes a set of data standard processing methods based on IoT gateway, so that the business application system does not need to pay attention to the specific equipment brand and model, and realizes the communication decoupling between the business system and the embedded device, thereby reducing the requirements for application system developers to master hardware knowledge and only need to focus on the business process itself.
[0007] In order to achieve the above technical objectives, the present invention adopts an Internet of Things gateway data processing method for water operation billing equipment, which includes the following main steps:
[0008] (1) The network access module realizes the interactive communication of TCP, UDP and MQTT network data transmission and reception;
[0009] (2) The packet receiving and parsing module is responsible for parsing the data message;
[0010] (3) The key point is that the first step of receiving a packet is to obtain the unique identifier of the device. If the first valid data packet sent by the device after the connection is successful does not contain the unique identifier of the device, a command to query device information should be sent to the device first;
[0011] (4) If the communication is carried out through a connected communication protocol, the connection handle is directly mapped to an 8-byte integer as the operation credential for the entire online cycle of this device in the gateway. If the device communicates through a connectionless communication protocol, the unique identifier of the device is processed by 64-bit HASH and mapped to an 8-byte integer, which is convenient for subsequent communication.
[0012] (5) All subsequent operations on the device use the connection handle or non-connection HASH saved in step 3 as the retrieval primary key;
[0013] (6) The processing process of the uplink device message is divided into three sub-standard processes: receiving, immediate feedback, and forwarding. The immediate feedback and forwarding processes are configurable options. The data processing formats of the three processes are pre-defined according to the actual access device conditions. The pre-definition adopts two methods: dynamic language definition and executable binary plug-in.
[0014] (7) Forwarding is used as a data publishing source for business applications. The subscription and publishing methods of message queues are adopted. The business system uses group subscription to consume formatted uplink device data in an undirected manner.
[0015] Furthermore, the processing method supports a maximum number of 12 groups of business data operation types, i.e., standard events, as follows:
[0016] (1) Going online and confirming the launch;
[0017] (2) Offline and offline confirmation;
[0018] (3) Card swiping and card confirmation;
[0019] (4) Pressing buttons and confirming them;
[0020] (5) Heartbeat and heartbeat confirmation;
[0021] (6) Alarm and alarm confirmation;
[0022] (7) Status upload and confirmation;
[0023] (8) Upload and confirm transaction bills;
[0024] (9) Notification of start of remote consumption and expected feedback;
[0025] (10) Notification of the end of remote consumption and expected feedback;
[0026] (11) Remote configuration update notification and expected feedback;
[0027] (12) Remotely query equipment status and expected feedback.
[0028] Furthermore, each connected brand and model of device will be predefined for 12 groups of behaviors, each of which is as follows:
[0029] (1) Whether immediate feedback is required, and if so, its format definition;
[0030] (2) Whether it needs to be formatted and published to the message queue. If it needs to be published, its format definition;
[0031] (3) Whether there is an expected follow-up operation, if so, configure the operation and the timeout re-publishing time if it is not received;
[0032] (4) Data publishing for message queues uses a unified preset format based on a data dictionary to simplify the corresponding processing process of the business background;
[0033] (5) The IoT gateway has a message queue for the business system and subscribes to two topics: the broadcast topic and the topic of the specified gateway instance. Only batch configuration updates, including upgrades and restarts, use the broadcast topic, while the rest use the topic of the specified gateway instance.
[0034] (6) In the IoT gateway, pre-configuration is used to bind the service port to the brand model. Each instance only serves one specific model. The publishing and subscription data in the message queue include the device model. The gateway only determines whether the communication in the current instance is the expected single model.
[0035] The beneficial effects of the present invention are as follows: differences in brands and models of water operation billing equipment result in different communication protocols. When the business platform uses these devices, it is necessary to do the complex work of connecting the devices one by one. Through predefined processing steps and classification operations, a fill-in-the-blank method is used to provide the business platform with a publish-subscribe service based on a message queue. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1Shown is a data processing flow chart of the Internet of Things gateway of the present invention;
[0037] Figure 2 What is shown is a standard event framework diagram of data processing of the Internet of Things gateway of the present invention; DETAILED DESCRIPTION
[0038] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0039] Combination Figure 1 and Figure 2 It can be seen that a method for processing data of an Internet of Things gateway of a water operation billing device is as follows:
[0040] 1. The equipment manufacturer provides the communication protocol;
[0041] 2. Check the protocol to see if it meets the 12 standard events specified in the business data operation categories; these 12 standard events are as follows:
[0042] (1) Going online and confirming the launch;
[0043] (2) Offline and offline confirmation;
[0044] (3) Card swiping and card confirmation;
[0045] (4) Pressing buttons and confirming them;
[0046] (5) Heartbeat and heartbeat confirmation;
[0047] (6) Alarm and alarm confirmation;
[0048] (7) Status upload and confirmation;
[0049] (8) Upload and confirm transaction bills;
[0050] (9) Notification of start of remote consumption and expected feedback;
[0051] (10) Notification of the end of remote consumption and expected feedback;
[0052] (11) Remote configuration update notification and expected feedback;
[0053] (12) Remotely query equipment status and expected feedback;
[0054] At the same time, each connected brand and model device will have 12 groups of behaviors, each of which is predefined as follows:
[0055] (1) Whether immediate feedback is required, and if so, its format definition;
[0056] (2) Whether it needs to be formatted and published to the message queue. If it needs to be published, its format definition;
[0057] (3) Whether there is an expected follow-up operation, if so, configure the operation and the timeout re-publishing time if it is not received;
[0058] (4) Data publishing for message queues uses a unified preset format based on a data dictionary to simplify the corresponding processing process of the business background;
[0059] (5) The IoT gateway has a message queue for the business system and subscribes to two topics: the broadcast topic and the topic of the specified gateway instance. Only batch configuration updates, including upgrades and restarts, use the broadcast topic, while the rest use the topic of the specified gateway instance.
[0060] (6) In the IoT gateway, pre-configuration is used to bind the service port to the brand model. Each instance only serves one specific model. The publishing and subscription data in the message queue include the device model. The gateway only determines whether the communication is the expected single model in the current instance.
[0061] 3. Add the device model and service port used or subscribed topic in the IoT gateway;
[0062] 4. Configure the IoT gateway to determine whether the device needs to provide immediate feedback or forward each of the 12 standard events.
[0063] 5. According to the manufacturer's communication protocol, write the corresponding trigger processing function for 12 types of standard events, or upload the corresponding processing plug-in;
[0064] 6. Configure the connection service address on the device to the address port or topic configured for the IoT gateway in step 3; 7. Power on the device and perform business process testing to see if the data published by the message connection meets expectations. If interaction is required, use the debugging tool to publish downlink messages to the message queue;
[0065] 8. Notify the business platform to conduct business docking.
[0066] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing data of an Internet of Things gateway of a water operation billing device, characterized in that: The main steps are as follows: (1) The network access module realizes the interactive communication of TCP, UDP and MQTT network data transmission and reception; (2) The packet receiving and parsing module is responsible for parsing the data message; (3) The key point is that the first step of receiving a packet is to obtain the unique identifier of the device. If the first valid data packet sent by the device after the connection is successful does not contain the unique identifier of the device, a command to query device information should be sent to the device first; (4) If the communication is carried out through a connected communication protocol, the connection handle is directly mapped to an 8-byte integer as the operation credential for the entire online cycle of this device in the gateway. If the device communicates through a connectionless communication protocol, the unique identifier of the device is processed by 64-bit HASH and mapped to an 8-byte integer, which is convenient for subsequent communication. (5) Subsequent operations on the device are all retrieved using the connection handle or non-connection HASH saved in step 4 as the primary key; (6) The processing process of the uplink device message is divided into three sub-standard processes: receiving, immediate feedback, and forwarding. The immediate feedback and forwarding processes are configurable options. The data processing formats of the three processes are pre-defined according to the actual access device conditions. The pre-definition adopts two methods: dynamic language definition and executable binary plug-in. (7) Forwarding is used as a data publishing source for business applications. The subscription and publishing methods of message queues are adopted. The business system uses group subscription to consume formatted uplink device data in an undirected manner.
2. The method for processing data of an Internet of Things gateway of a water operation billing device according to claim 1, characterized in that: The processing method supports a maximum of 12 groups of business data operation types, i.e., standard events, as follows: (1) Going online and confirming the launch; (2) Offline and offline confirmation; (3) Card swiping and card confirmation; (4) Pressing buttons and confirming them; (5) Heartbeat and heartbeat confirmation; (6) Alarm and alarm confirmation; (7) Status upload and confirmation; (8) Upload and confirm transaction bills; (9) Notification of start of remote consumption and expected feedback; (10) Notification of the end of remote consumption and expected feedback; (11) Remote configuration update notification and expected feedback; (12) Remotely query equipment status and expected feedback.
3. The method for processing data of an Internet of Things gateway of a water operation billing device according to claim 2, characterized in that: Among the 12 groups of behaviors, each group of behaviors is predefined as follows: (1) Whether immediate feedback is required, and if so, its format definition; (2) Whether it needs to be formatted and published to the message queue. If it needs to be published, its format definition; (3) Whether there is an expected follow-up operation, if so, configure the operation and the timeout re-publishing time if it is not received; (4) Data publishing for message queues uses a unified preset format based on a data dictionary to simplify the corresponding processing process of the business background; (5) The IoT gateway has a message queue for the business system and subscribes to two topics: the broadcast topic and the topic of the specified gateway instance. The broadcast topic is used only for batch configuration updates including upgrades and restarts, while the specified gateway instance topic is used for the rest. (6) In the IoT gateway, pre-configuration is used to bind the service port to the brand model, and each instance only serves one specific model.
