CN115695594B - Internet of things data communication method and device - Google Patents

Internet of things data communication method and device Download PDF

Info

Publication number
CN115695594B
CN115695594B CN202310000508.0A CN202310000508A CN115695594B CN 115695594 B CN115695594 B CN 115695594B CN 202310000508 A CN202310000508 A CN 202310000508A CN 115695594 B CN115695594 B CN 115695594B
Authority
CN
China
Prior art keywords
data
session identifier
data information
information
attribute information
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
CN202310000508.0A
Other languages
Chinese (zh)
Other versions
CN115695594A (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.)
XCMG Hanyun Technologies Co Ltd
Original Assignee
XCMG Hanyun Technologies 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 XCMG Hanyun Technologies Co Ltd filed Critical XCMG Hanyun Technologies Co Ltd
Priority to CN202310000508.0A priority Critical patent/CN115695594B/en
Publication of CN115695594A publication Critical patent/CN115695594A/en
Application granted granted Critical
Publication of CN115695594B publication Critical patent/CN115695594B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a method and a device for data communication of the Internet of things, wherein a gateway node analyzes a reported data message sent by a terminal device to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, judges whether a session identifier corresponding to the terminal device exists in a local cache, if the session identifier corresponding to the terminal device exists in the local cache, acquires a data compression option associated with the attribute information from the session identifier, and according to a first indication of compressing the data information corresponding to the attribute information, the data information of the same attribute information carried in the reported data message continuously received within a certain time period forms a data information sequence and is compressed to obtain compressed data information. The method and the system can ensure the compatibility and expandability of the access of the Internet of things platform to different terminal devices, and simultaneously meet the individualized requirements of different terminal devices on reported data processing.

Description

Internet of things data communication method and device
Technical Field
The application relates to the technical field of communication of the Internet of things, in particular to a data communication method and device of the Internet of things.
Background
With the rapid development of the internet of things communication technology, more and more terminal devices start to access the cloud internet of things platform through the internet of things gateway, send various monitoring data to the cloud internet of things platform, and perform business value-added services such as data analysis, processing, display, early warning and the like through the cloud internet of things platform. The monitoring data are sent to the cloud Internet of things platform through the Internet of things gateway, so that the communication bandwidth of the Internet of things is greatly occupied, and the system resources of the Internet of things gateway and the cloud Internet of things platform are occupied. Therefore, some internet of things data acquisition systems classify the monitoring data of the terminal equipment in the internet of things gateway according to the equipment type, perform compression processing such as dictionary compression or frame compression on the classified data, and transmit the compressed classified data to the cloud internet of things platform, so that the communication bandwidth of the internet of things and the occupation of system resources are reduced.
On one hand, however, in the existing scheme, specific data compression processing codes need to be developed for the internet of things gateway and the cloud internet of things platform according to the device type and the data characteristics of the terminal device, and the data compression processing codes are deeply coupled with the terminal device and the data application scene thereof, so that the universality is not provided, and the compatibility and the expandability of the internet of things platform for accessing different terminal devices are poor; on the other hand, the monitoring data sent by different terminal devices have different characteristic attributes and application scenarios, some of the monitoring data do not need to be compressed, and others of the monitoring data need to be compressed.
Disclosure of Invention
In view of the above, the present application provides an internet of things data communication method and apparatus, which can ensure compatibility and expandability of access of an internet of things platform to different terminal devices, and simultaneously meet personalized requirements of different terminal devices on processing reported data, when occupation of communication bandwidth and system resources in the internet of things platform is reduced.
In a first aspect, the present application provides an internet of things data communication method, including:
in response to receiving a reported data message sent by a terminal device, a gateway node analyzes the reported data message to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, and judges whether a session identifier corresponding to the terminal device exists in a local cache according to the device identifier, wherein the session identifier comprises the device identifier, an identifier of the gateway node and a data compression option associated with the attribute information;
if the session identifier corresponding to the terminal device exists in the local cache, the gateway node acquires a data compression option associated with the attribute information from the session identifier, and executes a first process according to a first indication of compressing the data information corresponding to the attribute information, which is indicated by the data compression option: forming a data information sequence by data information of the same attribute information carried in a report data message sent by the terminal equipment and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, assembling the session identifier and the compressed data information into a first data receiving message, and sending the first data receiving message to a first message queue;
and the platform service node reads the first data receiving message from the first message queue, decompresses the compressed data information in the first data receiving message when confirming that the session identifier carried in the first data receiving message is effective, obtains the data information sequence, and stores the data information sequence in a background database.
In an optional embodiment, the forming, by a data information sequence, a data information sequence of data information of the same attribute information carried in a report data message sent by the terminal device and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, and assembling the session identifier and the compressed data information into a first data receiving packet includes:
the gateway node sequentially caches the data information of the same attribute information carried in the reported data message sent by the terminal equipment and continuously received in a certain time period in the local cache;
and reading the data information of the same attribute information from the local cache to form a data information sequence, compressing according to a preset compression coding rule to obtain the compressed data information, and assembling the session identifier, the identifier of the compression coding rule and the compressed data information into the first data receiving message.
In an optional implementation manner, the reading, by the platform service node, the first data receiving packet from the first message queue, and when it is determined that the session identifier carried in the first data receiving packet is valid, decompressing the compressed data information in the first data receiving packet to obtain the data information sequence includes:
the platform service node judges whether the session identifier carried in the first data receiving message is a session identifier which is generated by the platform service node and corresponds to the terminal equipment;
if so, decompressing the compressed data information in the first data receiving message according to the compression coding rule corresponding to the identifier of the compression coding rule in the first data receiving message, so as to obtain the data information sequence.
In an optional embodiment, after the gateway node obtains the data compression option associated with the attribute information from the session identifier, the method includes:
the gateway node executes a second process according to a second indication that the data compression option indicates that the data information corresponding to the attribute information is not compressed: assembling the session identifier and the data information into a second data receiving message, and sending the second data receiving message to the first message queue;
and the platform service node reads the second data receiving message from the first message queue, analyzes the data information from the second data receiving message when confirming that the session identifier carried in the second data receiving message is valid, and stores the data information to a background database.
In an alternative embodiment, the method comprises:
if the session identifier corresponding to the terminal equipment does not exist in the local cache, the gateway node generates a token corresponding to the terminal equipment, assembles the token, the identifier of the gateway node, the equipment identifier and the attribute information into an authentication request message, and sends the authentication request message to a second message queue;
the platform service node reads the authentication request message from the second message queue, generates a session identifier corresponding to the terminal device after the authentication of the terminal device is passed according to the token and the device identifier in the authentication request message, and sends the session identifier to a third message queue corresponding to the gateway node, wherein the session identifier comprises the device identifier, the identifier of the gateway node and a data compression option associated with the attribute information;
the gateway node reads the session identifier from the third message queue, caches the session identifier in the local cache, acquires a data compression option associated with the attribute information from the session identifier, and executes the first processing or the second processing according to a first indication or a second indication, indicated by the data compression option, of compressing the data information corresponding to the attribute information.
In an optional embodiment, the session identifier includes an active time timer and a maximum validity duration, and the method further includes:
the gateway node updates an active time timer of the session identifier to an initial state when receiving a reported data message sent by the terminal device each time no matter the first processing or the second processing is executed, so that the session identifier cached locally continues to be in an effective state;
and the gateway node periodically judges whether the active time timer of the session identifier in the local cache is greater than the maximum effective duration, if so, the session identifier is removed from the local cache.
In an alternative embodiment, the method comprises:
the gateway node analyzes the reported data message to obtain first data information, first attribute information corresponding to the first data information, second data information and second attribute information corresponding to the second data information;
the gateway node respectively acquires data compression options related to the first attribute information and the second attribute information from the session identifier, respectively executes the first processing on the first data information and executes the second processing on the second data information according to a first indication that the first data information corresponding to the first attribute information is compressed and a second indication that the second data information corresponding to the second attribute information is not compressed, which are indicated by the data compression options.
In an optional implementation manner, after the platform service node generates the session identifier corresponding to the terminal device, the method includes: the platform service node stores the session identifier corresponding to the terminal device in a shared cache, so that any platform service node can read the session identifier from the shared cache.
In an alternative embodiment, the certain time period includes a compression time period specified in a data compression option associated with the attribute information in the session identifier.
In a second aspect, the present application provides an internet of things data communication device, including:
the data analysis unit is used for responding to a reported data message sent by a terminal device, analyzing the reported data message by a gateway node to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, and judging whether a session identifier corresponding to the terminal device exists in a local cache according to the device identifier, wherein the session identifier comprises the device identifier, the identifier of the gateway node and a data compression option associated with the attribute information;
a data processing unit, configured to, if the session identifier corresponding to the terminal device exists in the local cache, obtain, by the gateway node, a data compression option associated with the attribute information from the session identifier, and execute, according to a first instruction, indicated by the data compression option, to compress the data information corresponding to the attribute information, a first process: forming a data information sequence by data information of the same attribute information carried in a report data message sent by the terminal equipment and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, assembling the session identifier and the compressed data information into a first data receiving message, and sending the first data receiving message to a first message queue;
and the data receiving unit is used for reading the first data receiving message from the first message queue by the platform service node, decompressing the compressed data information in the first data receiving message when the session identifier carried in the first data receiving message is confirmed to be valid, obtaining the data information sequence, and storing the data information sequence in a background database.
The embodiment of the application can at least achieve the following beneficial effects:
in the embodiment of the application, a gateway node analyzes a reported data message sent by a terminal device to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, judges whether a session identifier corresponding to the terminal device exists in a local cache, if the session identifier corresponding to the terminal device exists in the local cache, the gateway node obtains a data compression option associated with the attribute information from the session identifier, executes a first process according to a first indication of compressing the data information corresponding to the attribute information, indicated by the data compression option, namely, the data information of the same attribute information carried in the reported data message sent by the terminal device and continuously received within a certain time period forms a data information sequence, compresses the data information sequence to obtain compressed data information, assembles the session identifier and the compressed data information into a first data receiving message, and sends the first data receiving message to a first message queue; and the platform service node reads the first data receiving message from the first message queue, and decompresses the compressed data information in the first data receiving message to obtain the data information sequence when confirming that the session identifier carried in the first data receiving message is valid. Therefore, specific data compression processing codes do not need to be developed for the internet of things gateway and the cloud internet of things platform according to the application scenes of access of different terminal devices, compatibility and expandability of the internet of things platform for access of different terminal devices can be guaranteed when occupation of communication bandwidth and system resources in the internet of things platform is reduced, and personalized requirements of different terminal devices for processing reported data are met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below. It is appreciated that the following drawings depict only certain embodiments of the application and are not to be considered limiting of its scope.
Fig. 1 is a schematic structural diagram of an internet of things communication system 100 according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a data communication method of the internet of things according to an embodiment of the application;
fig. 3 is a partial flow diagram of a data communication method of the internet of things according to another embodiment of the application;
fig. 4 is a partial flow diagram of a data communication method of the internet of things according to another embodiment of the application;
fig. 5 is a partial flow diagram of a data communication method of the internet of things according to another embodiment of the present application;
fig. 6 is a partial flow diagram of a data communication method of the internet of things according to another embodiment of the present application;
fig. 7 is a partial flow diagram of a data communication method of the internet of things according to another embodiment of the application;
fig. 8 is a schematic structural diagram of an internet of things data communication device according to an embodiment of the present application;
fig. 9 is a partial structural schematic diagram of a data communication device of the internet of things according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages 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 of the embodiments of the present application. However, it should be understood that the described embodiments are only some exemplary embodiments, but not all embodiments, of the application, and thus the following detailed description of the embodiments of the application is not intended to limit the scope of the application as claimed. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and in the claims of this application are used for distinguishing between similar elements and not for describing a particular sequential or chronological order, nor should they be construed to indicate or imply relative importance.
As described above, in some existing data communication systems of the internet of things, monitoring data of terminal devices are classified according to device types in a gateway of the internet of things, dictionary compression or frame compression and other compression processes are performed on the classified data, and the compressed classified data are transmitted to a cloud internet of things platform, so that the communication bandwidth of the internet of things and the occupation of system resources are reduced. On one hand, however, in the existing scheme, specific data compression processing codes need to be developed for the internet of things gateway and the cloud internet of things platform according to the device type and the data characteristics of the terminal device, and the data compression processing codes are deeply coupled with the terminal device and the data application scene thereof, so that the universality is not provided, and the compatibility and the expandability of the internet of things platform for accessing different terminal devices are poor; on the other hand, the monitoring data sent by different terminal devices have different characteristic attributes and application scenarios, some of the monitoring data do not need to be compressed, and others of the monitoring data need to be compressed. Therefore, in order to solve the above problems, the present application provides an internet of things data communication method and apparatus, which can ensure the compatibility and scalability of the internet of things platform for accessing different terminal devices, and simultaneously meet the personalized requirements of different terminal devices for processing reported data, when reducing the occupation of communication bandwidth and system resources in the internet of things platform.
Fig. 1 is a schematic structural diagram of an internet of things communication system 100 according to an embodiment of the present application. The system 100 includes one or more terminal devices 110, one or more gateway nodes 120, a message queue 130, and one or more platform service nodes 140. One or more terminal devices 110 may be in communication connection with a corresponding gateway node 120 of the one or more gateway nodes 120 through multiple communication protocols, and send a reported data packet to the corresponding gateway node 120 of the one or more gateway nodes 120, where the one or more gateway nodes 120 analyze the received reported data packet, convert the received reported data packet into a data receiving packet in a unified packet format supported by the platform service node 140, and send the data receiving packet to the message queue 130. Any platform service node 140 of the one or more platform service nodes 140 may read the data receiving packet from the message queue 130, so as to implement receiving, storing, and forwarding of the reported data.
In some embodiments, the terminal device 110 may be a physical sensor or other physical terminal device of the platform service node 140, and the terminal device 110 may send the report data packet to the gateway node 120 based on a plurality of internet of things communication protocols, for example, protocol formats such as MQTT, TCP, UDP, COAP, and HTTP. Each terminal device 110 has a unique device identification.
In some embodiments, one or more gateway nodes 120 may be implemented as one or more service nodes in a distributed cluster, each gateway node 120 may be identified by a unique identification. Gateway node 120 may also expand the number of nodes based on the number of terminal devices 110 that are accessed.
In some embodiments, message queue 130 may comprise one or more message queues distributed over a message queue, enabling message exchange communications between gateway node 120 and platform service node 140 based on producer and consumer patterns, enabling decoupled asynchronous communications between gateway node 120 and platform service node 140.
In some embodiments, the one or more platform service nodes 140 are one or more service nodes providing platform services in the cloud internet of things platform, and as with the gateway node 120, may also be implemented as one or more service nodes in a distributed cluster, where each platform service node 140 may be identified by a unique identifier. The platform service nodes 140 may perform dynamic quantity expansion according to the performance requirements of the cloud internet of things platform, so as to achieve scalability and load balancing of the cloud internet of things platform. One or more platform service nodes 140 may act as a consumer group such that any platform service node may read messages from the message queue 130 in a load balancing based manner.
Fig. 2 is a schematic flow chart of a data communication method of the internet of things according to an embodiment of the application. As shown in fig. 2, the method is based on the communication system 100 of the internet of things, and includes the following steps:
step S201, in response to receiving a reported data packet sent by the terminal device 110, the gateway node 120 parses the reported data packet to obtain a device identifier, data information, and attribute information corresponding to the data information of the terminal device 110, and determines whether a session identifier corresponding to the terminal device 110 exists in a local cache according to the device identifier, where the session identifier includes the device identifier, an identifier of the gateway node 120, and a data compression option associated with the attribute information.
Step S202, if the session identifier corresponding to the terminal device 110 exists in the local cache, the gateway node 120 obtains a data compression option associated with the attribute information from the session identifier, and executes a first process according to a first instruction, indicated by the data compression option, for compressing the data information corresponding to the attribute information: and forming a data information sequence by using the data information of the same attribute information carried in the report data message sent by the terminal device 110 and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, assembling the session identifier and the compressed data information into a first data receiving message, and sending the first data receiving message to a first message queue.
Step S203, the platform service node 140 reads the first data receiving packet from the first message queue, decompresses the compressed data information in the first data receiving packet when it is determined that the session identifier carried in the first data receiving packet is valid, obtains the data information sequence, and stores the data information sequence in the background database.
In this embodiment, the terminal device 110 sends a report data packet to the corresponding gateway node 120 based on multiple internet of things communication protocols, for example, protocol formats such as MQTT, TCP, UDP, COAP, and HTTP. The reported data packet carries the device identifier of the terminal device 110, the data information, and the attribute information corresponding to the data information. The device identifier of the terminal device 110 is used to uniquely identify the terminal device 110. The data information is one or more monitoring data that the terminal device 110 intends to report to the cloud internet of things platform. The attribute information corresponding to the data information includes attribute information indicating that the data information belongs to periodic data or aperiodic data. The periodic data refers to monitoring data that needs to be sent to the gateway node 120 at a certain time interval, for example, data collected periodically from a sensor at a certain time interval, and the non-periodic data refers to monitoring data that is sent to the gateway node 120 aperiodically, for example, monitoring data generated based on a user or an external trigger event. In another embodiment, optionally, the attribute information corresponding to the data information may further include other attribute information such as a data name.
In this embodiment, after the gateway node 120 receives the reported data packet sent by the terminal device 110, the gateway node 120 first obtains, from the reported data packet, the device identifier, the data information, and the attribute information corresponding to the data information of the terminal device 110 by parsing, and then determines, according to the device identifier, whether a session identifier corresponding to the terminal device 110 exists in a local cache, where the session identifier includes the device identifier, an identifier of the gateway node 120, and a data compression option associated with the attribute information. The session identifier corresponding to the terminal device 110 in the local cache of the gateway node 120 is a globally unique session identifier generated by the platform service node 140 for the terminal device 110 after the gateway node 120 first receives the reported data packet of the terminal device 110 and requests the platform service node 140 at the cloud to authenticate the terminal device 110. The session identity is used to provide trusted data communication between gateway node 120 and platform service node 140 after authentication of the terminal device 110 has passed.
In this embodiment, the session identifier includes a device identifier of the terminal device 110, an identifier of the gateway node 120, and a data compression option associated with the attribute information. The device identifier of the terminal device 110 and the identifier of the gateway node 120 are used to characterize the unique association between the session identifier and the terminal device 110 and the gateway node 120. The data compression option associated with the attribute information is a personalized data compression option generated by the platform service node 140 for the terminal device 110 according to the attribute information corresponding to the data information reported by the terminal device 110. In one embodiment, the data compression option associated with the attribute information may be a personalized configuration option provided by the cloud internet of things platform to each terminal device 110 when each terminal device 110 registers with the cloud internet of things platform. The configuration option is obtained by performing initialization configuration by a tenant to which the terminal device 110 belongs when the terminal device 110 registers in the cloud internet of things platform, and the configuration option can be set individually according to the characteristic attribute of the reported data of the terminal device 110 and an application scene. In this embodiment, the session identifier generated by the platform service node 140 for the terminal device 110 simultaneously carries the data compression option associated with the attribute information, and each gateway node 120 does not need to dynamically maintain the data compression configuration option for each terminal device 110 in the local node, and can perform personalized reported data processing on the data information according to the attribute information corresponding to the data information in the reported data packet of different terminal devices 110.
In this embodiment, if the session identifier corresponding to the terminal device 110 exists in the local cache of the gateway node 120, the gateway node 120 obtains a data compression option associated with the attribute information from the session identifier, executes a first process according to a first instruction, indicated by the data compression option, for compressing the data information corresponding to the attribute information, that is, data information of the same attribute information carried in a report data message sent by the terminal device 110 and continuously received within a certain time period forms a data information sequence, compresses the data information sequence to obtain compressed data information, assembles the session identifier and the compressed data information into a first data receiving packet, and sends the first data receiving packet to a first message queue.
For example, if the platform service node 140 specifies an option of enabling compression processing for a certain target attribute information corresponding to the data information reported by the terminal device 110 in the session identifier generated by the terminal device 110 according to the data compression option associated with the attribute information, when receiving the reported data packet from the terminal device 110, if the reported data packet carries the data information associated with the target attribute information, the gateway node 120 does not perform conversion and assembly of the data reception packet and send the data reception packet to the first message queue on the reported data packet received this time, but rather, forms a data information sequence from the data information of the same target attribute information carried in the reported data packet sent by the terminal device 110 and continuously received within a certain time period, compresses the data information sequence to obtain compressed data information, and then assembles the session identifier and the compressed data information into a first data reception packet, that is, converts the first data reception packet into a uniform packet format supported by the platform service node 140, and sends the first message queue. In some embodiments, the first indication that the data compression option indicates to compress the data information corresponding to the attribute information may include an indication to compress periodic data reported by the terminal device 110.
Then, the platform service node 140 reads the first data receiving packet from the first message queue, decompresses the compressed data information in the first data receiving packet when it is determined that the session identifier carried in the first data receiving packet is valid, obtains the data information sequence, and stores the data information sequence in a background database. Thus, the platform service node 140 may obtain the decompressed data information sequence on the basis of confirming the trusted data communication of the first data receiving packet based on the session identifier.
In an embodiment, the certain time period for continuously receiving the reported data packet sent by the terminal device 110 may also be specified in a data compression option associated with the attribute information in the session identifier.
In this embodiment, a device identifier, data information, and attribute information corresponding to the data information of a terminal device 110 are obtained by analyzing a reported data packet sent by the terminal device 110 through a gateway node 120, whether a session identifier corresponding to the terminal device 110 exists in a local cache is determined according to the device identifier, if the session identifier corresponding to the terminal device 110 exists in the local cache, a data compression option associated with the attribute information is obtained from the session identifier by the gateway node 102, a first process is executed according to a first instruction for compressing the data information corresponding to the attribute information, which is indicated by the data compression option, that is, data information of the same attribute information carried in the reported data packet sent by the terminal device 110 and continuously received within a certain time period forms a data information sequence, the data information sequence is compressed to obtain compressed data information, and the session identifier and the compressed data information are assembled into a first data receiving packet and sent to a first message queue; the platform service node 140 reads the first data receiving packet from the first message queue, decompresses the compressed data information in the first data receiving packet when it is determined that the session identifier carried in the first data receiving packet is valid, obtains the data information sequence, and stores the data information sequence in a background database. Therefore, specific data compression processing codes do not need to be developed for the internet of things gateway and the cloud internet of things platform according to the application scenes of access of different terminal devices, compatibility and expandability of the internet of things platform for access of different terminal devices can be guaranteed when occupation of communication bandwidth and system resources in the internet of things platform is reduced, and personalized requirements of different terminal devices for processing reported data are met.
Fig. 3 is a partial flow diagram of a data communication method of the internet of things according to another embodiment of the present application. As shown in fig. 3, on the basis of the method steps in any of the foregoing embodiments, the step S202 may include the following steps of forming a data information sequence from data information of the same attribute information carried in a report data packet sent by the terminal device 110 and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, and assembling the session identifier and the compressed data information into a first data receiving packet:
step S301, sequentially caching the data information of the same attribute information carried in the reported data message sent by the terminal equipment and continuously received in a certain time period in the local cache;
step S302, reading the data information of the same attribute information from the local cache to form a data information sequence, compressing according to a predetermined compression coding rule to obtain the compressed data information, and assembling the session identifier, the identifier of the compression coding rule and the compressed data information into the first data receiving message.
In this embodiment, the predetermined compression encoding rule may include, but is not limited to, first order differential encoding and second order differential encoding. The first order difference coding is to keep the first data in the data information sequence unchanged, and other data is converted into the difference value of the first data or the difference value of the last data. The second order differential coding is based on the first order differential coding and uses the first order differential coding again. In this embodiment, a first order differential coding rule and a second order differential coding rule are preset in the gateway node 120 and the platform service node 140, after the gateway node 120 reads the data information of the same attribute information from the local cache to form a data information sequence, the data information sequence is compressed according to a predetermined compression coding rule to obtain the compressed data information, and then the session identifier, the identifier of the compression coding rule, and the compressed data information are assembled into the first data receiving packet. The identifier of the compression coding rule is a flag field for identifying which compression coding rule is specifically adopted by the first data receiving packet. In this way, after receiving the first data receiving packet, the platform service node 140 may decompress the corresponding compressed data information according to a specific compression coding rule, thereby implementing compatibility and personalized compression processing on the reported data packets of different terminal devices 110.
On this basis, as shown in fig. 4, on the basis of the method steps of any previous embodiment, in step S203, the platform service node 140 reads the first data receiving packet from the first message queue, and when it is determined that the session identifier carried in the first data receiving packet is valid, decompresses the compressed data information in the first data receiving packet to obtain the data information sequence, which may include the following steps:
step S401, the platform service node 140 determines whether the session identifier carried in the first data receiving packet is a session identifier corresponding to the terminal device 110 and generated by the platform service node 140;
step S402, if yes, decompressing the compressed data information in the first data receiving message according to the compressed encoding rule corresponding to the identifier of the compressed encoding rule in the first data receiving message, so as to obtain the data information sequence.
In this embodiment, after the platform service node 140 receives the first data receiving packet, it is determined whether the session identifier carried in the first data receiving packet is the session identifier corresponding to the terminal device 110 and generated by any platform service node 140, and after it is ensured that the session identifier is the session identifier corresponding to the terminal device 110 and generated by any platform service node 140, that is, the first data receiving packet belongs to trusted data communication, the corresponding compression coding rule may be further obtained according to the identifier of the compression coding rule carried in the first data receiving packet, and the corresponding compressed data information in the first data receiving packet is decompressed, so that compatibility and individualized compression processing of the reported data packets of different terminal devices 110 are achieved.
Fig. 5 is a partial flow chart of a data communication method of the internet of things according to another embodiment of the present application. As shown in fig. 5, on the basis of the method steps of any of the foregoing embodiments, after the gateway node 120 obtains the data compression option associated with the attribute information from the session identifier, the method may further include the following steps:
in step S501, the gateway node 120 executes, according to the second instruction of the data compression option instruction to not compress the data information corresponding to the attribute information, a second process: assembling the session identifier and the data information into a second data receiving message, and sending the second data receiving message to the first message queue;
step S502, the platform service node 140 reads the second data receiving packet from the first message queue, and when it is determined that the session identifier carried in the second data receiving packet is valid, parses the data information from the second data receiving packet, and stores the data information in a background database.
In this embodiment, the gateway node 120 obtains a data compression option associated with the attribute information from the session identifier, and executes a second process according to a second indication that the data information corresponding to the attribute information is not compressed, where the second indication is indicated by the data compression option, and directly assembles the session identifier and the data information into a second data receiving packet, and sends the second data receiving packet to the first message queue. In some embodiments, the second indication, indicated by the data compression option, that the data information corresponding to the attribute information is not compressed may include an indication that aperiodic data reported by the terminal device 110 is not compressed or an indication that periodic data reported by a specific terminal device 110 is not compressed, where the periodic data reported by the specific terminal device 110 may not require compression processing because of a real-time requirement of an application scenario on the reported data. Subsequently, the platform service node 140 reads the second data receiving packet from the first message queue, and when it is determined that the session identifier carried in the second data receiving packet is valid, the platform service node may directly parse the data information from the second data receiving packet, and store the data information in a background database. Therefore, specific data compression processing codes do not need to be developed for the internet of things gateway and the cloud internet of things platform according to the application scenes of access of different terminal devices, compatibility and expandability of the internet of things platform for access of different terminal devices can be guaranteed when occupation of communication bandwidth and system resources in the internet of things platform is reduced, and personalized requirements of different terminal devices for processing reported data are met.
Fig. 6 is a partial flow chart of a data communication method of the internet of things according to another embodiment of the present application. As shown in fig. 6, the embodiment of the present application may further include, on the basis of the method steps of any of the foregoing embodiments, the following steps:
step S601, if the session identifier corresponding to the terminal device 110 does not exist in the local cache, the gateway node 120 generates a token corresponding to the terminal device 110, assembles the token, the identifier of the gateway node 120, the device identifier, and the attribute information into an authentication request packet, and sends the authentication request packet to a second message queue;
step S602, the platform service node 140 reads the authentication request packet from the second message queue, generates a session identifier corresponding to the terminal device 110 after the terminal device 110 passes authentication according to the token and the device identifier in the authentication request packet, and sends the session identifier to a third message queue corresponding to the gateway node 120, where the session identifier includes the device identifier, the identifier of the gateway node 120, and a data compression option associated with the attribute information;
step S603, the gateway node 120 reads the session identifier from the third message queue, caches the session identifier in the local cache, and obtains a data compression option associated with the attribute information from the session identifier, and executes the first processing or the second processing according to a first instruction or a second instruction, indicated by the data compression option, for compressing the data information corresponding to the attribute information, or according to a second instruction for not compressing the data information corresponding to the attribute information.
In this embodiment, when the terminal device 110 first sends the reported data packet to the gateway node 120, the local cache of the gateway node 120 does not cache the session identifier corresponding to the terminal device 110, and the gateway node 120 and the platform service node 140 cannot confirm whether the terminal device 110 belongs to the trusted terminal device, so that the gateway node 120 needs to start a device authentication process. Specifically, the gateway node 120 generates a token corresponding to the terminal device 110, assembles the token, the identifier of the gateway node 120, the device identifier of the terminal device 110, and attribute information corresponding to data information in a report data packet into an authentication request packet, and sends the authentication request packet to a second message queue. After reading the authentication request message from the second message queue, the platform service node 140 authenticates the terminal device 110 according to the token and the device identifier in the authentication request message, determines whether the terminal device 110 belongs to a trusted terminal device registered in the cloud internet of things platform, generates a session identifier corresponding to the terminal device 110 after the device authentication is passed, and sends the session identifier to a third message queue corresponding to the gateway node 120, where the session identifier includes the device identifier of the terminal device 110, the identifier of the gateway node 120, and a data compression option associated with the attribute information. The gateway node 120 reads the session identifier from the third message queue, caches the session identifier in the local cache, and obtains a data compression option associated with the attribute information from the session identifier, and executes the first processing or the second processing of the foregoing embodiment according to a first instruction or a second instruction, indicated by the data compression option, for compressing data information corresponding to the attribute information, or according to a second instruction for not compressing the data information.
In one embodiment, the data compression option associated with the attribute information may be a personalized configuration option provided when each terminal device 110 registers with the cloud internet of things platform. The configuration option is obtained by performing initialization configuration by a tenant to which the terminal device 110 belongs when the terminal device 110 is registered in the cloud internet of things platform.
Table 1 below shows exemplary configuration options for terminal device 110. As shown in table 1, in the configuration options, for attribute information 1 "period data" of terminal Device 110 of Device identification Device01 and data name "DataName1" specified by attribute information 2, the flag of whether compression is enabled is set to "yes", and the compression time period is "15 minutes"; for the attribute information 1 "aperiodic data" of the terminal Device of the Device identification Device01, the data name "DataName2" specified by the attribute information 2, the flag of whether compression is enabled is set to "no", the compression time period is "0", that is, for the terminal Device 110 of the Device identification Device01, the compression processing is enabled for the periodic data of its data name "DataName1", and the compression time period (time period of one compression) is 15 minutes, and the compression processing is not enabled for the aperiodic data of its data name "DataName 2". Thus, when the platform service node 140 receives the authentication request packet, which is sent by the gateway node 120 and is addressed to the terminal Device 110 of the Device identifier Device01, if the attribute information carried in the authentication request packet includes the attribute information similar to { "periodic data", "DataName1"; the multi-component set of "aperiodic data", "DataName2" }, then the platform service node 140 generates a session identifier corresponding to the terminal device 110 after authenticating the terminal device 110, where the session identifier includes a device identifier of the terminal device 110, an identifier of the gateway node 120, and a data compression option associated with the attribute information, and the data compression option associated with the attribute information may be, for example, in the following form: { "periodic data", "DataName1", "enable compression", "15 minutes"; "aperiodic data", "DataName2", "no compression enabled", "0" }. Therefore, after the session identifier is locally cached by the gateway node 120, according to the data compression option associated with the attribute information and carried by the session identifier, for the reported data packet from the terminal Device 110 of the Device identifier Device01, data information with attribute information { "periodic data", "DataName1" } carried in the reported data packet that is continuously received within 15 minutes of each compression time period forms a data information sequence, the data information sequence is compressed to obtain compressed data information, and then the session identifier and the compressed data information are assembled into a first data receiving packet and sent to the first message queue. And for the data information with the attribute information { "aperiodic data", "DataName2" } carried in the reported data message, the compression processing is not executed after each reception, the session identifier and the data information are directly assembled into a second data receiving message, and the second data receiving message is sent to the first message queue.
As shown in table 1, for the attribute information 1 "periodic data", the data name "DataName3" and the attribute information 1 "aperiodic data" of the terminal Device 110 of the Device identification Device02, and the data name "DataName4" and the attribute information 1 "aperiodic data" of the attribute information 2, the flag indicating whether compression is enabled is set to "no", and the compression time period is "0", that is, for the terminal Device 110 of the Device identification Device02, compression processing is not enabled for both the periodic data of the data name "DataName3" and the aperiodic data of the data name "DataName 4". In this case, compression processing may not be required due to the real-time requirement of the application scenario on the reported data of the terminal Device 110 of the Device identifier Device02, so as to meet the personalized processing requirement of the application scenario of the terminal Device 110.
TABLE 1
Figure SMS_1
In some other embodiments, other attribute information such as a data name is optional in the attribute information corresponding to the data information, and a data compression option may be specified only according to the attribute information of the periodic data or the aperiodic data.
In some embodiments, the session identifier generated by platform service node 140 for the terminal device 110 and gateway node 120 includes an active time timer and a maximum validity period. The active time timer is a state attribute that characterizes the current active time of the session identifier, and the maximum validity duration is the maximum validity duration that characterizes the session identifier in the local cache of the gateway node 120. If the active time counter is greater than the maximum validity period, it indicates that the session identifier has exceeded the validity period and is in a disabled state. In such a failure state, the session identifier is cleared from the local cache of the gateway node 120, and if the gateway node 120 receives the reported data packet from the terminal device 110 again, the gateway node 120 needs to initiate an authentication request packet to the platform service node 140 again, and perform re-authentication and authentication on the terminal device 110.
In some embodiments, each time the gateway node 120 receives the report data packet sent by the terminal device 110, regardless of whether the first process or the second process is executed, the gateway node updates the active time timer of the session identifier to an initial state, so that the session identifier cached locally continues to be in a valid state.
The gateway node 120 may also periodically determine whether the active time timer of the session identifier in the local cache is greater than the maximum validity time, and if so, clear the session identifier from the local cache. Therefore, during each validity period of the session identifier, the gateway node 120 receives the reported data packet from the terminal device 110, and because the session identifier in the local cache is still in a valid state within the maximum validity duration, the gateway node 120 does not initiate an authentication request packet to the platform service node 140 for the terminal device 110 again. Only after the interval time of a single data packet report of the terminal device 110 exceeds the maximum valid duration of the session identifier, it may be determined that the terminal device 110 may have a device failure or go offline, at this time, the session identifier corresponding to the terminal device 110 is cleared from the local cache by the gateway node 120 because the session identifier exceeds the maximum valid duration, and when the terminal device 110 subsequently comes online again and sends a report data packet to the gateway node 120, the gateway node 120 may restart the authentication request packet, so that the platform service node 140 generates new session identifiers for the terminal device 110 and the gateway node 120 again. In addition, during each effective duration of the session identifier, the gateway node 120, receiving the reported data packet from the terminal device 110, updates the active time timer of the session identifier to an initial state, so as to continue to monitor and receive the reported data packet of the terminal device 110 during the next effective duration.
In some embodiments, after the platform service node 140 generates the session identifier corresponding to the terminal device 110, the method includes: the platform service node 140 stores the session identifier corresponding to the terminal device 110 in a shared cache, so that all platform service nodes 140 can access the session identifier from the shared cache. The advantage of this manner is that after any platform service node 140 of the cloud internet-of-things platform processes the authentication request packet sent by the gateway node 120 and generates unique session identifiers for the terminal device 110 and the gateway node 120, because all platform service nodes belong to the structure of peer nodes, after a distributed cluster of the cloud internet-of-things platform schedules any other platform service node to receive a first data reception packet or a second data reception packet transmitted to a first message queue by a subsequent gateway node 120 based on a load balancing mechanism, any other platform service node can perform trusted data communication authentication based on the session identifier corresponding to the terminal device 110 in the shared cache.
Fig. 7 is a partial flow chart of a data communication method of the internet of things according to another embodiment of the present application. As shown in fig. 7, on the basis of the method steps of any of the foregoing embodiments, the method may further include the steps of:
step S701, the gateway node 120 obtains, from the reported data packet, first data information, first attribute information corresponding to the first data information, second data information, and second attribute information corresponding to the second data information;
step S702, the gateway node 120 obtains data compression options associated with the first attribute information and the second attribute information from the session identifier, respectively, and executes the first processing on the first data information and the second processing on the second data information according to a first instruction that the first data information corresponding to the first attribute information is compressed and a second instruction that the second data information corresponding to the second attribute information is not compressed, which are indicated by the data compression options.
In this embodiment, the report data message sent by the terminal device 110 to the gateway node 120 carries both the first data information and the second data information, where the first data information has corresponding first attribute information, and the second data information has corresponding second attribute information. The gateway node 120 may obtain a data compression option associated with the first attribute information and the second attribute information from a session identifier in a local cache, perform the first processing on the first data information according to a first indication that the first data information corresponding to the first attribute information is compressed and indicated by the data compression option, that is, form a data information sequence from first data information that belongs to the first attribute information and is carried in a report data packet sent by the terminal device 110 and is continuously received within a certain time period, compress the data information sequence to obtain compressed data information, assemble the session identifier and the compressed data information into a first data receiving packet, and send the first data receiving packet to a first message queue. And meanwhile, according to a second indication that the second data information corresponding to the second attribute information is not compressed, which is indicated by the data compression option, executing the second processing on the second data information, namely directly assembling the session identifier and the second data information into a second data receiving message, and sending the second data receiving message to the first message queue. Therefore, different data processing can be respectively executed for the data information of multiple types of attribute information carried in the reported data message sent by each terminal device 110, and on the basis of ensuring the compatibility and expandability of the internet of things platform for accessing different terminal devices 110, the individualized processing of the reported data message of different terminal devices 110 is realized.
Fig. 8 is a schematic structural diagram of an internet of things data communication device according to an embodiment of the application. As shown in fig. 8, the data communication device of the internet of things according to the embodiment of the present application may include the following units:
a data parsing unit 801, configured to, in response to receiving a reported data packet sent by a terminal device 110, parse, by a gateway node 120, the reported data packet to obtain a device identifier, data information, and attribute information corresponding to the data information of the terminal device 110, and determine, according to the device identifier, whether a session identifier corresponding to the terminal device 110 exists in a local cache, where the session identifier includes the device identifier, an identifier of the gateway node 120, and a data compression option associated with the attribute information.
A data processing unit 802, configured to, if the session identifier corresponding to the terminal device 110 exists in the local cache, acquire, by the gateway node 120, a data compression option associated with the attribute information from the session identifier, and execute, according to a first instruction, indicated by the data compression option, for compressing data information corresponding to the attribute information, a first process: and forming a data information sequence by using the data information of the same attribute information carried in the reported data message sent by the terminal device 110 and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, assembling the session identifier and the compressed data information into a first data receiving message, and sending the first data receiving message to a first message queue.
A data receiving unit 803, configured to read the first data receiving packet from the first message queue by the platform service node 140, decompress the compressed data information in the first data receiving packet when it is determined that the session identifier carried in the first data receiving packet is valid, obtain the data information sequence, and store the data information sequence in a background database.
On the basis of any of the foregoing embodiments, the data processing unit 802 is further configured to:
sequentially caching the data information of the same attribute information carried in the reported data message sent by the terminal device 110 and continuously received within a certain time period in the local cache;
and reading the data information of the same attribute information from the local cache to form a data information sequence, compressing according to a preset compression coding rule to obtain the compressed data information, and assembling the session identifier, the identifier of the compression coding rule and the compressed data information into the first data receiving message.
On the basis of any of the foregoing embodiments, the data receiving unit 803 may further be configured to:
the platform service node 140 determines whether the session identifier carried in the first data receiving packet is a session identifier generated by the platform service node 140 and corresponding to the terminal device 110;
if so, decompressing the compressed data information in the first data receiving message according to the compression coding rule corresponding to the identifier of the compression coding rule in the first data receiving message, so as to obtain the data information sequence.
On the basis of any of the foregoing embodiments, the data processing unit 802 is further configured to:
the gateway node 120 executes, according to the second indication that the data compression option indicates that the data information corresponding to the attribute information is not compressed, a second process: assembling the session identifier and the data information into a second data receiving message, and sending the second data receiving message to the first message queue;
the platform service node 140 reads the second data receiving packet from the first message queue, and when it is determined that the session identifier carried in the second data receiving packet is valid, parses the data information from the second data receiving packet, and stores the data information in a background database.
On the basis of any of the foregoing embodiments, as shown in fig. 9, the apparatus further includes:
an authentication request unit 901, configured to generate a token corresponding to the terminal device 110 by the gateway node 120 if the session identifier corresponding to the terminal device 110 does not exist in the local cache, assemble the token, the identifier of the gateway node 120, the device identifier, and the attribute information into an authentication request packet, and send the authentication request packet to a second message queue;
a session generating unit 902, configured to read, by the platform service node 140, the authentication request packet from the second message queue, generate a session identifier corresponding to the terminal device 110 after the terminal device 110 passes authentication according to the token and the device identifier in the authentication request packet, and send the session identifier to a third message queue corresponding to the gateway node 120, where the session identifier includes the device identifier, the identifier of the gateway node 120, and a data compression option associated with the attribute information;
a session processing unit 903, configured to read the session identifier from the third message queue, cache the session identifier in the local cache, acquire a data compression option associated with the attribute information from the session identifier, and execute the first processing or the second processing according to a first instruction that the data compression option indicates to compress the data information corresponding to the attribute information or a second instruction that the data compression option indicates not to compress the data information.
On the basis of any of the foregoing embodiments, the data parsing unit 801 is further configured to: the gateway node 120 analyzes the reported data message to obtain first data information, first attribute information corresponding to the first data information, second data information, and second attribute information corresponding to the second data information;
the data processing unit 802 is further configured to: the gateway node 120 obtains data compression options associated with the first attribute information and the second attribute information from the session identifier, respectively, and performs the first processing on the first data information and the second processing on the second data information according to a first indication that the first data information corresponding to the first attribute information is compressed and a second indication that the second data information corresponding to the second attribute information is not compressed, where the first indication and the second indication are indicated by the data compression options.
According to the method and the device for data communication of the Internet of things, a gateway node analyzes a reported data message sent by a terminal device to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, judges whether a session identifier corresponding to the terminal device exists in a local cache, if the session identifier corresponding to the terminal device exists in the local cache, the gateway node obtains a data compression option associated with the attribute information from the session identifier, executes a first process according to a first indication of compressing the data information corresponding to the attribute information, indicated by the data compression option, namely, the data information of the same attribute information carried in the reported data message sent by the terminal device and continuously received within a certain time period forms a data information sequence, compresses the data information sequence to obtain compressed data information, assembles the session identifier and the compressed data information into a first data receiving message, and sends the first data receiving message to a first message queue; and the platform service node reads the first data receiving message from the first message queue, and decompresses the compressed data information in the first data receiving message to obtain the data information sequence when confirming that the session identifier carried in the first data receiving message is valid. Therefore, specific data compression processing codes do not need to be developed for the internet of things gateway and the cloud internet of things platform according to the application scenes of access of different terminal devices, compatibility and expandability of the internet of things platform for access of different terminal devices can be guaranteed when occupation of communication bandwidth and system resources in the internet of things platform is reduced, and personalized requirements of different terminal devices for processing reported data are met.
It should be noted that, those skilled in the art can understand that different embodiments described in the method embodiment of the present application, and descriptions thereof, and technical effects achieved are also applicable to the apparatus embodiment of the present application, and are not described herein again.
Further, an embodiment of the present application also provides an electronic device, where the electronic device may include: a processor and a memory. Wherein the memory stores computer program instructions, and the processor can call the computer program instructions in the memory to execute all or part of the steps of the method according to any embodiment of the present application. The computer program instructions in the memory described above may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
Further, the present application also provides a computer program product comprising a non-transitory computer readable storage medium storing a computer program, which when connected to a computer device is capable of performing all or part of the steps of the method according to any of the embodiments of the present application when the computer program is executed by one or more processors of the computer device.
Further, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which can be executed by one or more processors to perform all or part of the steps of the method described in any of the embodiments of the present application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the embodiments of the present application can be implemented by software or by software in combination with a necessary general hardware platform, and of course, can also be implemented by hardware functions. Based on such understanding, the technical solutions of the present application or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device, such as but not limited to a personal computer, a server, or a network device, to execute all or part of the steps of the method according to any embodiment of the present application. The aforementioned storage medium may include: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing computer program codes.
The foregoing describes exemplary embodiments of the present application, and it is to be understood that the above-described exemplary embodiments are not limiting, but rather are illustrative and that the scope of the present application is not limited thereto. It is to be understood that modifications and variations may be made in the embodiments of the present application by those skilled in the art without departing from the spirit and scope of the present application, and that such modifications and variations are intended to be within the scope of the present application.

