CN112242997A - Data communication method, device and readable storage medium - Google Patents
Data communication method, device and readable storage medium Download PDFInfo
- Publication number
- CN112242997A CN112242997A CN202011038904.5A CN202011038904A CN112242997A CN 112242997 A CN112242997 A CN 112242997A CN 202011038904 A CN202011038904 A CN 202011038904A CN 112242997 A CN112242997 A CN 112242997A
- Authority
- CN
- China
- Prior art keywords
- data
- response
- data frame
- request
- carrier
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a data communication method, a data communication device and a storage medium, wherein the method comprises the following steps: acquiring a current communication request with a cloud server, wherein the communication request comprises a request type and carrier data; encapsulating the request type and the identity of the intelligent gateway into a protocol data unit; encapsulating the carrier data into carrier data units according to TLV format; generating a target data frame according to the protocol data unit and the carrier data unit; sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data; therefore, the invention solves the problem of poor data communication compatibility between the intelligent gateway and the cloud server, and can enhance the expandability of communication data and the reliability and stability of data processing by standardizing the data frame format.
Description
Technical Field
The invention relates to the technical field of communication and network security, in particular to a data communication method, a data communication device and a readable storage medium.
Background
With the rapid development of cloud computing technology, various cloud servers are more and more widely applied, and the market has stronger and stronger requirements on the deployment of the cloud servers; at present, an intelligent terminal is a new hotspot for accessing a home and a public network, and existing access authentication modes comprise WeChat authentication, short message authentication and the like, which can not be separated from an intelligent gateway and a cloud server, but in the prior art, the data communication reliability and stability of the intelligent gateway and the cloud server are poor, so that the problem of low access speed is caused, the expandability is poor, the application range is narrow, and the requirements of users cannot be met.
Disclosure of Invention
Aiming at the defects in the prior art, the data communication method, the data communication device and the readable storage medium provided by the invention solve the problem of poor data communication compatibility of the intelligent gateway and the cloud server, and can enhance the expandability of communication data and the reliability and stability of data processing by standardizing the data frame format.
In a first aspect, the present invention provides a data communication method, applied to an intelligent gateway, where the method includes: acquiring a current communication request with a cloud server, wherein the communication request comprises a request type and carrier data; encapsulating the request type and the identity of the intelligent gateway into a protocol data unit; encapsulating the carrier data into carrier data units according to TLV format; generating a target data frame according to the protocol data unit and the carrier data unit; and sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
Optionally, encapsulating the request type and the identity of the intelligent gateway into a protocol data unit, including: judging whether the request type is a control request type; when the request type is a control request type, acquiring a secondary classification value of the communication request; framing the identity of the intelligent gateway and the request type to generate a universal data frame header; framing the request sequence number of the communication request and the secondary classification value to generate a control data frame header; and encapsulating the universal data frame header and the control data frame header into the protocol data unit.
Optionally, the method further comprises: when the request type is a reported data type, framing the identity identification of the intelligent gateway and the request type to generate the universal data frame header; framing the serial number of the communication request and a preset code to generate a control data frame header; and encapsulating the universal data frame header and the control data frame header into the protocol data unit.
Optionally, encapsulating the carrier data in TLV format into carrier data units, comprising: generating a corresponding message element unit according to the type value, the length value and the element value of each message element in the carrier data; encapsulating all message element units into the carrier data unit.
Optionally, after sending the target data frame to the cloud server, causing the cloud server to parse the target data frame, and causing the cloud server to respond to the communication request according to the carrier data, the method further includes: receiving a response data frame sent by the cloud server, wherein the format of the response data frame is the same as that of the target data frame; acquiring a response serial number and a response classification value in the header of the control data frame according to the response data frame; judging whether the response sequence number is the same as the request sequence number; when the response serial number is the same as the request serial number, judging whether the secondary classification value is matched with the response classification value; and when the secondary classification value is matched with the response classification value, acquiring response data matched with the communication request according to the carrier data unit in the response data frame.
Optionally, the method further comprises: and when the response sequence number is the same as the request sequence number and the secondary classification value is not matched with the response classification value, discarding the response data frame and retransmitting the communication request.
In a second aspect, the present invention provides a data communication method, applied to a cloud server, the method including: receiving a target data frame sent by an intelligent gateway; analyzing the target data frame to obtain a protocol data unit and a carrier data unit; according to the request type in the protocol data unit, carrying out authentication processing on the carrier data in the carrier data unit to obtain response data; generating a protocol response unit by using the response type matched with the request type, and generating a response data unit by using the response data; generating a response data frame by the protocol response unit and the response data unit and sending the response data frame to the intelligent gateway, so that the intelligent gateway obtains the response data according to the response data frame; wherein the response data frame is in the same format as the target data frame.
In a third aspect, the present invention provides a data communication apparatus, applied to an intelligent gateway, the apparatus including: the communication request acquisition module is used for acquiring a current communication request with the cloud server, wherein the communication request comprises a request type and carrier data; the protocol data encapsulation module is used for encapsulating the request type and the identity of the intelligent gateway into a protocol data unit; the carrier data packaging module is used for packaging the carrier data into carrier data units according to TLV format; the target data frame generating module is used for generating a target data frame according to the protocol data unit and the carrier data unit; and the target data frame sending module is used for sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
In a fourth aspect, the present invention provides a data communication apparatus, which applies a cloud server, the apparatus comprising: the target data frame receiving module is used for receiving the target data frame sent by the intelligent gateway; the target data frame analysis module is used for analyzing the target data frame to obtain a protocol data unit and a carrier data unit; the authentication processing module is used for authenticating the carrier data in the carrier data unit according to the request type in the protocol data unit to obtain response data; the generating module is used for generating a protocol response unit from the response type matched with the request type and generating a response data unit from the response data; a sending module, configured to send a response data frame generated by the protocol response unit and the response data unit to the intelligent gateway, so that the intelligent gateway obtains the response data according to the response data frame; wherein the response data frame is in the same format as the target data frame.
In a fifth aspect, the present invention provides a readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of: acquiring a current communication request with a cloud server, wherein the communication request comprises a request type and carrier data; encapsulating the request type and the identity of the intelligent gateway into a protocol data unit; encapsulating the carrier data into carrier data units according to TLV format; generating a target data frame according to the protocol data unit and the carrier data unit; and sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
Compared with the prior art, the invention has the beneficial effects that:
according to the data communication method, a target data frame sent to a cloud server by an intelligent gateway is divided into a protocol data unit and a carrier data unit, the protocol data unit and the carrier data unit are analyzed by the cloud server in a separated mode step by step, so that the cloud server can perform matching judgment through a request type in the protocol data unit and carrier data of the carrier data unit, when the request type is matched with the carrier data, corresponding response is performed on a communication request, and the risk of responding to error data in the transmission process is effectively avoided; the target data frame comprises a plurality of reserved data units, the expandability of communication data is enhanced, and the target data frame can be suitable for data transmission under different mechanisms; therefore, the invention solves the problem of poor data communication compatibility between the intelligent gateway and the cloud server, and can enhance the expandability of communication data and the reliability and stability of data processing by standardizing the data frame format.
Drawings
Fig. 1 is a schematic flow chart illustrating a data communication method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a target data frame according to an embodiment of the present invention;
fig. 3 is a flow chart illustrating another data communication method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating another data communication method according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating a data communication apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of another data communication apparatus according to an embodiment of the present invention;
fig. 7 is a communication diagram of another data communication system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic flow chart illustrating a data communication method according to an embodiment of the present invention; as shown in fig. 1, when applied to an intelligent gateway, the data communication method specifically includes the following steps:
step S101, a current communication request with a cloud server is obtained, and the communication request comprises a request type and carrier data.
In this embodiment, the request type is a first-level classification of the communication request, the request type includes a control request type and a reporting data type, the control request type is a control signaling type request sent by the intelligent gateway to the cloud server, and the server needs to perform a corresponding response according to the request; the reported data type is a request for reporting the parameter configuration class by the intelligent gateway at regular time without a server to perform corresponding response; therefore, in this embodiment, the sending of the communication request to the cloud server by the intelligent gateway is that a request type of a primary classification of the communication request and carrier data related to the request type need to be acquired, where the carrier data includes, but is not limited to, related configuration parameters of the intelligent gateway and related configuration parameters of an intelligent terminal connected to the intelligent gateway.
And step S102, encapsulating the request type and the identity of the intelligent gateway into a protocol data unit.
In this embodiment, encapsulating the request type and the identity of the intelligent gateway into a protocol data unit includes: judging whether the request type is a control request type; when the request type is a control request type, acquiring a secondary classification value of the communication request; framing the identity of the intelligent gateway and the request type to generate a universal data frame header; framing the request sequence number of the communication request and the secondary classification value to generate a control data frame header; and encapsulating the universal data frame header and the control data frame header into the protocol data unit.
It should be noted that, if the primary classification of the request type is a control request type, a secondary classification value of the communication request under the control request type needs to be obtained, where the secondary classification includes, but is not limited to, an initial connection request, a configuration request, a heartbeat request, a report event request, and the like. The request sequence number of the communication request is the number of each communication request, for example, if the current communication request is the first communication request of the intelligent gateway and the cloud server, the request sequence number is 001, and if the current communication request is the second communication request, the request sequence number is 002, and so on, the request sequence number of each communication request can be obtained; therefore, the identity of the intelligent gateway and the first-level classification value of the communication request form a group of universal data frame headers, the request sequence number of the current communication request and the second-level classification value form a group of control data frame headers, and the universal data frame headers and the control data frame headers are packaged into the protocol data unit.
In this embodiment, when the request type is a reporting data type, framing the identity identifier of the intelligent gateway and the request type to generate the universal data frame header; framing the serial number of the communication request and a preset code to generate a control data frame header; and encapsulating the universal data frame header and the control data frame header into the protocol data unit.
It should be noted that, when the request type is a reporting data type, the control data frame header is composed of a sequence number of the communication request and a preset fixed code, and other data structures are the same as the control data type, which is not described herein again.
And step S103, packaging the carrier data into carrier data units according to TLV format.
Specifically, encapsulating the carrier data into carrier data units according to TLV format comprises: generating a corresponding message element unit according to the type value, the length value and the element value of each message element in the carrier data; encapsulating all message element units into the carrier data unit.
The carrier data in this embodiment comprises a plurality of message elements, the type value, the length value, and the element value of each message element generating a corresponding message element unit, each message element unit generating a carrier data unit to which the carrier data corresponds.
And step S104, generating a target data frame according to the protocol data unit and the carrier data unit.
Fig. 2 is a schematic structural diagram of a target data frame according to an embodiment of the present invention, as shown in fig. 2, 2a is an overall format of the target data frame, 2b is a generic data frame header, 2c is a control data frame header, and 2d is a bearer data unit, where the target data frame is composed of a protocol data unit and a bearer data unit, the protocol data unit includes the generic data frame header and the control data frame header, and the target data frame further includes an IP frame header and a UDP protocol frame header.
The TunnelID in the 2b universal data frame header is used for identifying the unique identity information of the intelligent gateway, and the TunnelID is set to be 8 bytes in length when the cloud platform server side and the terminal equipment client side are connected; version number of Version data frame identification; a TunnelType data frame type; the Msgplane communication request type is used for marking the communication request type as a control request type and a reported data type; 2c, controlling the serial number of the Sequence communication request in the data frame header, and matching the identifier with the response message of the cloud platform; MsgType controls the secondary class value of the request type.
Step S105, sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
It should be noted that, the intelligent gateway sends the generated target data frame to a cloud server, and the cloud server performs progressive analysis on the target data frame, and by acquiring the type of the current communication request through the protocol data unit, may acquire carrier data in the current communication request through the carrier data unit, and then performs corresponding response to the communication request according to the type of the communication request and the carrier data.
Compared with the prior art, the invention has the beneficial effects that:
according to the data communication method, a target data frame sent to a cloud server by an intelligent gateway is divided into a protocol data unit and a carrier data unit, the protocol data unit and the carrier data unit are analyzed by the cloud server in a separated mode step by step, so that the cloud server can perform matching judgment through a request type in the protocol data unit and carrier data of the carrier data unit, when the request type is matched with the carrier data, corresponding response is performed on a communication request, and the risk of responding to error data in the transmission process is effectively avoided; the target data frame comprises a plurality of reserved data units, the expandability of communication data is enhanced, and the target data frame can be suitable for data transmission under different mechanisms; therefore, the data communication between the intelligent gateway and the cloud server is realized, and the expandability of communication data, and the reliability and the stability of data processing can be enhanced by standardizing the data frame format.
Fig. 3 is a flow chart illustrating another data communication method according to an embodiment of the present invention; as shown in fig. 3, after sending the target data frame to the cloud server, so that the cloud server parses the target data frame, and so that the cloud server responds to the communication request according to the carrier data, the method further specifically includes the following steps:
step S201, receiving a response data frame sent by the cloud server, where the format of the response data frame is the same as that of the target data frame;
step S202, according to the response data frame, obtaining a response serial number and a response classification value in the control data frame header;
step S203, judging whether the response serial number is the same as the request serial number;
step S204, when the response serial number is the same as the request serial number, judging whether the secondary classification value is matched with the response classification value;
and step S205, when the secondary classification value is matched with the response classification value, acquiring response data matched with the communication request according to the carrier data unit in the response data frame.
It should be noted that, in this embodiment, the structural formats of the target data frame and the response data frame are the same, the cloud server only modifies the request sequence number in the control data frame header into a matched response sequence number, and modifies the carrier data unit into a corresponding response data unit, so that after receiving the response data frame sent by the cloud server, the intelligent gateway analyzes the response data frame according to a preset communication protocol to obtain the response sequence number and a response classification value, and when it is determined that the response sequence number is the same as the request sequence number and the secondary classification value in the target data frame is matched with the response classification value, the intelligent gateway analyzes the response data unit in the response data frame to obtain response data; when the response sequence number is the same as the request sequence number and the secondary classification value is not matched with the response classification value, discarding the response data frame and retransmitting the communication request; therefore, in this embodiment, after the protocol response unit of the response data frame is analyzed and judged first, the response data unit is analyzed after meeting the preset judgment condition, so that the error data in the communication transmission can be screened out, and the analysis speed of the output can be improved by judging first and then analyzing, and the error data can be found and retransmitted in time.
Fig. 4 is a schematic flow chart of another data communication method provided in an embodiment of the present invention, and as shown in fig. 4, when applied to a cloud server, the data communication method further includes the following steps:
step S301, receiving a target data frame sent by an intelligent gateway;
step S302, analyzing the target data frame to obtain a protocol data unit and a carrier data unit;
step S303, according to the request type in the protocol data unit, carrying out authentication processing on the carrier data in the carrier data unit to obtain response data;
step S304, generating a protocol response unit from the response type matched with the request type, and generating a response data unit from the response data;
step S305, sending a response data frame generated by the protocol response unit and the response data unit to the intelligent gateway, so that the intelligent gateway obtains the response data according to the response data frame; wherein the response data frame is in the same format as the target data frame.
In the above embodiments, the analysis of the target data frame and the generation of the response data frame by the cloud server are described, and this embodiment is not described again.
Fig. 5 is a block diagram illustrating a data communication apparatus according to an embodiment of the present invention; as shown in fig. 5, when applied to the intelligent gateway, the data communication apparatus includes:
a communication request obtaining module 510, configured to obtain a current communication request with a cloud server, where the communication request includes a request type and carrier data;
a protocol data encapsulation module 520, configured to encapsulate the request type and the identity of the intelligent gateway into a protocol data unit;
a carrier data encapsulation module 530, configured to encapsulate the carrier data into carrier data units according to TLV format;
a target data frame generating module 540, configured to generate a target data frame according to the protocol data unit and the carrier data unit;
a target data frame sending module 550, configured to send the target data frame to the cloud server, so that the cloud server parses the target data frame, and the cloud server responds to the communication request according to the carrier data.
Fig. 6 is a block diagram of another data communication apparatus according to an embodiment of the present invention; as shown in fig. 6, the data communication apparatus, when applied to the cloud server, includes:
a target data frame receiving module 610, configured to receive a target data frame sent by the intelligent gateway;
a target data frame parsing module 620, configured to parse the target data frame to obtain a protocol data unit and a carrier data unit;
an authentication processing module 630, configured to perform authentication processing on the carrier data in the carrier data unit according to the request type in the protocol data unit, so as to obtain response data;
a generating module 640, configured to generate a protocol response unit from a response type matched with the request type, and generate a response data unit from the response data;
a sending module 650, configured to send a response data frame generated by the protocol response unit and the response data unit to the intelligent gateway, so that the intelligent gateway obtains the response data according to the response data frame;
wherein the response data frame is in the same format as the target data frame.
In an embodiment of the present invention, the present invention provides a data communication system, where the data communication system includes an intelligent terminal, an intelligent gateway, and a cloud server, where the intelligent gateway and the cloud server perform data interaction through the data communication method of the foregoing embodiment, and fig. 7 is a schematic flow diagram of another data communication method provided in an embodiment of the present invention, and the data communication system may include the following steps:
1. starting up a system, powering on, starting up an intelligent gateway, and waiting for network connection;
2. the intelligent gateway sends a message request of 0x01 type to connect to the cloud server, wherein the message carries message elements packaged in TLV format, such as Model (Model), MAC, SN and the like of the terminal equipment;
3. the method comprises the steps that the intelligent gateway sends a message request configuration of a type 0x03, and if the cloud server has related initial configuration, the configuration is issued to the intelligent gateway;
4. intelligent gateway sends heartbeat periodically through messages of type 0x05
5. When the intelligent terminal is accessed, the intelligent gateway sends the intelligent terminal to the cloud server through a message of 0x09 type.
Wherein the message types are classified as:
message type value | Message description |
0x01 | Initiating a connection request |
0x02 | Response 0x01, if the connection was successful |
0x03 | Configuration request |
0x04 | In response to 0x03, the configuration content is delivered |
0x05 | Heartbeat messages |
0x06 | Response 0x05 |
0x07 | Configuration update request |
0x08 | In response to 0x07, the configuration update is delivered |
0x09 | Reporting events |
0x0a | Response 0x09 |
In another embodiment of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring a current communication request with a cloud server, wherein the communication request comprises a request type and carrier data; encapsulating the request type and the identity of the intelligent gateway into a protocol data unit; encapsulating the carrier data into carrier data units according to TLV format; generating a target data frame according to the protocol data unit and the carrier data unit; and sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
In a further embodiment of the invention, a readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, realizes the following steps: acquiring a current communication request with a cloud server, wherein the communication request comprises a request type and carrier data; encapsulating the request type and the identity of the intelligent gateway into a protocol data unit; encapsulating the carrier data into carrier data units according to TLV format; generating a target data frame according to the protocol data unit and the carrier data unit; and sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. A data communication method is applied to an intelligent gateway, and the method comprises the following steps:
acquiring a current communication request with a cloud server, wherein the communication request comprises a request type and carrier data;
encapsulating the request type and the identity of the intelligent gateway into a protocol data unit;
encapsulating the carrier data into carrier data units according to TLV format;
generating a target data frame according to the protocol data unit and the carrier data unit;
and sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
2. The data communication method of claim 1, wherein encapsulating the request type and the identity of the intelligent gateway into a protocol data unit comprises:
judging whether the request type is a control request type;
when the request type is a control request type, acquiring a secondary classification value of the communication request;
framing the identity of the intelligent gateway and the request type to generate a universal data frame header;
framing the request sequence number of the communication request and the secondary classification value to generate a control data frame header;
and encapsulating the universal data frame header and the control data frame header into the protocol data unit.
3. The data communication method of claim 2, wherein the method further comprises:
when the request type is a reported data type, framing the identity identification of the intelligent gateway and the request type to generate the universal data frame header;
framing the serial number of the communication request and a preset code to generate a control data frame header;
and encapsulating the universal data frame header and the control data frame header into the protocol data unit.
4. A method of data communication according to claim 1, wherein encapsulating the carrier data into carrier data units according to TLV format comprises:
generating a corresponding message element unit according to the type value, the length value and the element value of each message element in the carrier data;
encapsulating all message element units into the carrier data unit.
5. The data communication method according to claim 3, wherein after transmitting the target data frame to the cloud server, causing the cloud server to parse the target data frame, causing the cloud server to respond to the communication request according to the carrier data, the method further comprises:
receiving a response data frame sent by the cloud server, wherein the format of the response data frame is the same as that of the target data frame;
acquiring a response serial number and a response classification value in the header of the control data frame according to the response data frame;
judging whether the response sequence number is the same as the request sequence number;
when the response serial number is the same as the request serial number, judging whether the secondary classification value is matched with the response classification value;
and when the secondary classification value is matched with the response classification value, acquiring response data matched with the communication request according to the carrier data unit in the response data frame.
6. The data communication method of claim 5, wherein the method further comprises:
and when the response sequence number is the same as the request sequence number and the secondary classification value is not matched with the response classification value, discarding the response data frame and retransmitting the communication request.
7. A data communication method is applied to a cloud server, and the method comprises the following steps:
receiving a target data frame sent by an intelligent gateway;
analyzing the target data frame to obtain a protocol data unit and a carrier data unit;
according to the request type in the protocol data unit, carrying out authentication processing on the carrier data in the carrier data unit to obtain response data;
generating a protocol response unit by using the response type matched with the request type, and generating a response data unit by using the response data;
generating a response data frame by the protocol response unit and the response data unit and sending the response data frame to the intelligent gateway, so that the intelligent gateway obtains the response data according to the response data frame;
wherein the response data frame is in the same format as the target data frame.
8. A data communication apparatus, applied to an intelligent gateway, the apparatus comprising:
the communication request acquisition module is used for acquiring a current communication request with the cloud server, wherein the communication request comprises a request type and carrier data;
the protocol data encapsulation module is used for encapsulating the request type and the identity of the intelligent gateway into a protocol data unit;
the carrier data packaging module is used for packaging the carrier data into carrier data units according to TLV format;
the target data frame generating module is used for generating a target data frame according to the protocol data unit and the carrier data unit;
and the target data frame sending module is used for sending the target data frame to the cloud server, so that the cloud server analyzes the target data frame, and the cloud server responds to the communication request according to the carrier data.
9. A data communication apparatus, characterized in that a cloud server is applied, the apparatus comprising:
the target data frame receiving module is used for receiving a target data frame sent by the intelligent gateway;
the target data frame analysis module is used for analyzing the target data frame to obtain a protocol data unit and a carrier data unit;
the authentication processing module is used for authenticating the carrier data in the carrier data unit according to the request type in the protocol data unit to obtain response data;
the generating module is used for generating a protocol response unit from the response type matched with the request type and generating a response data unit from the response data;
a sending module, configured to send a response data frame generated by the protocol response unit and the response data unit to the intelligent gateway, so that the intelligent gateway obtains the response data according to the response data frame;
wherein the response data frame is in the same format as the target data frame.
10. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011038904.5A CN112242997B (en) | 2020-09-28 | 2020-09-28 | Data communication method, device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011038904.5A CN112242997B (en) | 2020-09-28 | 2020-09-28 | Data communication method, device and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112242997A true CN112242997A (en) | 2021-01-19 |
CN112242997B CN112242997B (en) | 2022-10-11 |
Family
ID=74171829
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011038904.5A Active CN112242997B (en) | 2020-09-28 | 2020-09-28 | Data communication method, device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112242997B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040143669A1 (en) * | 2002-10-25 | 2004-07-22 | International Business Machines Corporation | Method, device and system for sharing application session information across multiple-channels |
US20080028077A1 (en) * | 2006-07-27 | 2008-01-31 | Masanori Kamata | Packet forwarding control method and packet forwarding apparatus |
WO2009057045A2 (en) * | 2007-10-29 | 2009-05-07 | Nokia Corporation | Method and apparatus for reactivating a data channel |
US20100250727A1 (en) * | 2009-03-24 | 2010-09-30 | Yahoo! Inc. | System and method for verified presence tracking |
CN106878114A (en) * | 2015-12-11 | 2017-06-20 | 北京数码视讯科技股份有限公司 | A kind of method of data transfer, server and terminal |
CN107483558A (en) * | 2017-07-27 | 2017-12-15 | 中兴软创科技股份有限公司 | A kind of high in the clouds platform is to AP configuration managements and the method to wireless terminal Access Control |
CN110557433A (en) * | 2019-07-26 | 2019-12-10 | 华云超融合科技有限公司 | Resource management method, platform, cloud gateway, system and storage medium |
CN111083161A (en) * | 2019-12-27 | 2020-04-28 | 中消云(北京)物联网科技研究院有限公司 | Data transmission processing method and device and Internet of things equipment |
CN111464627A (en) * | 2020-03-31 | 2020-07-28 | 中国科学院自动化研究所 | Data processing method, edge server, center server and processing system |
CN111600924A (en) * | 2020-03-30 | 2020-08-28 | 北京和欣运达科技有限公司 | Data communication method |
-
2020
- 2020-09-28 CN CN202011038904.5A patent/CN112242997B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040143669A1 (en) * | 2002-10-25 | 2004-07-22 | International Business Machines Corporation | Method, device and system for sharing application session information across multiple-channels |
US20080028077A1 (en) * | 2006-07-27 | 2008-01-31 | Masanori Kamata | Packet forwarding control method and packet forwarding apparatus |
WO2009057045A2 (en) * | 2007-10-29 | 2009-05-07 | Nokia Corporation | Method and apparatus for reactivating a data channel |
US20100250727A1 (en) * | 2009-03-24 | 2010-09-30 | Yahoo! Inc. | System and method for verified presence tracking |
CN106878114A (en) * | 2015-12-11 | 2017-06-20 | 北京数码视讯科技股份有限公司 | A kind of method of data transfer, server and terminal |
CN107483558A (en) * | 2017-07-27 | 2017-12-15 | 中兴软创科技股份有限公司 | A kind of high in the clouds platform is to AP configuration managements and the method to wireless terminal Access Control |
CN110557433A (en) * | 2019-07-26 | 2019-12-10 | 华云超融合科技有限公司 | Resource management method, platform, cloud gateway, system and storage medium |
CN111083161A (en) * | 2019-12-27 | 2020-04-28 | 中消云(北京)物联网科技研究院有限公司 | Data transmission processing method and device and Internet of things equipment |
CN111600924A (en) * | 2020-03-30 | 2020-08-28 | 北京和欣运达科技有限公司 | Data communication method |
CN111464627A (en) * | 2020-03-31 | 2020-07-28 | 中国科学院自动化研究所 | Data processing method, edge server, center server and processing system |
Also Published As
Publication number | Publication date |
---|---|
CN112242997B (en) | 2022-10-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102571732B (en) | A kind of methods, devices and systems of processes sensor protocol information | |
CN110445636B (en) | Management platform-based micro-service early warning method and device and computer equipment | |
CN114362885B (en) | Data transmission method, communication system, equipment and medium of Internet of things | |
CN110109766B (en) | Data interaction method and device based on cross-department and cross-platform data sharing exchange | |
CN114500358B (en) | Gateway message distribution method, device, equipment and storage medium | |
CN112953745A (en) | Service calling method, system, computer device and storage medium | |
CN106790266A (en) | The communication means and device of a kind of intelligent distribution type feeder automation | |
CN112202795A (en) | Data processing method, gateway equipment and medium | |
CN112291514A (en) | Remote audio and video call method and device and OTT platform | |
CN114710823A (en) | Bluetooth network access method, related device and storage medium | |
CN110808847B (en) | Method and device for managing DAS (data-based system), electronic device and storage medium | |
CN110333957B (en) | Remote Procedure Call (RPC) service calling method, device and computer equipment | |
CN111198804A (en) | Gateway-based industrial internet platform third-party micro-service monitoring and early warning method | |
CN112242997B (en) | Data communication method, device and readable storage medium | |
CN112235297B (en) | MES system identification analysis method and system based on edge calculation | |
CN110912904B (en) | Malicious device identification method and device, storage medium and computer device | |
CN109120742B (en) | UDP-based power distribution network terminal data acquisition method and device | |
CN112788054B (en) | Internet of things data processing method, system and equipment | |
CN113114704B (en) | Video structured data one-way transmission method and device based on equipment attribute selection | |
CN112910706B (en) | Automatic configuration method, system, device and readable storage medium | |
CN115277803A (en) | Message management method, system, computer equipment and storage medium | |
CN113452582A (en) | Data transmission method, equipment, system and medium based on automatic analysis | |
CN110839231B (en) | Method and equipment for acquiring terminal identification | |
CN106789864B (en) | Message anti-attack method and device | |
CN112203319B (en) | Test method and device of ZigBee device, computer device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |