CN106656534B - Data communication method and system - Google Patents

Data communication method and system Download PDF

Info

Publication number
CN106656534B
CN106656534B CN201510718516.4A CN201510718516A CN106656534B CN 106656534 B CN106656534 B CN 106656534B CN 201510718516 A CN201510718516 A CN 201510718516A CN 106656534 B CN106656534 B CN 106656534B
Authority
CN
China
Prior art keywords
terminal
message
processing platform
data processing
service data
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
CN201510718516.4A
Other languages
Chinese (zh)
Other versions
CN106656534A (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.)
New Singularity International Technical Development Co ltd
Original Assignee
New Singularity International Technical 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 New Singularity International Technical Development Co ltd filed Critical New Singularity International Technical Development Co ltd
Priority to CN201510718516.4A priority Critical patent/CN106656534B/en
Publication of CN106656534A publication Critical patent/CN106656534A/en
Application granted granted Critical
Publication of CN106656534B publication Critical patent/CN106656534B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a data communication method and a system, wherein in the data communication method, a terminal registers to complete terminal ID configuration and data processing platform address and port number configuration; and interacting interactive messages packaged according to a preset format between the terminal and the data processing platform, wherein the interactive messages comprise management messages and/or service data messages, the terminal sends messages carrying the ID of the terminal to the data processing platform according to the configured address of the data processing platform, the processing platform sends messages to the terminal according to the ID of the terminal, and the terminal selects the connection based on which the interactive messages with the data processing platform are in long connection or short connection according to needs. By the scheme disclosed by the application, unified management of terminal access can be realized, and reasonable allocation of resources can be realized.

Description

Data communication method and system
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data communication method and system.
Background
The mine brings a great amount of mining resources for human beings, and plays an important role in various aspects of work and life of the human beings. However, the environment under the mine is complex, and in mining, in order to guarantee personnel safety, various aspects such as environment safety, communication positioning and the like need to be monitored.
At present, when monitoring a mine, different terminals can provide one set of own system to realize terminal access, and various monitoring data are collected through the terminals.
However, in the research process of the present application, the inventor finds that, in the existing technology for collecting monitoring data, each system is incompatible and becomes a system, which not only wastes manpower and equipment cost, but also is not beneficial to the unified management of terminals and data, and can not realize the intercommunication and interconnection of each system, thereby affecting the reasonable allocation of resources.
Disclosure of Invention
To overcome the problems in the related art, the present invention provides a data communication method and system.
In order to solve the above technical problem, according to a first aspect of an embodiment of the present invention, there is provided a data communication method, including:
the terminal registers to complete the configuration of terminal ID, data processing platform address and port number;
and interacting interactive messages packaged according to a preset format between the terminal and the data processing platform, wherein the interactive messages comprise management messages and/or service data messages, the terminal sends messages carrying the terminal ID of the terminal to the data processing platform according to the configured address of the data processing platform, the processing platform sends messages to the terminal according to the terminal ID of the terminal, and the terminal selects the connection based on which the interactive messages with the data processing platform are in long connection or short connection according to needs.
Preferably, the configuring of the address and the port number of the data processing platform includes configuring a plurality of IP addresses, where the plurality of IP addresses correspond to data channels of a plurality of priority levels;
the interactive message between the terminal and the data processing platform carries a message grade, and the interactive message encapsulated according to a preset format is interacted between the terminal and the data processing platform, and the method comprises the following steps:
and the terminal and the data processing platform select a corresponding data channel with a priority level to bear the interactive message according to the message grade, so that the interactive message is transmitted between the terminal and the data processing platform.
The terminal ID configuration comprises:
the data processing platform inputs terminal information of the terminal, distributes a terminal ID for the terminal, and configures the terminal ID to the terminal when the terminal is installed; or the terminal ID is preset in the terminal when the terminal leaves a factory, and the terminal ID of the terminal is input by the data platform when the terminal is installed.
If the connection selected by the terminal and based on which the interactive message with the data processing platform is based is a short connection, interacting the interactive message encapsulated according to a preset format between the terminal and the data processing platform specifically comprises:
and the terminal exchanges messages with the data processing platform based on the short connection.
If the connection selected by the terminal and based on which the interactive message with the data processing platform is based is a long connection, before the interactive message packaged according to the preset format is interacted between the terminal and the data processing platform, the method further comprises the following steps:
the terminal transmits a connection establishment request message packaged according to a preset format to the data processing platform;
after receiving the connection establishment request message, the data processing platform establishes connection with the terminal and returns a connection establishment response message packaged according to a preset format to the terminal;
if the connection establishment response message indicates that the connection is successful, the terminal starts a work activation state;
and the terminal and the data processing platform interact with the management message and the service data message which are packaged according to a preset format.
If the connection established between the terminal and the data processing platform is a long connection, the data communication method further comprises the following steps:
the terminal sends a heartbeat detection message packaged according to a preset format to the data processing platform and receives a heartbeat detection message response packaged according to the preset format returned by the data processing platform;
and/or the presence of a gas in the gas,
and the terminal sends a connection and disconnection request packaged according to a preset format to the data processing platform, and the data processing platform disconnects the connection according to the received connection and disconnection request.
The message encapsulated according to the preset format comprises a message header and a message body, wherein the message header comprises fields for indicating message version, message type and terminal ID, and the message body comprises a fixed field for indicating message subtype and a content field;
the message type indicates that the message is a management message or a service data message, the message subtype indicates the specific type of the message, and the fields in the message header and the message body are filled according to the specific type of the message.
Preferably, the management message includes a message subtype including: terminal information inquiry request message and response, remote control request message and response, remote upgrading command message and upgrading packet request message; (general purpose of length)
The content field of the message body included in the management message comprises one or more TLV fields;
the interaction between the terminal and the data processing platform of the terminal information query request message and the response specifically comprises:
the data processing platform sends a terminal information query request message to the terminal, wherein a message body of the terminal information query request message comprises one or more parameters of a terminal software version, a terminal hardware version, a terminal manufacturer and a terminal model;
the terminal returns a terminal information query request response;
the terminal and the data processing platform interact the remote control request message and response, and the method specifically comprises the following steps:
the data processing platform sends a remote control request message to the terminal, and parameters carried in a message body of the remote control request message include: indicating one or more items of restarting, uploading service data, reporting the current connection mode and reporting terminal statistical information of the terminal;
the terminal executes corresponding operation according to the parameters carried in the remote control request message and returns a remote control response containing an operation result;
the interaction between the terminal and the data processing platform between the remote upgrade command message and the upgrade package request message specifically includes:
the data processing platform sends a remote upgrade command message to the terminal, and parameters carried in a message body of the remote upgrade command message include: indicating one or more items of version number of the download file, total length of the download file, check value of the download file, release date of the download file, forced download, download protocol of the upgrade mode, IP address and port number of the download upgrade server, user name and password of the download upgrade server and path name of the download upgrade server;
the terminal sends an upgrade package request message to the data processing platform according to the parameters carried by the remote upgrade command message, wherein the message body of the upgrade package request message comprises: upgrading one or more items of a file downloading state, a downloading file reading length and an offset address of a downloading file reading position;
and the terminal returns a remote upgrade notification message to the data processing platform, wherein a message body of the remote upgrade notification message carries a remote upgrade result.
Preferably, the service data message includes: a service data reporting request message and a service data issuing request message;
the interaction between the terminal and the data processing platform for the service data reporting request message specifically includes:
the terminal sends a service data reporting request message to the data processing platform, wherein a message body of the service data reporting request message comprises service data to be reported;
the data processing platform determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data reporting request message, if so, the data processing platform returns a service data reporting response message, the message body of the service data reporting response message comprises one or more TLV fields, and the service data reporting response message is used for indicating a service data reporting result;
the interaction of the service data issuing request message between the terminal and the data processing platform comprises the following steps:
the data processing platform sends a service data issuing request message to the terminal, wherein a message body of the service data issuing request message comprises service data to be issued;
the terminal determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data issuing request message, if so, the terminal returns a service data issuing response message, the message body of the service data issuing response message comprises one or more TLV fields, and the service data issuing response message is used for indicating a service data issuing result.
According to a second aspect of embodiments of the present invention, there is provided a data communication system including: a terminal and a data processing platform, wherein,
the terminal is used for registering the terminal and finishing the configuration of the ID of the terminal and the configuration of the address and the port number of the data processing platform;
and interacting interactive messages packaged according to a preset format between the terminal and the data processing platform, wherein the interactive messages comprise management messages and/or service data messages, the terminal sends messages carrying the terminal ID of the terminal to the data processing platform according to the configured address of the data processing platform, the processing platform sends messages to the terminal according to the terminal ID of the terminal, and the terminal selects the connection based on which the interactive messages with the data processing platform are in long connection or short connection according to needs.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
by the data communication method and the data communication system, unified management of terminal access can be achieved, and reasonable allocation of resources is achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic workflow diagram illustrating a method of data communication according to an exemplary embodiment;
fig. 2 is a schematic diagram illustrating an interaction flow between a terminal and a data processing platform in a data communication method according to an exemplary embodiment;
fig. 3 is a schematic diagram illustrating an interaction flow of disconnection between a terminal and a data processing platform in a data communication method according to an exemplary embodiment;
fig. 4 is a schematic diagram illustrating a heartbeat detection interaction flow between a terminal and a data processing platform in a data communication method according to an exemplary embodiment;
FIG. 5 is a diagram illustrating a format of a message body in a method of data communication, according to an example embodiment;
FIG. 6 is a schematic diagram illustrating interaction of a terminal with the data processing platform in a method of data communication according to an example embodiment;
FIG. 7 is a schematic diagram illustrating the interaction of a terminal with the data processing platform in yet another method of data communication in accordance with an illustrative embodiment;
FIG. 8 is a schematic diagram illustrating the interaction of a terminal with the data processing platform in yet another method of data communication in accordance with an illustrative embodiment;
FIG. 9 is a schematic diagram illustrating the interaction of a terminal with the data processing platform in yet another method of data communication in accordance with an illustrative embodiment;
FIG. 10 is a schematic diagram illustrating the interaction of a terminal with the data processing platform in yet another method of data communication in accordance with an illustrative embodiment;
fig. 11 is a diagram illustrating a format of a connection establishment request message in a method of data communication in accordance with an exemplary embodiment;
fig. 12 is a diagram illustrating a format of a connection establishment response message in a method of data communication in accordance with an exemplary embodiment;
fig. 13 is a diagram illustrating a format of a disconnection request message in a data communication method according to an exemplary embodiment;
fig. 14 is a diagram illustrating a format of a disconnection response message in a data communication method according to an exemplary embodiment;
fig. 15 is a schematic diagram illustrating a format of a heartbeat detection request message in a data communication method according to an exemplary embodiment;
fig. 16 is a schematic diagram illustrating a format of a heartbeat detection response message in a data communication method according to an exemplary embodiment;
fig. 17 is a diagram illustrating a format of a terminal information query request message in a data communication method according to an exemplary embodiment;
fig. 18 is a diagram illustrating a format of a terminal information query response message in a data communication method according to an exemplary embodiment;
fig. 19 is a diagram illustrating a format of a remote control request message in a data communication method according to an exemplary embodiment;
fig. 20 is a diagram illustrating a format of a remote control response message in a data communication method according to an exemplary embodiment;
FIG. 21 is a diagrammatic illustration of a format of a remote upgrade command message in a method of data communication, according to an exemplary embodiment;
FIG. 22 is a diagram illustrating a format of a remote upgrade notification message in a method of data communication, according to an example embodiment;
fig. 23 is a diagram illustrating a format of an upgrade package request message in a method of data communication, according to an example embodiment;
FIG. 24 is a diagram illustrating a format of an upgrade package response message in a method of data communication, according to an illustrative embodiment;
fig. 25 is a schematic diagram illustrating a format of a service data reporting request message in a data communication method according to an exemplary embodiment;
fig. 26 is a schematic diagram illustrating a format of a service data reporting request message in another data communication method according to an exemplary embodiment;
fig. 27 is a schematic diagram illustrating a format of a service data reporting response message in a data communication method according to an exemplary embodiment;
fig. 28 is a schematic diagram illustrating a format of a service data issue request message in a data communication method according to an exemplary embodiment;
fig. 29 is a schematic diagram illustrating a format of a service data issue request message in another data communication method according to an exemplary embodiment;
fig. 30 is a schematic diagram illustrating a format of a service data issuing response message in a data communication method according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
In order to solve the problems that the existing technology for collecting monitoring data is not beneficial to unified management of terminal access and influences reasonable resource distribution, the application discloses a data communication method and a system.
A first embodiment of the present application discloses a data communication method. Referring to the workflow diagram shown in fig. 1, the method comprises the following steps:
and step S11, the terminal registers to complete the configuration of the terminal ID and the configuration of the address and the port number of the data processing platform.
In the field of mine safety production internet of things, a terminal generally refers to equipment which has a communication function and realizes services such as information acquisition, intelligent control or communication and the like in mine safety production internet of things, for example, a methane monitoring terminal, a carbon monoxide monitoring terminal, a wind speed monitoring terminal, a temperature monitoring terminal, a positioning terminal, a power supply terminal, a dustproof terminal, a broadcast terminal, a communication and contact terminal and the like. The data processing platform is used as a service management platform of the mine safety production internet of things and is responsible for management of all devices (such as application systems, mining intelligent terminals and the like) of the system and service data processing (receiving, sending, storing, inquiring, forwarding and the like).
And step S12, interacting the interactive message packaged according to the preset format between the terminal and the data processing platform.
The interactive message comprises a management message and/or a service data message, wherein the terminal sends a message carrying a terminal ID of the terminal to the data processing platform according to a configured data processing platform address, the processing platform sends a message to the terminal according to the terminal ID of the terminal, and the terminal selects a connection based on which the interactive message with the data processing platform is based as a long connection or a short connection according to needs.
The data processing platform supports two connection modes of long connection and short connection, the terminal can select the connection mode according to the type of the terminal or the requirement of interactive information, generally speaking, the terminal which needs to always transmit real-time data online selects the long connection mode, and for the terminal which does not need real-time online, the short connection mode can be selected and the data processing platform can interact information.
In addition, the terminal and the data processing platform can interact with the management message and the service data message which are packaged according to the preset format. Because the management message and the service data message are packaged according to the preset format, the unified management of terminal access is facilitated, the interconnection and intercommunication between the terminal and the data processing platform are realized, the monitoring level is improved, and the reasonable distribution of resources is realized.
If the connection selected by the terminal and based on which the interactive message with the data processing platform is based is a short connection, interacting the interactive message encapsulated according to a preset format between the terminal and the data processing platform specifically comprises:
and the terminal exchanges messages with the data processing platform based on the short connection.
If the connection selected by the terminal and based on which the interactive message with the data processing platform is based is a long connection, before the interactive message packaged according to the preset format is interacted between the terminal and the data processing platform, the method further comprises the following steps:
the terminal transmits a connection establishment request message packaged according to a preset format to the data processing platform;
after receiving the connection establishment request message, the data processing platform establishes connection with the terminal and returns a connection establishment response message packaged according to a preset format to the terminal; the terminal transmits a connection establishment request message packaged according to a preset format to the data processing platform, the data processing platform performs audit verification on the terminal after receiving the connection establishment request message, and if the audit verification is passed, the data processing platform transmits a connection establishment response message to the terminal to indicate that the connection is successful. In this case, the terminal starts the work activation state, and the data processing platform starts to generate the terminal access log, that is, if the connection establishment response message indicates that the connection is successful, the terminal starts the work activation state.
In addition, if the connection fails, the data processing platform does not return a connection establishment response message to the terminal, and the terminal which cannot receive the connection establishment response message is in a deactivated state.
To indicate the connection status, the terminal may indicate the connection status through an indicator light or other means.
The Terminal ID (also called TID, Terminal ID), i.e. the Terminal number, is a unique identifier for managing and identifying the Terminal by the data processing platform. The interactive data packet between the terminal and the data processing platform usually carries the terminal ID, and only the terminal with the legal terminal ID can access the data processing platform and perform service interaction with the data processing platform.
The configuration of the terminal ID includes various modes. In one configuration mode of the terminal ID, the data processing platform inputs terminal information of the terminal, distributes the terminal ID to the terminal and configures the terminal ID to the terminal when the terminal is installed; or, in another mode, the terminal ID is preset in the terminal when the terminal is shipped from a factory, and the data platform enters the terminal ID of the terminal when the terminal is installed.
The terminal ID usually needs to be maintained, which includes the following aspects: the terminal ID needs to be solidified in the terminal hardware and properly stored, and cannot be randomly read, written and damaged by a user; the existing terminal ID cannot be influenced by the operations of upgrading and updating the terminal software version, returning to the factory for maintenance and the like, and the existing serial number cannot be lost and changed; when the terminal is no longer used due to damage or other reasons, the terminal ID and related information allocated to the terminal need to be manually deleted on the data processing platform.
Further, the configuring of the data processing platform address and the port number includes configuring a plurality of IP addresses, where the plurality of IP addresses correspond to data channels of a plurality of priority levels.
The interactive message between the terminal and the data processing platform carries a message grade, and the terminal and the data processing platform interact a management message and a service data message which are packaged according to a preset format, and the method comprises the following steps:
and the terminal and the data processing platform select a corresponding data channel with a priority level to bear the interactive message according to the message grade, so that the interactive message is transmitted between the terminal and the data processing platform.
In order to meet the special requirements of message interaction on the security level, the present application generally supports multiple service levels, for example, the scheme of the present application can generally support 4 priority levels, each priority level identifier should be 0-3, the corresponding priority level is from low to high, and the priority levels are respectively used for transmitting data with different priorities, for example, for alarm data, a channel with a relatively high priority level may be used for transmission to ensure real-time performance and reliability of data transmission, wherein the 4 priority levels correspond to 4 IP addresses of a data processing platform, and a terminal may obtain the IP address through manual configuration or automatic acquisition.
Different addresses of the data processing platform correspond to data channels with different priority levels. If a certain data processing platform provides two data channels according to actual requirements, 2 IP addresses can be configured at the terminal, for example:
Figure BDA0000833703530000081
in this case, services having priority level 0 or 1 are all served by IP1, and services having TA level 2 or 3 are served by IP 2.
The connection establishment response message returned by the data processing platform to the terminal usually includes IP addresses of a preset number of distribution servers. For example, the connection establishment response message typically includes IP addresses of a plurality of (e.g., 4) data processing platforms, and the addresses of the plurality of data processing platforms may include duplicate IP addresses. In this case, after parsing the IP address of the data processing platform included in the connection establishment response message, the terminal selects a data channel corresponding to one IP address from the data channels to perform message interaction according to the type level of the message to be interacted.
By the method, the data channels established between the terminal and the data processing platform can be divided into different priority levels for transmitting messages with different level requirements, for example, for alarm data, the data channel with higher priority level can be selected for transmission, so as to ensure real-time performance and reliability of data transmission.
If the connection established between the terminal and the data processing platform is a long connection, the data communication method further comprises the following steps:
the terminal sends a heartbeat detection message packaged according to a preset format to the data processing platform and receives a heartbeat detection message response packaged according to the preset format returned by the data processing platform; and/or the terminal sends a disconnection request packaged according to a preset format to the data processing platform, and the data processing platform disconnects according to the received disconnection request.
In the long connection mode, referring to the schematic diagram of the connection establishment interaction flow shown in fig. 2, the terminal should support the connection establishment function. When the terminal needs to establish communication connection with the data processing platform, the terminal should send a connection establishment request message to the data processing platform. The connection establishment request message typically includes a terminal software version number, a terminal hardware version number, and other optional parameters.
After the terminal is successfully accessed to the data processing platform, the data processing platform can judge whether the terminal needs to be upgraded, if the terminal needs to be upgraded, the terminal can be prompted to have an upgraded version, and the terminal can initiate upgrading operation or directly enter a working state according to the requirement. When the data processing platform refuses the access request of an illegal terminal, alarm information is generated.
In the present application, a connection establishment interaction flow of a long connection between a terminal and a data processing platform is shown in fig. 2. In the interactive process, the terminal initiates a connection establishment request to the data processing platform; and after the data processing platform checks the terminal, returning a connection establishment response, namely a connection establishment result, to the terminal, wherein if the connection establishment result fails, the data processing platform needs to include a failure reason.
When the connection establishment fails, exception handling operations may be performed.
The terminal side exception handling operation comprises the following steps: the connection establishment request is reinitiated when the non-response of the connection establishment request exceeds 10 seconds, and when the total request time exceeds 30 seconds, the connection establishment request is continuously sent with 30 seconds as a period; after the connection is established, for example, when the connection is in error (for example, data transmission and reception time-out), the connection is disconnected and the connection establishment is reinitiated.
The data processing platform side exception handling operation comprises the following steps: when the message received by the data processing platform is wrong, discarding the message; when the terminal type of the connection establishment request is not supported, the response message comprises a corresponding error code; when the terminal of the connection establishment request is not registered, the response message comprises a corresponding error code; when the terminal version of the connection establishment request is not supported, the response message comprises a corresponding error code; when the connection is in error (such as data or heartbeat reception is overtime), the data processing platform disconnects and generates an alarm.
In the long connection mode, the terminal should support a disconnection function. The disconnection can only be initiated by the terminal, when the terminal does not need the existing connection transmission data any more, a disconnection request is actively initiated to the data processing platform, the data processing platform returns a response to the terminal after receiving the disconnection request, the connection between the terminal and the data processing platform is removed, and a log is recorded.
The data processing platform can also forcibly require the terminal to be disconnected. And after receiving the control request, the terminal actively initiates a disconnection request to the data processing platform.
The disconnection function between the terminal and the data processing platform is generally applicable to, but not limited to, the following application scenarios: when the terminal is restarted, the connection between the terminal and the data processing platform can be disconnected; when the terminal is off-line, the connection between the terminal and the data processing platform can be disconnected; when the terminal is powered off, the connection between the terminal and the data processing platform can be disconnected; the connection can be disconnected with the data processing platform when the terminal has no data transmission requirement except the heartbeat detection message in a long time, and the connection is reestablished with the data processing platform when the terminal needs to transmit data.
When the terminal and the data processing platform are in a communication fault state, the data processing platform can directly judge that the terminal enters a disconnection state.
Fig. 3 shows an interactive process of disconnection between the terminal and the data processing platform. In the interaction process, when the terminal does not need to be connected with the data processing platform, the terminal initiates a connection disconnection request to the data processing platform; and the data processing platform receives and processes the data, returns a disconnection response to the terminal and removes the connection between the terminal and the data processing platform.
In the long connection mode, in order to ensure normal interaction of data between the terminal and the data processing platform, after connection is established, the terminal can periodically send a heartbeat detection request to the data processing platform (the heartbeat period is default to 1 second, the maximum is not more than 10 seconds, the heartbeat period is set at the terminal side, and is reported to the data processing platform in a connection establishment request message, and no heartbeat detection function is indicated when the heartbeat period is no more than 1 second, and no heartbeat detection function is indicated when the heartbeat period is 0), so that the terminal is indicated to be in a normal working state, and the data processing platform returns a response after receiving the.
The heartbeat detection can also be used for detecting the network loop-back time, at this time, the request message is added with the terminal system time stamp, and the heartbeat detection response returns the time stamp.
If the number of times that the terminal cannot continuously receive the heartbeat response message of the data processing platform exceeds 3 times, the terminal and the data processing platform are in a communication fault state, and the terminal can give an alarm through an indicator light and the like and is reconnected. The data processing platform does not receive the heartbeat request message initiated by the terminal for 3 times continuously, which indicates that the terminal sends a fault or the terminal and the data processing platform are possibly in a communication fault state.
Fig. 4 shows a heartbeat detection interaction process between the terminal and the data processing platform.
When heartbeat detection fails, exception handling operations may be performed. The terminal side exception handling operation may include: and when the heartbeat detection request is not responded for 3 times continuously, the connection establishment is initiated again. The data processing platform side exception handling operations may include: when the heartbeat detection request is not received for more than 3 times continuously, the terminal sends a fault, or the terminal and the data processing platform are in a communication fault state, and the data processing platform is disconnected from the terminal.
In the short connection mode, the terminal is in an off-line state at ordinary times, when local data needs to be reported, the terminal can directly send a reporting message without being connected to a data processing platform, and the reporting message carries the on-line time length information of the terminal. The data processing platform can cache the message to be issued and issue the message during the on-line period of the terminal, and the terminal is directly off-line when the on-line time exceeds the on-line time. The mode is suitable for the application of the Internet of things with small data volume and no need of being always on-line.
In the long connection mode, the terminal must be connected to the data processing platform before communication. Multiple data interactions may be performed during a single connection. If there is no data interaction, the terminal may send a heartbeat detection message to maintain the connection, at which point the terminal can both send and receive messages. If the terminal does not transmit the message to the data processing platform any more and needs to be disconnected, the terminal sends a disconnection request to the data processing platform so as to disconnect the connection.
In the application, interactive messages between the terminal and the data processing platform are packaged according to a preset format. The message encapsulated according to the preset format comprises a message header and a message body, wherein the message header comprises fields for indicating the message version, the message type and the terminal ID, and the message body comprises a fixed field for indicating the message subtype and a content field.
The message type indicates that the message is a management message or a service data message, the message subtype indicates the specific type of the message, and the fields in the message header and the message body are filled according to the specific type of the message. In addition, in the present application, a message encapsulated according to a preset format is generally referred to as a TA (Terminal Access) protocol compliant message.
The specific format of the message header is shown in table 1:
table 1 header format of TA protocol
Name of field Version Type TOS Rsvd Sn Len TID
Length of field 2bits 2bits 2bits 2bits 1byte 2bytes 4bytes
Wherein, the definitions of each field are as follows:
(1) version: message protocol version, current version is 1;
(2) type: the message type, 0 represents management data message, 1 represents service data message, and other types are reserved for future use;
(3) TOS: TA service type, 0 represents lowest priority, from low to high, 3 represents highest priority;
(4) rsvd: reserved, currently undefined;
(5) sn: sequence numbers, which are used primarily in the interaction process to confirm that the request and response match. The serial number identifies each message request sent by the sender, and the serial number is returned as it is when the receiver replies to the request. The sender maintains the sequence number (from 0x0000 to 0xFFFF) of the sender, the sequence number of the next message request is automatically circularly increased every time the request is sent, and when the sequence number reaches 0xFFFF, the sequence number of the next message circularly returns to 0x 0000;
(6) len: the length of the message body;
(7) TID: and the terminal ID, namely the terminal number, is used for the data processing platform to identify and manage the unique identifier of the terminal.
In addition, the message body has a variable length, and generally consists of a fixed part and an optional part, and a schematic structural diagram of the message body is shown in fig. 5.
The format and content of the fixed part are defined according to the message type, and represent the instructions to be executed or responded by the message, including connection establishment request/response, connection disconnection request/response, heartbeat detection request/response, terminal information inquiry request/response, service data reporting request/response and the like.
The optional part is in a general TLV format, including 0 to a plurality of fields in a TLV (Tag length value, length, content) format. TLVs are formatted numeric or indefinite-length strings or arrays of bytes used to dynamically extend data and parameters. The specific format of the optional part of the message body is shown in table 2:
table 2 message body format of TA protocol
Name of field Tag Len Value
Length of field 2Bytes 2Bytes Become longer
In the application, management messages of various message subtypes can be interacted between the terminal and the data platform. The management message includes message subtypes including: terminal information inquiry request message and response, remote control request message and response, remote upgrading command message and upgrading packet request message; the content field of the message body included in the management message includes one or more TLV fields.
Referring to the interaction flow diagram shown in fig. 6, the interacting between the terminal and the data processing platform of the terminal information query request message and the response specifically includes:
the data processing platform sends a terminal information query request message to the terminal, wherein a message body of the terminal information query request message comprises one or more parameters of a terminal software version, a terminal hardware version, a terminal manufacturer and a terminal model;
and the terminal returns a terminal information query request response. The terminal information inquiry request response usually contains the specific content of inquiry.
In the application, the data processing platform can be supported to inquire the terminal information. When the data processing platform needs to inquire the terminal information, a terminal information inquiry request can be sent to the terminal to inquire basic information of the terminal, such as the terminal software/hardware version, the terminal manufacturer, the terminal model and the like; the terminal gives a response after receiving the response.
In addition, if the terminal information query message contains a query type which is not supported by the terminal, the terminal does not process the query type and directly reports an error.
Referring to the interaction flow diagram shown in fig. 7, the interacting of the remote control request message and the response between the terminal and the data processing platform specifically includes:
the data processing platform sends a remote control request message to the terminal, and parameters carried in a message body of the remote control request message include: indicating one or more items of restarting, uploading service data, reporting the current connection mode and reporting terminal statistical information of the terminal;
and the terminal executes corresponding operation according to the parameters carried in the remote control request message and returns a remote control response containing an operation result.
In the application, the data processing platform can be supported to remotely control the terminal, including operations of controlling the terminal to restart, immediately reporting the service data and the like. The terminal receives the request of the data processing platform to trigger the corresponding operation and returns the operation result in the response message.
In addition, the interacting between the terminal and the data processing platform of the remote upgrade command message and the upgrade package request message specifically includes:
the data processing platform sends a remote upgrade command message to the terminal, and parameters carried in a message body of the remote upgrade command message include: indicating one or more items of version number of the download file, total length of the download file, check value of the download file, release date of the download file, forced download, download protocol of the upgrade mode, IP address and port number of the download upgrade server, user name and password of the download upgrade server and path name of the download upgrade server;
the terminal sends an upgrade package request message to the data processing platform according to the parameters carried by the remote upgrade command message, wherein the message body of the upgrade package request message comprises: upgrading one or more items of a file downloading state, a downloading file reading length and an offset address of a downloading file reading position;
and the terminal returns a remote upgrade notification message to the data processing platform, wherein a message body of the remote upgrade notification message carries a remote upgrade result.
In the application, the remote upgrading function of the terminal software can be supported. The upgrading process of the data processing platform to the terminal software comprises the following steps: the data processing platform sends a terminal remote upgrading command message to the terminal and starts an upgrading process; the terminal can send an upgrade package request message according to the requirement to carry out upgrade operation, wherein the upgrade package request message comprises the size of the upgrade package blocks of the request and can be determined according to the terminal capability; the data processing platform returns an upgrade package block not exceeding the required size to the terminal, and the upgrade package can be obtained in a multi-request mode; and the terminal upgrades according to the acquired upgrade package, returns an upgrade result notice after the upgrade is finished and informs the data processing platform whether the upgrade is successful or not.
Referring to the interaction flow diagram shown in fig. 8, in the upgrade process, the interaction flow between the terminal and the data processing platform is described as follows:
(1) the data processing platform sends a remote upgrading command to the terminal, and the message usually contains information such as the version number of the downloaded file, the total length of the downloaded file, verification and the like;
(2) after receiving the upgrade command message, the terminal initiates an upgrade package request (0) to the data processing platform, wherein the message usually contains the download file reading length (the size of a single download file block which can be received by the terminal can be determined according to the terminal capability), the offset address of the download file reading position and the like;
(3) after receiving the upgrade package request message (0), the data processing platform returns an upgrade package return message (0) to the terminal, and the size of the returned download file is smaller than or equal to the size of a single download file block required by the terminal;
(4) the terminal sends an upgrade package request message (1) to the data processing platform for the second time, wherein the message comprises the size of a single download file block which can be received by the terminal, an offset address of a read position of the download file and the like;
(5) after receiving the upgrade package request message (1), the data processing platform returns an upgrade package return message (1) to the terminal for the second time, and the size of the returned download file is smaller than or equal to the size of a single download file block required by the terminal;
(6) and so on;
(7) after the terminal receives the complete download file, the download file is verified, and the terminal software is upgraded after the verification is passed. (ii) a
And after the terminal finishes upgrading, the terminal returns an upgrading result notification message to the data processing platform to inform the upgrading result, and the upgrading is finished.
When the terminal upgrade fails, an exception handling operation should be performed.
The exception handling operations may include: the data processing platform sends a remote upgrading command, and does not receive an upgrading request packet for more than 3 seconds to reinitiate an upgrading request, and reports an upgrading failure notice after 3 times of continuous failures; or after receiving the upgrade request packet, the data processing platform starts to wait for timing, and terminates the upgrade process after exceeding the time; or, when the upgrade request packet received by the data processing platform is discontinuous, the upgrade process is terminated; or, the terminal side sets a time-out interval, if the service data reporting response returned by the data processing platform is not received in the interval, the retransmission is initiated, if the response cannot be received for 3 times continuously, the upgrading process is terminated, and an upgrading result notification is sent.
In this application, the interaction of the service data message can be performed between the terminal and the data processing platform, and the service data message includes: a service data reporting request message and a service data issuing request message.
According to the method and the device, the service data reporting function can be supported on the basis of establishing the connection between the terminal and the data processing platform. The service data in the mine safety field mainly refers to data for realizing service functions of various systems in the safety production field of mines, such as: monitoring and controlling service data, which mainly comprises monitoring data, alarm data and the like; the positioning service data mainly comprises positioning signal data, alarm data and the like.
In the field of mine safety, business data includes: traffic data and other traffic data. Other service data generally refers to service flow data that is transparent, not or not understood by the data processing platform, which only performs route forwarding.
The service data reporting supports two modes, in the mode 1, the service data reporting needs corresponding response message confirmation. In mode 2, the service data reporting does not require a corresponding response message confirmation, and it should be noted that the terminal and the data processing platform belong to a short connection mode at this time.
If the interaction mode between the terminal and the data processing platform is mode 1, referring to the interaction flow diagram shown in fig. 9, the interacting between the terminal and the data processing platform of the service data reporting request message specifically includes:
the terminal sends a service data reporting request message to the data processing platform, wherein a message body of the service data reporting request message comprises service data to be reported;
and the data processing platform determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data reporting request message, if so, the data processing platform returns a service data reporting response message, the message body of the service data reporting response message comprises one or more TLV fields, and the service data reporting response message is used for indicating a service data reporting result. If the reporting fails, the response message may further include a reason for the failure of reporting the service data.
And when the reporting of the service data fails, executing exception handling operation.
The exception handling operations may include: setting a timeout interval on a terminal side, and if a service data report response returned by a data processing platform is not received in the interval, initiating retransmission; or if the retransmission fails, the terminal initiates disconnection or sends an alarm.
In the application, on the basis of realizing the establishment of the connection between the terminal and the data processing platform, the service data issuing function should be supported. The service data mainly refers to data for realizing service functions of various systems in the safety production field of mines in the mine safety field, and the service data comprises: service data, other service data. Other service data generally refers to service flow data that is transparent, not or not understood by the data processing platform, which only performs route forwarding.
Service data issuing supports two modes. In mode 1, service data is issued with a response message confirmation that is required; in the mode 2, the service data is delivered without the corresponding response message confirmation, and it should be noted that at this time, the terminal and the data processing platform belong to a short connection mode.
If the interaction mode between the terminal and the data processing platform is mode 1, referring to the interaction flow diagram shown in fig. 10, the step of the terminal and the data processing platform interacting the service data issuing request message includes:
the data processing platform sends a service data issuing request message to the terminal, wherein a message body of the service data issuing request message comprises service data to be issued;
the terminal determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data issuing request message, if so, the terminal returns a service data issuing response message, the message body of the service data issuing response message comprises one or more TLV fields, and the service data issuing response message is used for indicating a service data issuing result.
And when the service data is failed to be issued, exception handling operation can be executed.
The exception handling operations may include: when the interaction mechanism is in a mode 1, setting a timeout interval on the data processing platform side, and if a service data issuing response returned by the terminal is not received in the interval, initiating retransmission; or if the retransmission fails, an alarm is sent out in the data processing platform.
In the application, the functions of terminal access, service data bearing, terminal management and the like are realized between the terminal and the data processing platform according to a uniform message format. The method comprises the following steps: a connection establishment request/response message, a connection disconnection request/response message, a heartbeat detection request/response message, a terminal information query request/response message, a remote control request/response message, a remote upgrade command/notification message, a service data reporting request/response message, a service data issuing request/response message, and the like. Wherein, the message header of each message adopts a uniform definition.
In the present application, the connection establishment request message is used for the terminal to initiate a connection establishment request to the data processing platform, and a format of the connection establishment request message is shown in fig. 11.
If the connection establishment request message is a management message, the message type in the message header is represented by 0. In addition, the fixed part in the message body is a message subtype, and the connection establishment request message is represented by 0x 01. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of the terminal, such as terminal software version, terminal hardware version, terminal manufacturer,
Heart beat interval, etc. Wherein, the definition of Tag field is shown in table 3:
table 3 connection establishment request message body Tag definition
Figure BDA0000833703530000161
A connection establishment response message, configured to be returned by the data processing platform to the terminal, where a format of the connection establishment response message is as shown in fig. 12:
and if the connection establishment response message is a management message, the message type in the message header is represented by 0. In addition, the fixed part in the message body is a message subtype, and a connection establishment response message is denoted by 0x 02. The optional part is composed of 1 to a plurality of TLV groups for describing the connection establishment result. Wherein, the definition of Tag field is shown in table 4:
table 4 connection setup response message body Tag definition
Figure BDA0000833703530000171
A disconnection request message, configured to initiate a disconnection request to the data processing platform by the terminal, where a format of the disconnection request message is as shown in fig. 13:
if the disconnection request message is a management message, the message type in the message header is represented by 0. In addition, the fixed part in the message body is a message subtype, and the disconnection request message is represented by 0x 03. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of disconnection, such as disconnection reasons. Wherein, the definition of Tag field is shown in table 5:
table 5 disconnect request message body Tag definition
Figure BDA0000833703530000172
A disconnection response message, configured to be used by the data processing platform to return a disconnection response to the terminal, where a format of the disconnection response message is as shown in fig. 14.
And if the disconnection response message is a management message, the message type in the message header is represented by 0. In addition, only a fixed part of the message body is a message subtype, and the disconnection response message is represented by 0x 04. Wherein, the definition of Tag field is shown in table 6.
A heartbeat detection request message, configured to initiate a heartbeat detection request to the data processing platform by the terminal, where a format of the heartbeat detection request message is shown in fig. 15.
And if the heartbeat detection request message is a management message, the message type in the message header is represented by 0. In addition, the fixed part in the message body is a message subtype, and the heartbeat detection request message is denoted by 0x 05. The optional part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of heartbeat detection, such as current system time and the like. Wherein, the definition of Tag field is shown in table 6:
table 6 heartbeat detection request message body Tag definition
Figure BDA0000833703530000181
A heartbeat detection response message, configured to be used by the data processing platform to return a heartbeat detection response to the terminal, where a format of the heartbeat detection response message is shown in fig. 16.
And if the heartbeat detection request message is a management message, the message type in the message header is represented by 0. In addition, the fixed part in the message body is a message subtype, and the heartbeat detection response message is represented by 0x 06. The optional part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of heartbeat detection, such as current system time and the like. Wherein, the definition of Tag field is shown in table 7:
TABLE 7 Heartbeat detection response message body Tag definition
Figure BDA0000833703530000182
A terminal information query request message, configured to send a terminal information query request to a terminal by a data processing platform, where a format of the terminal information query request message is shown in fig. 17.
And if the terminal information query request message is a management message, the message type in the message header is represented by 0. In addition, the first and second substrates are,
in the message body, the fixed part is a message subtype, and the terminal information query request message is represented by 0x 07. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing query type results, such as basic information of a query terminal. Wherein, the definition of Tag field is shown in table 8:
table 8 terminal information query request message body Tag definition
Tag field Data type Data length Tag description
0x3001 U8
1 byte Inquiring basic information of terminal
And a terminal information query response message, configured to return a query response to the data processing platform by the terminal, where a format of the terminal information query response message is shown in fig. 18.
And if the terminal information inquiry response message is a management message, the message type in the message header is represented by 0. In addition, the first and second substrates are,
in the message body, the fixed part is a message subtype, and the terminal information query response message is represented by 0x 08. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing query results, such as terminal software version, terminal hardware version, terminal manufacturer and other terminal basic information. Wherein, the definition of Tag field is shown in table 9:
TABLE 9 terminal info query response message body Tag definition
Tag field Data type Data length Tag description
0x3002 String Length of indefinite length Terminal software version number
0x3003 String Length of indefinite length Terminal hardware version number
0x3004 String Length of indefinite length Terminal manufacturer
0x3005 String Length of indefinite length Terminal model
A remote control request message, configured to initiate a remote control instruction to the terminal by the data processing platform, where a format of the remote control request message is shown in fig. 19.
If the remote control request message is a management message, the message type in the message header is represented by 0. In addition, in the message body, the fixed part is a message subtype, and the remote control request message is denoted by 0x 09. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of the control terminal, such as restarting, reporting service data, restoring factory settings and the like. Wherein, the definition of Tag field is shown in table 10:
TABLE 10 remote control request message body Tag definition
Figure BDA0000833703530000191
And a remote control response message, configured to return a remote control response to the data processing platform by the terminal, where a format of the remote control response message is shown in fig. 20.
If the remote control response message is a management message, the message type in the message header is represented by 0. In addition, in the message body, the fixed part is a message subtype, and the remote control response message is represented by 0x 0A. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing the remote control execution result. Wherein, the definition of Tag field is shown in table 11:
TABLE 11 remote control response message body Tag definition
Figure BDA0000833703530000201
A remote upgrade command message, configured to initiate a remote upgrade instruction to the terminal by the data processing platform, where a format of the remote upgrade command message is shown in fig. 21.
And if the remote upgrade command message is a management message, the message type in the message header is represented by 0. In addition, in the message body, the fixed part is a message subtype, and a remote upgrade command message is represented by 0x 0B. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of remote upgrading, such as version number of a downloaded file, total length of the downloaded file and the like. Wherein, the definition of Tag field is shown in table 12:
TABLE 12 remote upgrade Command message body Tag definition
Figure BDA0000833703530000211
And a remote upgrade notification message, configured to return a remote upgrade result to the data processing platform by the terminal, where a format of the remote upgrade notification message is shown in fig. 22.
And if the remote upgrade notification message is a management message, the message type in the message header is represented by 0. In addition, in the message body, the fixed part is a message subtype, and the remote upgrade notification message is represented by 0x 0C. The selectable part is composed of 1 to a plurality of TLV groups and is used for describing relevant parameters of remote upgrading results. Wherein, the definition of Tag field is shown in table 13:
TABLE 13 remote upgrade Notification message body Tag definition
Figure BDA0000833703530000221
An upgrade package request message, configured to initiate an upgrade package request to the data processing platform by the terminal, where a format of the upgrade package request message is shown in fig. 23.
And if the upgrade package request message is a management message, the message type in the message header is represented by 0. In addition, in the message body, the fixed part includes a message subtype, an upgrade file download status, a download file read length, and an offset address of a download file read position, and the message subtype indicates an upgrade package request message by 0x 0D. Wherein, the definition of part of the fields is shown in table 14:
table 14 upgrade package request message body part field definitions
Figure BDA0000833703530000222
And an upgrade package response message, configured to return an upgrade package response to the terminal by the data processing platform, where a format of the upgrade package response message is shown in fig. 24.
And if the upgrade package response message is a management message, the message type in the message header is represented by 0. In addition, in the message body, the fixed part comprises a message subtype, a response state of the data processing platform to the terminal file downloading request, an actual file downloading reading length, an offset address of an actual file downloading reading position and a file downloading data block, wherein the message subtype represents an upgrade package response message by 0x 0E. Wherein, the definition of partial fields is shown in table 15:
table 15 upgrade package response message body part field definitions
Figure BDA0000833703530000231
And the service data reporting request message is used for the terminal to send a service data reporting request to the data processing platform, and the message type is represented by 1 if the service data reporting request message is a service message. The format of the service data report request (acknowledgement required) message is shown in fig. 25, and the format of the service data report request (acknowledgement not required) message is shown in fig. 26.
A service data reporting response message, configured to be used by the data processing platform to return a service data reporting response to the terminal, where a format of the service data reporting response message is shown in fig. 27.
And if the service data reporting response message is a service message, the message type is represented by 1. In addition, in the body of the message,
the fixed part is a message subtype, and the service data reporting response message is represented by 0x 02. The optional part is composed of 1 to a plurality of TLV groups and is used for describing the reporting result of the service data. Wherein, the definition of part of the fields is shown in table 16:
table 16 service data reporting response message body Tag definition
Figure BDA0000833703530000232
And the service data issuing request message is used for sending a service data issuing request to the terminal by the data processing platform. The format of the service data issue request (acknowledgement required) message is shown in fig. 28, and the format of the service data issue request (acknowledgement not required) message is shown in fig. 29.
In the message header of the service data issue request message, if the service data issue request message is a service message, the message type is represented by 1. In the message body, the fixed part is a message subtype and service data, when the message subtype is 0x05, the message indicates that the service data issues a request message, and the message needs to be returned by a receiver; when the message type is the message subtype of 0x07, the message indicates that the service data issue request message does not need the receiver to return a response; when the message type is when the message subtype is 0x08, it indicates that other service data issue request message, and the message does not need the receiver to return response.
A service data issuing response message, configured to be used by the terminal to return a service data issuing response to the data processing platform, where a format of the service data issuing response message is shown in fig. 30.
And if the service data issuing response message is a service message, the message type is represented by 1. In addition, the fixed part in the message body is a message subtype, and the service data issuing response message is represented by 0x 06. The optional part is composed of 1 to a plurality of TLV groups and is used for describing the service data issuing result. Wherein, the definition of part of the fields is shown in table 17:
table 17 service data issue response message body Tag definition
Figure BDA0000833703530000241
Through the above data communication method disclosed in the present application, it can be seen that the subtype of the management message is shown in table 18:
table 18 service data reporting response message body Tag definition
SubType Managing message subtype specification
0x01 Connection establishment request message
0x02 Connection establishment response message
0x03 Connection disconnection request message
0x04 Connection disconnect response message
0x05 Heartbeat detection request message
0x06 Heartbeat detection response message
0x07 Terminal information inquiry request message
0x08 Terminal information inquiry response message
0x09 Remote control request message
0x0A Remote control response message
0x0B Remote upgrade command message
0x0C Remote upgrade notification messages
0x0D Upgrade package request message
0x0E Upgrade package response message
In addition, the subtype of the service data message is shown in table 19:
TABLE 19 traffic data message subtype
SubType Traffic data message subtype specification
0x01 Service data reporting request message (need to confirm)
0x02 Service data reporting response message
0x03 Service data reporting request message (without acknowledgement)
0x04 Other service data reporting request message (without acknowledgement)
0x05 Service data issuing request message (need to confirm)
0x06 Service data issuing response message
0x07 Service data issuing request message (without acknowledgement)
0x08 Other service data issuing request message (without acknowledgement)
In addition, the TLV format specification is shown in Table 20:
TABLE 20 Business data message subtypes
Figure BDA0000833703530000251
Accordingly, the present application also discloses a data communication system, comprising: a terminal and a data processing platform, wherein,
the terminal is used for registering the terminal and finishing the configuration of the ID of the terminal and the configuration of the address and the port number of the data processing platform;
interactive messages packaged according to a preset format are interacted between the terminal and the data processing platform, wherein the interactive messages comprise management messages and/or service data messages, the terminal sends messages carrying the terminal ID of the terminal to the data processing platform according to the configured address of the data processing platform, and the processing platform sends messages to the terminal according to the terminal ID of the terminal;
the terminal is also used for selecting the connection based on which the interactive message with the data processing platform is based as long connection or short connection according to the requirement.
The configuration of the address and the port number of the data processing platform comprises the configuration of a plurality of IP addresses, and the plurality of IP addresses correspond to data channels with a plurality of priority levels;
the interactive message between the terminal and the data processing platform carries a message grade, and the interactive message encapsulated according to a preset format is interacted between the terminal and the data processing platform, and the method comprises the following steps:
and the terminal and the data processing platform select a corresponding data channel with a priority level to bear the interactive message according to the message grade, so that the interactive message is transmitted between the terminal and the data processing platform.
The terminal ID configuration comprises:
the data processing platform inputs terminal information of the terminal, allocates a terminal ID (identity) for the terminal, namely a terminal number, and configures the terminal ID to the terminal when the terminal is installed, or;
the terminal ID is preset in the terminal when the terminal leaves a factory, and the terminal ID of the terminal is input by the data platform when the terminal is installed.
If the connection selected by the terminal and based on which the interactive message with the data processing platform is based is a short connection, interacting the interactive message encapsulated according to a preset format between the terminal and the data processing platform specifically comprises:
and the terminal exchanges messages with the data processing platform based on the short connection.
If the connection established between the terminal and the data processing platform is a long connection, the data communication method further comprises the following steps:
the terminal sends a heartbeat detection message packaged according to a preset format to the data processing platform and receives a heartbeat detection message response packaged according to the preset format returned by the data processing platform;
and/or the presence of a gas in the gas,
and the terminal sends a connection and disconnection request packaged according to a preset format to the data processing platform, and the data processing platform disconnects the connection according to the received connection and disconnection request.
Further, the message encapsulated according to the preset format comprises a message header and a message body, wherein the message header comprises fields indicating the message version, the message type and the terminal ID, and the message body comprises a fixed field indicating the message subtype and a content field;
the message type indicates that the message is a management message or a service data message, the message subtype indicates the specific type of the message, and the fields in the message header and the message body are filled according to the specific type of the message.
Further, the management message includes a message subtype including: terminal information inquiry request message and response, remote control request message and response, remote upgrading command message and upgrading packet request message;
the content field of the message body included in the management message comprises one or more TLV fields;
the interaction between the terminal and the data processing platform of the terminal information query request message and the response specifically comprises:
the data processing platform sends a terminal information query request message to the terminal, wherein a message body of the terminal information query request message comprises one or more parameters of a terminal software version, a terminal hardware version, a terminal manufacturer and a terminal model;
the terminal returns a terminal information query request response;
the terminal and the data processing platform interact the remote control request message and response, and the method specifically comprises the following steps:
the data processing platform sends a remote control request message to the terminal, and parameters carried in a message body of the remote control request message include: indicating one or more items of restarting, uploading service data, reporting the current connection mode and reporting terminal statistical information of the terminal;
the terminal executes corresponding operation according to the parameters carried in the remote control request message and returns a remote control response containing an operation result;
the interaction between the terminal and the data processing platform between the remote upgrade command message and the upgrade package request message specifically includes:
the data processing platform sends a remote upgrade command message to the terminal, and parameters carried in a message body of the remote upgrade command message include: indicating one or more items of version number of the download file, total length of the download file, check value of the download file, release date of the download file, forced download, download protocol of the upgrade mode, IP address and port number of the download upgrade server, user name and password of the download upgrade server and path name of the download upgrade server;
the terminal sends an upgrade package request message to the data processing platform according to the parameters carried by the remote upgrade command message, wherein the message body of the upgrade package request message comprises: upgrading one or more items of a file downloading state, a downloading file reading length and an offset address of a downloading file reading position;
and the terminal returns a remote upgrade notification message to the data processing platform, wherein a message body of the remote upgrade notification message carries a remote upgrade result.
Further, the service data message includes: a service data reporting request message and a service data issuing request message;
the interaction between the terminal and the data processing platform for the service data reporting request message specifically includes:
the terminal sends a service data reporting request message to the data processing platform, wherein a message body of the service data reporting request message comprises service data to be reported;
the data processing platform determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data reporting request message, if so, the data processing platform returns a service data reporting response message, the message body of the service data reporting response message comprises one or more TLV fields, and the service data reporting response message is used for indicating a service data reporting result;
the interaction of the service data issuing request message between the terminal and the data processing platform comprises the following steps:
the data processing platform sends a service data issuing request message to the terminal, wherein a message body of the service data issuing request message comprises service data to be issued;
the terminal determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data issuing request message, if so, the terminal returns a service data issuing response message, the message body of the service data issuing response message comprises one or more TLV fields, and the service data issuing response message is used for indicating a service data issuing result.
By the system, unified management of terminal access can be realized, and reasonable allocation of resources can be realized.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A method of data communication, comprising:
the terminal registers to complete the configuration of terminal ID, data processing platform address and port number;
interactive messages packaged according to a preset format are interacted between the terminal and the data processing platform, the interactive messages comprise management messages and/or service data messages, the terminal sends messages carrying terminal ID of the terminal to the data processing platform according to configured data processing platform addresses, the data processing platform sends messages to the terminal according to the terminal ID of the terminal, and the terminal selects connection based on which the interactive messages with the data processing platform are in long connection or short connection according to needs;
wherein the management message comprises a message subtype comprising: terminal information inquiry request message and response, remote control request message and response, remote upgrading command message and upgrading packet request message;
the service data message includes: a service data reporting request message and a service data issuing request message;
the interaction between the terminal and the data processing platform of the service data reporting request message specifically includes:
the terminal sends a service data reporting request message to the data processing platform, wherein a message body of the service data reporting request message comprises service data to be reported;
the data processing platform determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data reporting request message, if so, the data processing platform returns a service data reporting response message, the message body of the service data reporting response message comprises one or more TLV fields, and the service data reporting response message is used for indicating a service data reporting result;
the interaction of the service data issuing request message between the terminal and the data processing platform comprises the following steps:
the data processing platform sends a service data issuing request message to the terminal, wherein a message body of the service data issuing request message comprises service data to be issued;
the terminal determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data issuing request message, if so, the terminal returns a service data issuing response message, the message body of the service data issuing response message comprises one or more TLV fields, and the service data issuing response message is used for indicating a service data issuing result.
2. The method of claim 1, wherein the configuring of the data processing platform address and port number comprises configuring a plurality of IP addresses, wherein the plurality of IP addresses correspond to data channels of a plurality of priority levels;
the interactive message between the terminal and the data processing platform carries a message grade, and the interactive message encapsulated according to a preset format is interacted between the terminal and the data processing platform, and the method comprises the following steps:
and the terminal and the data processing platform select a corresponding data channel with a priority level to bear the interactive message according to the message grade, so that the interactive message is transmitted between the terminal and the data processing platform.
3. The method of claim 1, wherein the terminal ID configuration comprises:
the data processing platform inputs terminal information of the terminal, distributes a terminal ID for the terminal, and configures the terminal ID to the terminal when the terminal is installed;
alternatively, the first and second electrodes may be,
the terminal ID is preset in the terminal when the terminal leaves a factory, and the terminal ID of the terminal is input by the data platform when the terminal is installed.
4. The method according to claim 1, wherein if the connection selected by the terminal and based on which the interactive message with the data processing platform is based is a short connection, interacting the interactive message encapsulated according to a preset format between the terminal and the data processing platform specifically comprises:
and the terminal exchanges messages with the data processing platform based on the short connection.
5. The method according to claim 1, wherein if the connection selected by the terminal based on which the interactive message with the data processing platform is based is a long connection, before interacting the interactive message encapsulated according to a preset format between the terminal and the data processing platform, further comprising:
the terminal transmits a connection establishment request message packaged according to a preset format to the data processing platform;
after receiving the connection establishment request message, the data processing platform establishes connection with the terminal and returns a connection establishment response message packaged according to a preset format to the terminal;
and if the connection establishment response message indicates that the connection is successful, the terminal starts a working activation state.
6. The method according to claim 5, wherein if the connection established between the terminal and the data processing platform is a long connection, the data communication method further comprises:
the terminal sends a heartbeat detection message packaged according to a preset format to the data processing platform and receives a heartbeat detection message response packaged according to the preset format returned by the data processing platform;
and/or the presence of a gas in the gas,
and the terminal sends a connection and disconnection request packaged according to a preset format to the data processing platform, and the data processing platform disconnects the connection according to the received connection and disconnection request.
7. The method of claim 1,
the message encapsulated according to the preset format comprises a message header and a message body, wherein the message header comprises fields for indicating message version, message type and terminal ID, and the message body comprises a fixed field for indicating message subtype and a content field;
the message type indicates that the message is a management message or a service data message, the message subtype indicates the specific type of the message, and the fields in the message header and the message body are filled according to the specific type of the message.
8. The method of claim 1,
the content field of the message body included in the management message comprises one or more TLV fields;
the interaction between the terminal and the data processing platform of the terminal information query request message and the response specifically comprises:
the data processing platform sends a terminal information query request message to the terminal, wherein a message body of the terminal information query request message comprises one or more parameters of a terminal software version, a terminal hardware version, a terminal manufacturer and a terminal model;
the terminal returns a terminal information query request response;
the terminal and the data processing platform interact the remote control request message and response, and the method specifically comprises the following steps:
the data processing platform sends a remote control request message to the terminal, and parameters carried in a message body of the remote control request message include: indicating one or more items of restarting, uploading service data, reporting the current connection mode and reporting terminal statistical information of the terminal;
the terminal executes corresponding operation according to the parameters carried in the remote control request message and returns a remote control response containing an operation result;
the interaction between the terminal and the data processing platform between the remote upgrade command message and the upgrade package request message specifically includes:
the data processing platform sends a remote upgrade command message to the terminal, and parameters carried in a message body of the remote upgrade command message include: indicating one or more items of version number of the download file, total length of the download file, check value of the download file, release date of the download file, forced download, download protocol of the upgrade mode, IP address and port number of the download upgrade server, user name and password of the download upgrade server and path name of the download upgrade server;
the terminal sends an upgrade package request message to the data processing platform according to the parameters carried by the remote upgrade command message, wherein the message body of the upgrade package request message comprises: upgrading one or more items of a file downloading state, a downloading file reading length and an offset address of a downloading file reading position;
and the terminal returns a remote upgrade notification message to the data processing platform, wherein a message body of the remote upgrade notification message carries a remote upgrade result.
9. A data communication system, comprising: a terminal and a data processing platform, wherein,
the terminal is used for registering the terminal and finishing the configuration of the ID of the terminal and the configuration of the address and the port number of the data processing platform;
interactive messages packaged according to a preset format are interacted between the terminal and the data processing platform, the interactive messages comprise management messages and/or service data messages, the terminal sends messages carrying terminal ID of the terminal to the data processing platform according to configured data processing platform addresses, the data processing platform sends messages to the terminal according to the terminal ID of the terminal, and the terminal selects connection based on which the interactive messages with the data processing platform are in long connection or short connection according to needs;
wherein the management message comprises a message subtype comprising: terminal information inquiry request message and response, remote control request message and response, remote upgrading command message and upgrading packet request message;
the service data message includes: a service data reporting request message and a service data issuing request message;
the interaction between the terminal and the data processing platform of the service data reporting request message specifically includes:
the terminal sends a service data reporting request message to the data processing platform, wherein a message body of the service data reporting request message comprises service data to be reported;
the data processing platform determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data reporting request message, if so, the data processing platform returns a service data reporting response message, the message body of the service data reporting response message comprises one or more TLV fields, and the service data reporting response message is used for indicating a service data reporting result;
the interaction of the service data issuing request message between the terminal and the data processing platform comprises the following steps:
the data processing platform sends a service data issuing request message to the terminal, wherein a message body of the service data issuing request message comprises service data to be issued;
the terminal determines whether confirmation information needs to be returned or not according to the value of the message subtype field contained in the message body of the service data issuing request message, if so, the terminal returns a service data issuing response message, the message body of the service data issuing response message comprises one or more TLV fields, and the service data issuing response message is used for indicating a service data issuing result.
CN201510718516.4A 2015-10-29 2015-10-29 Data communication method and system Active CN106656534B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510718516.4A CN106656534B (en) 2015-10-29 2015-10-29 Data communication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510718516.4A CN106656534B (en) 2015-10-29 2015-10-29 Data communication method and system