Claims (10)

1. A data communication method of the Internet of things is characterized by comprising the following steps:
in response to receiving a reported data message sent by a terminal device, a gateway node analyzes the reported data message to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, and judges whether a session identifier corresponding to the terminal device exists in a local cache according to the device identifier, wherein the session identifier comprises the device identifier, the identifier of the gateway node and a data compression option associated with the attribute information;
if the session identifier corresponding to the terminal device exists in the local cache, the gateway node acquires a data compression option associated with the attribute information from the session identifier, and executes first processing according to a first indication, indicated by the data compression option, for compressing the data information corresponding to the attribute information: forming a data information sequence by using data information of the same attribute information carried in a report data message sent by the terminal equipment and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, assembling the session identifier and the compressed data information into a first data receiving message, and sending the first data receiving message to a first message queue;
and the platform service node reads the first data receiving message from the first message queue, decompresses the compressed data information in the first data receiving message when confirming that the session identifier carried in the first data receiving message is effective, obtains the data information sequence, and stores the data information sequence in a background database.
2. The internet of things data communication method according to claim 1, wherein the step of forming a data information sequence from data information of the same attribute information carried in a report data message sent by the terminal device and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, and assembling the session identifier and the compressed data information into a first data receiving message comprises:
the gateway node sequentially caches the data information of the same attribute information carried in the reported data message sent by the terminal equipment and continuously received in a certain time period in the local cache;
and reading the data information of the same attribute information from the local cache to form a data information sequence, compressing according to a preset compression coding rule to obtain the compressed data information, and assembling the session identifier, the identifier of the compression coding rule and the compressed data information into the first data receiving message.
3. The internet of things data communication method of claim 2, wherein the platform service node reads the first data receiving packet from the first message queue, and when it is determined that the session identifier carried in the first data receiving packet is valid, decompresses the compressed data information in the first data receiving packet to obtain the data information sequence, and the method includes:
the platform service node judges whether the session identifier carried in the first data receiving message is a session identifier which is generated by the platform service node and corresponds to the terminal equipment;
if so, decompressing the compressed data information in the first data receiving message according to the compression coding rule corresponding to the identifier of the compression coding rule in the first data receiving message, so as to obtain the data information sequence.
4. The data communication method of the internet of things as claimed in claim 3, wherein the method comprises, after the gateway node obtains the data compression option associated with the attribute information from the session identifier, the method further comprising:
the gateway node executes a second process according to a second instruction of the data compression option instruction for not compressing the data information corresponding to the attribute information: assembling the session identifier and the data information into a second data receiving message, and sending the second data receiving message to the first message queue;
and the platform service node reads the second data receiving message from the first message queue, analyzes the data information from the second data receiving message when confirming that the session identifier carried in the second data receiving message is valid, and stores the data information to a background database.
5. The Internet of things data communication method according to claim 4, wherein the method comprises the following steps:
if the session identifier corresponding to the terminal equipment does not exist in the local cache, the gateway node generates a token corresponding to the terminal equipment, assembles the token, the identifier of the gateway node, the equipment identifier and the attribute information into an authentication request message, and sends the authentication request message to a second message queue;
the platform service node reads the authentication request message from the second message queue, generates a session identifier corresponding to the terminal device after the authentication of the terminal device is passed according to the token and the device identifier in the authentication request message, and sends the session identifier to a third message queue corresponding to the gateway node, wherein the session identifier comprises the device identifier, the identifier of the gateway node and a data compression option associated with the attribute information;
the gateway node reads the session identifier from the third message queue, caches the session identifier in the local cache, acquires a data compression option associated with the attribute information from the session identifier, and executes the first processing or the second processing according to a first indication or a second indication, indicated by the data compression option, of compressing the data information corresponding to the attribute information.
6. The method of claim 5, wherein the session identifier comprises an active time timer and a maximum validity period, and wherein the method further comprises:
the gateway node updates an active time timer of the session identifier to an initial state when receiving a reported data message sent by the terminal device each time no matter the first processing or the second processing is executed, so that the session identifier cached locally continues to be in an effective state;
and the gateway node periodically judges whether the active time timer of the session identifier in the local cache is greater than the maximum effective duration, if so, the session identifier is removed from the local cache.
7. The Internet of things data communication method according to claim 4, wherein the method comprises the following steps:
the gateway node analyzes the reported data message to obtain first data information, first attribute information corresponding to the first data information, second data information and second attribute information corresponding to the second data information;
the gateway node respectively acquires data compression options related to the first attribute information and the second attribute information from the session identifier, respectively executes the first processing on the first data information and executes the second processing on the second data information according to a first indication that the first data information corresponding to the first attribute information is compressed and a second indication that the second data information corresponding to the second attribute information is not compressed, which are indicated by the data compression options.
8. The data communication method of the internet of things according to claim 7, wherein after the platform service node generates the session identifier corresponding to the terminal device, the method includes: the platform service node stores the session identifier corresponding to the terminal device in a shared cache, so that any platform service node can read the session identifier from the shared cache.
9. The internet of things data communication method of claim 8, wherein the certain time period comprises a compression time period specified in a data compression option associated with the attribute information in the session identifier.
10. An internet of things data communication device, comprising:
the data analysis unit is used for responding to a reported data message sent by a terminal device, analyzing the reported data message by a gateway node to obtain a device identifier, data information and attribute information corresponding to the data information of the terminal device, and judging whether a session identifier corresponding to the terminal device exists in a local cache according to the device identifier, wherein the session identifier comprises the device identifier, the identifier of the gateway node and a data compression option associated with the attribute information;
a data processing unit, configured to, if the session identifier corresponding to the terminal device exists in the local cache, obtain, by the gateway node, a data compression option associated with the attribute information from the session identifier, and execute, according to a first instruction, indicated by the data compression option, to compress the data information corresponding to the attribute information, a first process: forming a data information sequence by data information of the same attribute information carried in a report data message sent by the terminal equipment and continuously received within a certain time period, compressing the data information sequence to obtain compressed data information, assembling the session identifier and the compressed data information into a first data receiving message, and sending the first data receiving message to a first message queue;
and the data receiving unit is used for reading the first data receiving message from the first message queue by the platform service node, decompressing the compressed data information in the first data receiving message when the session identifier carried in the first data receiving message is confirmed to be valid, obtaining the data information sequence, and storing the data information sequence in a background database.
CN202310000508.0A 2023-01-03 2023-01-03 Internet of things data communication method and device Active CN115695594B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310000508.0A CN115695594B (en) 2023-01-03 2023-01-03 Internet of things data communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310000508.0A CN115695594B (en) 2023-01-03 2023-01-03 Internet of things data communication method and device