Publications (2)

Publication Number Publication Date
CN106656534A CN106656534A (en) 2017-05-10
CN106656534B true CN106656534B (en) 2020-03-13

Family

ID=58829541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510718516.4A Active CN106656534B (en) 2015-10-29 2015-10-29 Data communication method and system

Country Status (1)

Country Link
CN (1) CN106656534B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992391B (en) * 2017-12-29 2021-09-28 浙江宇视科技有限公司 Connection management method and system
CN108965484B (en) * 2018-09-30 2021-08-03 深圳市酷达通讯有限公司 Internet of things data transmission method, system and terminal
CN110012445B (en) * 2019-04-15 2020-10-16 中国水利水电科学研究院 Method for monitoring water fluctuation condition of industrial enterprise based on low-complexity mobile terminal
CN110611587A (en) * 2019-08-30 2019-12-24 视联动力信息技术股份有限公司 Alarm processing method and communication system
CN111611206A (en) * 2020-05-18 2020-09-01 深圳易伙科技有限责任公司 Message processing method and device based on platform-level enterprise message bus
CN111614752B (en) * 2020-05-19 2022-08-30 北京百度网讯科技有限公司 Method and device for data transmission
CN111800510A (en) * 2020-07-07 2020-10-20 北京微步在线科技有限公司 Data processing method and device based on long connection between nodes and readable storage medium
CN112866361A (en) * 2021-01-06 2021-05-28 戴振卿 Safe transmission method of industrial data
CN113507422A (en) * 2021-06-25 2021-10-15 中标慧安信息技术股份有限公司 Multi-terminal data transmission control method and system based on Internet of things platform

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6563830B1 (en) * 2000-03-28 2003-05-13 3Com Corporation Multicast registration of all multicast flows in an asynchronous transfer mode based emulated LAN

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101730270B (en) * 2009-11-23 2012-04-18 中国电信股份有限公司 Method for optimizing data transmission of mobile terminal and mobile terminal
CN104010039B (en) * 2014-06-05 2017-05-10 北京航空航天大学 Multi-radar remote monitoring system and method based on WebSocket

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6563830B1 (en) * 2000-03-28 2003-05-13 3Com Corporation Multicast registration of all multicast flows in an asynchronous transfer mode based emulated LAN