Publications (2)

Publication Number Publication Date
CN115695594A CN115695594A (en) 2023-02-03
CN115695594B true CN115695594B (en) 2023-03-07

Family

ID=85057363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310000508.0A Active CN115695594B (en) 2023-01-03 2023-01-03 Internet of things data communication method and device

Country Status (1)

Country Link
CN (1) CN115695594B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104426713A (en) * 2013-08-28 2015-03-18 腾讯科技(北京)有限公司 Method and device for monitoring network site access effect data
CN111181900A (en) * 2018-11-13 2020-05-19 杭州光启人工智能研究院 Data message sending and receiving method, storage medium and processor
CN111327675A (en) * 2020-01-19 2020-06-23 支付宝实验室(新加坡)有限公司 Session establishment method, cross-border payment method, device and system
CN111447102A (en) * 2020-02-27 2020-07-24 平安科技(深圳)有限公司 SDN network device access method and device, computer device and storage medium
CN113824675A (en) * 2020-09-17 2021-12-21 京东科技控股股份有限公司 Method and device for managing login state

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112584545B (en) * 2019-09-30 2023-06-06 华为技术有限公司 Data transmission method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104426713A (en) * 2013-08-28 2015-03-18 腾讯科技(北京)有限公司 Method and device for monitoring network site access effect data
CN111181900A (en) * 2018-11-13 2020-05-19 杭州光启人工智能研究院 Data message sending and receiving method, storage medium and processor
CN111327675A (en) * 2020-01-19 2020-06-23 支付宝实验室(新加坡)有限公司 Session establishment method, cross-border payment method, device and system
CN111447102A (en) * 2020-02-27 2020-07-24 平安科技(深圳)有限公司 SDN network device access method and device, computer device and storage medium
CN113824675A (en) * 2020-09-17 2021-12-21 京东科技控股股份有限公司 Method and device for managing login state