Also Published As

Publication number Publication date
CN106656534A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106656534B (en) Data communication method and system
CN101222519B (en) Remote activation of home devices
EP2577946B1 (en) Keep-alive hiatus declaration
US7957297B2 (en) Termination message for wireless wide area network routers
US9137623B2 (en) Method and system for realizing concurrent access of multi-kinds of bearer protocols on machine-to-machine (M2M) platform
US8612604B2 (en) System and method for server initiation beacon
EP2528274A1 (en) Method and system for upgrading network device
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
CN104144098A (en) Information pushing method and system and pushing server equipment
CN106993043B (en) Data communication system and method based on agency
CN105095022A (en) Data backup method and device
CN113783961B (en) Remote terminal management method, device, computer equipment and storage medium
CN102055608A (en) CPE (customer premise equipment) updating method, device and system
CN111225080B (en) Method for acquiring gateway down-hanging equipment information
CN101212346A (en) Software version management method and device for network element management system
KR20110007378A (en) Software upgrade system and method
CN111884938A (en) Router information acquisition method and device
CN109039427B (en) Ship monitoring management device
WO2017101028A1 (en) Data transmission method, m2m server, pgw, sgw and serving network node
CN107302448B (en) Port snoop method and device
CN113194119B (en) Configuration file acquisition method and device
CN113472810A (en) Method and system for SOCKET communication based on TCP/IP protocol
CN101754055A (en) Automatic network element ID setting method, ID management server and agent network element
CN113778628B (en) Edge node control method and system
WO2012068792A1 (en) Mobile phone, registration method, system and device for implementing device management of the mobile phone

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
CP02 Change in the address of a patent holder

Address after: 100176 room 502-1, floor 5, building 2, courtyard 10, keguyi street, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Patentee after: NEW SINGULARITY INTERNATIONAL TECHNICAL DEVELOPMENT Co.,Ltd.

Address before: 100089 Beijing city Haidian District wanquanzhuang Road No. 28 Wanliu new building 6 storey block A room 614

Patentee before: NEW SINGULARITY INTERNATIONAL TECHNICAL DEVELOPMENT Co.,Ltd.

CP02 Change in the address of a patent holder