Also Published As

Publication number Publication date
CN115695594A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
CN110300056B (en) Real-time response type API gateway and request processing method thereof
US9753794B2 (en) Method and apparatus for controlling sending of heartbeat signal
US20090024722A1 (en) Proxying availability indications in a failover configuration
CN111200830B (en) Data transmission method and device and electronic equipment
JP2006031063A (en) Priority control system
CN110445723B (en) Network data scheduling method and edge node
CN113225339B (en) Network security monitoring method and device, computer equipment and storage medium
CN113220715A (en) Data processing method, system, computer and readable storage medium
CN114338063A (en) Message queue system, service processing method, and computer-readable storage medium
CN104468248B (en) Service performance monitoring method, reverse proxy server, statistical analysis server and system
US20120324093A1 (en) Real-time data monitoring based on data push
EP3754998A1 (en) Streaming media quality monitoring method and system
CN115695594B (en) Internet of things data communication method and device
CN108259576B (en) Software and hardware real-time information transmission system and method
CN110572350B (en) Method and equipment for carrying out IMS service registration
CN113746851B (en) Proxy system and method supporting real-time analysis of GRPC request
CN111935316B (en) Method and device for acquiring front-end equipment catalog
CN109995589B (en) Log collection method and system
CN115202800A (en) Edge cloud service data processing method and device, computer equipment and storage medium
CN112087817B (en) Wireless mobile communication system based on Internet PC terminal and communication method thereof
CN114500660B (en) Request processing method, device, equipment and computer readable storage medium
CN116647707B (en) Multicast scheduling method, device and system
CN109981660B (en) Information processing method and electronic equipment
CN109547924B (en) Position information sharing method, device, equipment and storage medium
CN116647590A (en) Data transmission method, system, equipment and 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