A data transmission method, system, device and storage medium

By flexibly configuring gateway devices and adaptively converting protocols, the problem of traditional gateway devices being unable to adapt to diverse device needs is solved, achieving efficient and accurate data transmission and improving the performance and scalability of IoT systems.

CN120729965BActive Publication Date: 2026-01-02E SURFING IOT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511165506.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2026-01-02
Estimated Expiration
2045-08-20

AI Technical Summary

Technical Problem

Traditional gateway devices lack flexible configuration capabilities and cannot adapt to the diverse needs of IoT devices, resulting in low data transmission efficiency and accuracy. Furthermore, the issues of TCP packet splitting and reassembly have not been effectively resolved, affecting the performance and scalability of IoT systems.

Method used

By determining device behavior based on device protocol parameters, the gateway can be flexibly configured for southbound and northbound traffic, including device online mode, data acquisition mode, TCP packet processing, and multi-round interaction configuration. Combined with the MQTT protocol specification, it can achieve adaptive conversion and adaptation of data formats, supporting data transmission in multiple business scenarios.

Benefits of technology

It improves the efficiency and accuracy of data transmission, solves the problems of access for different devices and cloud platform adaptation, and ensures the stability of data transmission and system performance between devices and gateways.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729965B_ABST
    Figure CN120729965B_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method, system and device and a storage medium. The method comprises the following steps: determining corresponding device behavior according to device protocol parameters in the south direction of a gateway; determining a first gateway configuration in the south direction of the gateway based on a protocol specification according to the device behavior, wherein the first gateway configuration comprises device online mode configuration, data acquisition mode configuration, TCP packet processing configuration and multi-round interaction configuration; determining a second gateway configuration in the north direction of the gateway according to a push data format in the north direction of the gateway; adjusting the format of to-be-uploaded data reported by a device into an internal data format according to the first gateway configuration, and adjusting the internal data format into a service data format according to the second gateway configuration; and uploading the to-be-uploaded data in the service data format to a cloud platform. The application can realize data configuration in multiple service scenarios, is beneficial to improving the efficiency and accuracy of data transmission, and can be widely applied to the technical field of Internet of Things.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet of Things, and in particular to a data transmission method, system and device, and a storage medium. BACKGROUND

[0002] In the Internet of Things application scenario, one of the common ways is that terminal devices are connected to the cloud through a gateway. There are a large number of inventory and incremental devices with different types, and various communication protocols are used. Most of them are application layer protocols based on TCP and UDP protocols, including general protocols, industry standard protocols, and a large number of private protocols. A large amount of development work is required for protocol connection. When the gateway connects to the cloud platform, the MQTT protocol becomes a commonly used protocol for communication between Internet of Things devices and the cloud due to its advantages of lightweight, low power consumption, support for message subscription / publishing mode, etc.

[0003] In the related art, the traditional gateway device often lacks flexible configuration capability and cannot configure device data with multiple business requirements, resulting in low efficiency and accuracy of data transmission. SUMMARY

[0004] The present application aims to at least partly solve one of the problems in the prior art.

[0005] To this end, the present application aims to provide an efficient data transmission method, system, device and storage medium.

[0006] In order to achieve the above technical purpose, the technical solution adopted by the embodiments of the present application comprises:

[0007] In one aspect, the embodiment of the present application provides a data transmission method, comprising the following steps: determining corresponding device behaviors according to device protocol parameters of a gateway southward; wherein the device protocol parameters comprise connection behaviors, data interaction behaviors, transmission layer protocol categories and data interaction logics, and the device behaviors comprise device online, device data sampling, TCP protocol and interaction behaviors; determining a first gateway configuration of the gateway southward based on protocol specifications according to the device behaviors; wherein the first gateway configuration comprises device online mode configuration, data sampling mode configuration, TCP packet processing configuration and multi-round interaction configuration; determining a second gateway configuration of the gateway northward according to a push data format of the gateway northward; adjusting a format of to-be-uploaded data reported by a device into an internal data format according to the first gateway configuration, and adjusting the internal data format into a service data format according to the second gateway configuration; uploading to-be-uploaded data in the service data format to a cloud platform. The device online mode configuration, the data sampling mode configuration, the TCP packet processing configuration and the multi-round interaction configuration are used to realize the configuration of the gateway southward, the second gateway configuration is used to realize the configuration of the gateway northward, the data configuration of multiple service scenarios can be realized, and the efficiency and accuracy of data transmission are improved.

[0008] In addition, the data transmission method according to the above embodiment of the present application can have the following additional technical features:

[0009] Further, the data transmission method of the embodiment of the present application, the device online mode configuration is determined by the following steps:

[0010] If the device is of an active connection type, an IP and a port corresponding to the device are opened, a connection with the device is established through identity authentication according to a first connection request of the device, and the device online mode configuration is realized;

[0011] If the device is of a passive connection type, an IP and a port corresponding to the device are configured, a second connection request to the device is initiated, a connection with the device is established according to a response returned from the device, and the device online mode configuration is realized.

[0012] Further, the data transmission method in the present application, the TCP packet processing configuration is determined by the following steps:

[0013] If the to-be-uploaded data is of a fixed length, the to-be-uploaded data of a preset length is integrated into a complete data packet, and the TCP packet processing configuration is realized;

[0014] Alternatively, if the to-be-uploaded data contains a preset end character, the to-be-uploaded data before the preset end character is integrated into a complete data table, and the TCP packet processing configuration is realized;

[0015] Or, if the data to be uploaded contains a preset data header, the data to be uploaded is packaged according to the packaging parameters of the preset data header, and is integrated into a complete data packet to realize TCP packet processing configuration; wherein the packaging parameters include data packet length, data type.

[0016] Further, the data transmission method in the application, the multi-round interaction configuration is determined by the following steps:

[0017] The mapping node, the analysis node, the script node and the ACK node are set to realize the multi-round interaction configuration between the device and the gateway; wherein the mapping node is used for mapping processing of key information of key value data to realize mapping of value information; the analysis node is used for extracting data conforming to a preset configuration rule from the data to be uploaded; the script node is used for writing a script to analyze the data to be uploaded; and the ACK node is used for determining a confirmation parameter of the other party in the interaction process; wherein the confirmation parameter includes message content and message format.

[0018] Further, the data transmission method in the application, the second gateway configuration includes a topic format configuration, and the topic format configuration is determined by the following steps:

[0019] A topic format customized by a device is received; wherein the topic format is a format of sending uplink data by a gateway to the cloud platform;

[0020] According to the topic format, an identity and a position of the uplink data to be written are determined to realize topic format configuration; the identity is a gateway identity, and the position is a position of the gateway identity in the uplink data.

[0021] Further, the data transmission method in the application, the second gateway configuration includes a payload format configuration, and the payload format configuration is determined by the following steps:

[0022] A payload format customized by a device is received; wherein the payload format is a format of sending uplink data by a gateway to the cloud platform;

[0023] According to the payload format, a gateway id, a first position and a sub-device id, a second position of the uplink data to be written are determined to realize payload format configuration; the first position is a position of the gateway id in the uplink data, and the second position is a position of the sub-device id in the uplink data.

[0024] Further, the data transmission method in the application, the method further includes:

[0025] According to the second gateway configuration, the format of the instruction data issued by the cloud platform is adjusted to a first data format, and according to the first gateway configuration, the first data format is adjusted to a second data format;

[0026] The instruction data in the second data format is issued to the device.

[0027] In another aspect, an embodiment of the present application provides a data transmission system, comprising:

[0028] A behavior determination module is configured to determine a corresponding device behavior according to a device protocol parameter of a gateway southbound, wherein the device protocol parameter comprises a connection behavior, a data interaction behavior, a transmission layer protocol category and a data interaction logic, and the device behavior comprises device online, device data sampling, TCP protocol and interaction behavior.

[0029] A first configuration module is configured to determine a first gateway configuration of a gateway southbound based on a protocol specification according to the device behavior, wherein the first gateway configuration comprises device online mode configuration, data sampling mode configuration, TCP packet processing configuration and multi-round interaction configuration.

[0030] A second configuration module is configured to determine a second gateway configuration of a gateway northbound according to a push data format of the gateway northbound.

[0031] A format conversion module is configured to adjust a format of to-be-uploaded data reported by a device to an internal data format according to the first gateway configuration, and adjust the internal data format to a service data format according to the second gateway configuration.

[0032] An uploading module is configured to upload to-be-uploaded data in the service data format to a cloud platform.

[0033] In another aspect, an embodiment of the present application provides a data transmission device, comprising:

[0034] At least one processor;

[0035] At least one memory for storing at least one program;

[0036] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned data transmission method.

[0037] In another aspect, an embodiment of the present application provides a storage medium, wherein a processor-executable program is stored, and the processor-executable program is used to implement the above-mentioned data transmission method when executed by a processor.

[0038] The method provided by the application comprises: determining corresponding device behaviors according to device protocol parameters of the gateway southbound; wherein the device protocol parameters comprise connection behaviors, data interaction behaviors, transport layer protocol categories and data interaction logics, and the device behaviors comprise device online, device data collection, TCP protocol and interaction behaviors; determining first gateway configurations of the gateway southbound based on protocol specifications according to the device behaviors; wherein the first gateway configurations comprise device online mode configurations, data collection mode configurations, TCP packet processing configurations and multi-round interaction configurations; determining second gateway configurations of the gateway northbound according to push data formats of the gateway northbound; adjusting formats of to-be-uploaded data reported by devices into internal data formats according to the first gateway configurations, and adjusting the internal data formats into business data formats according to the second gateway configurations; and uploading to-be-uploaded data in the business data formats to a cloud platform. The device online mode configurations, the data collection mode configurations, the TCP packet processing configurations and the multi-round interaction configurations are used to realize the configuration of the gateway southbound, the second gateway configurations are used to realize the configuration of the gateway northbound, data configurations of multiple business scenarios can be realized, and the efficiency and accuracy of data transmission can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following introduces the drawings of the related technical solutions in the embodiments of the application or the prior art. It should be understood that the drawings in the following introduction are only used to facilitate the clear description of some embodiments in the technical solutions of the application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the drawings.

[0040] Figure 1 The flowchart of one embodiment of the data transmission method provided by the application is shown in the figure.

[0041] Figure 2 The flowchart of one embodiment of the device online mode configuration provided by the application is shown in the figure.

[0042] Figure 3 The flowchart of one embodiment of the TCP packet processing configuration provided by the application is shown in the figure.

[0043] Figure 4 The flowchart of one embodiment of the multi-round interaction configuration provided by the application is shown in the figure.

[0044] Figure 5 The flowchart of one embodiment of the second gateway configuration provided by the application is shown in the figure.

[0045] Figure 6 The flowchart of another embodiment of the second gateway configuration provided by the application is shown in the figure.

[0046] Figure 7 A flowchart of an embodiment of the data delivery process provided by the present application;

[0047] Figure 8 A flowchart of another embodiment of the data transmission method provided by the present application;

[0048] Figure 9 A structural diagram of an embodiment of the data transmission system provided by the present application;

[0049] Figure 10 A structural diagram of an embodiment of the data transmission device provided by the present application. DETAILED DESCRIPTION

[0050] The embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0051] First, the terms involved in the present application are explained:

[0052] Edge side: that is, the gateway side, in the Internet of Things architecture, it is located at the network edge close to the device end, responsible for connecting devices and cloud, and the gateway device at the level of data acquisition, processing and forwarding functions.

[0053] Protocol intelligent conversion: different communication protocols used by devices, such as TCP protocol, are automatically and intelligently converted into MQTT protocol suitable for cloud interaction, including handling various problems in the protocol conversion process, to realize efficient and stable communication between devices and cloud.

[0054] TCP protocol unpacking and packing problem: when transmitting data using TCP protocol, due to its stream-oriented characteristics, multiple data packets may be stuck together and need to be unpacked (unpacking) or a data packet may be split and transmitted (packing), improper handling will cause data reception and parsing errors.

[0055] MQTT protocol: a lightweight message publishing / subscription transmission protocol, suitable for data communication between Internet of Things devices and cloud in low-bandwidth, high-latency or unstable network environment.

[0056] South configuration: refers to the configuration related to the interaction between the gateway and the device side, used to control the device access to the gateway and data acquisition and other functions.

[0057] North configuration: refers to the configuration related to the interaction of the gateway with the cloud, used to standardize the format and rules of data transmission between the gateway and the cloud.

[0058] Multi-round interaction configuration node: including mapping node, parsing node, script node, ACK node, in the communication process, support device and gateway multi-round interaction, can effectively adapt to the complex logic of Internet of Things protocol.

[0059] In the Internet of Things application scenario, the terminal device is one of the common ways to upload to the cloud through the gateway. The massive inventory and incremental equipment have different types, and the communication protocols used are also various. Most of them are application layer protocols based on TCP and UDP protocols, including general protocols, industry standard protocols, and a large number of private protocols. Protocol connection requires a lot of development work. When the gateway connects to the cloud platform, the MQTT protocol becomes a common protocol for Internet of Things devices and cloud communication due to its lightweight, low power consumption, support for message subscription / publishing mode and other advantages.

[0060] At present, when the edge side gateway device communicates with the device and the cloud, it faces many challenges. On the one hand, traditional gateway devices often lack flexible configuration capabilities and cannot meet the individualized access and data collection settings according to the needs of different devices. For example, in the online mode and data collection mode, there is usually only one fixed way, which cannot meet the needs of diversified business scenarios. On the other hand, for the TCP protocol disassembly and packaging problem, the existing solutions are either too complex, increasing the processing burden of the gateway device, or not flexible enough to adapt to different application scenarios. In addition, in the communication configuration between the gateway and the cloud, the existing technology is difficult to achieve flexible and fine configuration of the topic and payload format of the uplink and downlink messages, which affects the accuracy and efficiency of data transmission. These problems limit the overall performance and scalability of the Internet of Things system, and there is an urgent need for a new technical solution to solve it.

[0061] The application belongs to the field of Internet of Things and communication technology, and particularly relates to protocol conversion technology for edge side devices.

[0062] First refer to Figure 1The embodiment of the present application provides a data transmission method, which can be applied to a terminal, a server, software running in the terminal or the server, and the like. The terminal can be a tablet computer, a notebook computer, a desktop computer, and the like, but is not limited thereto. The server can be a physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms, and the like. Referring to Figure 1 The data transmission method provided in the embodiment of the present application mainly comprises the following steps:

[0063] In step S100, a corresponding device behavior is determined according to a device protocol parameter of a southbound gateway, wherein the device protocol parameter comprises a connection behavior, a data interaction behavior, a transport layer protocol category, and data interaction logic, and the device behavior comprises device online, device data sampling, TCP protocol, and interaction behavior.

[0064] In step S200, a first gateway configuration of the southbound gateway is determined based on a protocol specification according to the device behavior, wherein the first gateway configuration comprises device online mode configuration, data collection mode configuration, TCP packet processing configuration, and multi-round interaction configuration.

[0065] In step S300, a second gateway configuration of a northbound gateway is determined according to a push data format of the northbound gateway.

[0066] In step S400, a format of to-be-uploaded data reported by a device is adjusted to an internal data format according to the first gateway configuration, and the internal data format is adjusted to a business data format according to the second gateway configuration.

[0067] In step S500, to-be-uploaded data in the business data format is uploaded to a cloud platform.

[0068] In some possible implementation manners, the device online mode is determined according to a device protocol connection behavior of the gateway southward, the device online mode configuration of the gateway southward is determined based on a protocol specification according to the device online mode, the device data collection mode is determined according to a device protocol data interaction behavior of the gateway southward, the data collection mode configuration of the gateway southward is determined based on the protocol specification according to the device data collection mode, the TCP packet processing configuration of the gateway southward is determined based on the protocol specification if the device protocol transport layer protocol category of the gateway southward is the TCP protocol, the unpacking and packing of the to-be-uploaded data are performed, the multi-round interaction configuration of the gateway southward is determined based on the interaction parameters of the protocol specification according to the data interaction logic of the gateway southward. The protocol specification can be defined by the device. The first gateway configuration can be used in the uplink uploading process of the device to the cloud platform, or can be used in the downlink downloading process of the cloud platform to the device. It should be noted that the execution subject of steps S100 to S500 in the present application can be the gateway.

[0069] The application provides a method and system for realizing protocol adaptive conversion and cloud uploading of an edge side facing an Internet of Things terminal device, solves the compatibility problem of different device protocols and cloud uploading, meets the diversified business docking scene demand of the Internet of Things, reduces the protocol customization development workload, and improves the access efficiency of the Internet of Things device and the expansibility of the platform.

[0070] The application can realize high configurability of the gateway southward by combining the device online mode and the gateway data collection mode through flexible configuration, thereby improving the access efficiency of the complex protocol of the device.

[0071] The application can effectively process the unpacking and packing of the TCP-based Internet of Things device protocol through flexible configuration, and ensure the accuracy and stability of data transmission between the device and the gateway.

[0072] The application can support multi-round interaction by providing configurable mapping nodes, parsing nodes, script nodes and ACK nodes, ensure the interaction behavior of most complex protocols, and improve the adaptive degree of protocol conversion.

[0073] The application realizes high configurability of the topic and payload format of the MQTT protocol uplink and downlink message of the gateway northward (cloud end) through flexible configuration, and improves the ability of the gateway to adapt to different cloud platform gateway access specifications.

[0074] Further, with reference to Figure 2 The data transmission method of the embodiment of the application determines the device online mode configuration through the following steps:

[0075] Step S210, if the device is an active connection type, open the IP and port corresponding to the device, establish a connection with the device through identity authentication according to the first connection request of the device, and realize the device online mode configuration.

[0076] Step S220, if the device is a passive connection type, configure the IP and port corresponding to the device, initiate a second connection request to the device, determine to establish a connection with the device through the received response returned from the device, and realize the device online mode configuration.

[0077] For the active connection type device, the gateway can also perform legality verification on the data request.

[0078] Further, with reference to Figure 3 , the data transmission method in the application, the TCP packet processing configuration is determined by the following steps:

[0079] Step S230, if the to-be-uploaded data is of a fixed length, the to-be-uploaded data of a preset length received is integrated into a complete data packet, so as to realize the TCP packet processing configuration.

[0080] Alternatively, step S240, if the to-be-uploaded data contains a preset end character, the to-be-uploaded data before the preset end character is received is integrated into a complete data table, so as to realize the TCP packet processing configuration.

[0081] Alternatively, step S250, if the to-be-uploaded data contains a preset data header, the to-be-uploaded data is packetized according to the packetizing parameters of the preset data header, and is integrated into a complete data packet, so as to realize the TCP packet processing configuration; wherein, the packetizing parameters include data packet length, data type.

[0082] The fixed length can be the length of the to-be-uploaded data, and the specific values of the fixed length and the preset length can be adjusted; the preset length is the data length of each complete packet after the TCP protocol is packetized. The method provided in the application further includes, if the length of the to-be-uploaded data currently received is less than the preset length, waiting for subsequent to-be-uploaded data. The preset end character can be a character at the end of each complete data packet for packetizing the to-be-uploaded data. The preset data header can be a character at the front of each complete data packet for packetizing the to-be-uploaded data.

[0083] Further, with reference to Figure 4 , the data transmission method in the application, the multi-round interaction configuration is determined by the following steps:

[0084] Step S260, setting a mapping node, an analysis node, a script node, and an ACK node to implement multi-round interaction configuration between the device and the gateway; the mapping node is used for mapping key information of the key-value data to implement mapping of the value information; the analysis node is used for extracting data meeting the preset configuration rule from the to-be-uploaded data; the script node is used for writing a script to analyze the to-be-uploaded data; and the ACK node is used for determining a confirmation parameter of the other party in the interaction process; the confirmation parameter includes message content and message format.

[0085] The value information in the present application can be a device identifier. The preset configuration rule is a determined behavior and a data parameter corresponding to the behavior. The configuration of the ACK node can enable the confirmation parameter of the other party to be received, and the data interaction can be confirmed to be successful.

[0086] Further, with reference to Figure 5 The data transmission method in the present application includes topic format configuration of the second gateway, and the topic format configuration is determined through the following steps.

[0087] Step S270, receiving a topic format defined by the device; the topic format is a format of uplink data sent by the gateway to the cloud platform.

[0088] Step S280, determining an identifier and a position of the uplink data to be written according to the topic format, to implement the topic format configuration; the identifier is a gateway identifier, and the position is a position of the gateway identifier in the uplink data.

[0089] According to the topic format defined by the device, the gateway identifier of the current gateway is written into the uplink data sent by the gateway to the cloud platform.

[0090] Further, with reference to Figure 6 The data transmission method in the present application includes payload format configuration of the second gateway, and the payload format configuration is determined through the following steps.

[0091] Step S291, receiving a payload format defined by the device; the payload format is a format of uplink data sent by the gateway to the cloud platform.

[0092] Step S292, determining a gateway id, a first position, a sub-device id, and a second position of the uplink data to be written according to the payload format, to implement the payload format configuration; the first position is a position of the gateway id in the uplink data, and the second position is a position of the sub-device id in the uplink data.

[0093] Further, with reference to Figure 7 The data transmission method in the present application further includes:

[0094] Step S600, according to the second gateway configuration, the format of the instruction data issued by the cloud platform is adjusted to the first data format, and according to the first gateway configuration, the first data format is adjusted to the second data format;

[0095] Step S700, the instruction data in the second data format is issued to the device.

[0096] The second data format is a data format that can be recognized by the device.

[0097] Reference will now be made to Figure 8 The data transmission method provided by the application is described in detail with specific embodiments:

[0098] The application is applied on the edge side, that is, the gateway device (herein, referring to the general gateway, including but not limited to the narrow-sense gateway box, edge all-in-one machine, computer and edge-side device capable of running an operating system), and the requirements of different types of devices and platforms are comprehensively considered. By providing highly flexible configuration capability and protocol adaptation conversion engine, the corresponding protocol configuration is quickly built for different business logic protocols, and the access of the device and the docking of the platform are flexibly and efficiently realized. The architecture diagram is shown in the accompanying Figure 8 The gateway southward adaptive configuration and the gateway northward adaptive configuration are mainly included.

[0099] 1. Gateway southward adaptive configuration.

[0100] The gateway southward, that is, the adaptive configuration of the device side, mainly includes four aspects, that is, the device online mode configuration, the data acquisition mode configuration, the TCP packet processing configuration and the multi-round interaction configuration.

[0101] 1) Support for device online mode configuration.

[0102] The device online mode is usually divided into two categories, that is, the active connection type and the passive connection type, that is, the device actively connects the gateway and the gateway actively connects the device.

[0103] When the device is of the active connection type, no information needs to be configured on the gateway side, the gateway only needs to open the corresponding IP and port, wait for the device connection request, and perform device verification. The device initiates a connection request, sends an online request packet containing device ID, device type and other information to the gateway according to the preset rules, the gateway receives the request and performs legality verification and identity authentication. For example, when the device starts, according to the configuration information stored by itself, an online request packet containing device ID, device type and other information is sent to the specific IP address and port of the gateway. After receiving the request packet, the gateway verifies the legality of the device by querying the local device information library. If the device is legal, an online confirmation message is returned; if it is not legal, it is refused to be online and an error message is sent.

[0104] When the device is a passive connection type, the IP and port of the device are configured on the gateway side, and the connection request is initiated by the gateway. The gateway supports setting a periodic scanning device list, and sends a connection request message to the device that is not online. After receiving the request, the device responds and completes the online process.

[0105] 2) Support for data collection mode configuration.

[0106] Data collection modes are usually also divided into two categories: active reporting and passive collection, i.e., device active reporting and gateway active collection.

[0107] In the device active reporting mode, no configuration is required on the gateway side. The device sends the collected data to the gateway according to the set time interval or event trigger mechanism. For example, an environmental monitoring device collects temperature, humidity, and other data at certain time intervals and sends these data in a specific format to the gateway. After receiving the data packet, the gateway performs data analysis and processing.

[0108] In the gateway active collection mode, the gateway side supports configuration of collection tasks, including but not limited to point information, data type, collection instruction, collection length, etc., and sends data collection requests to the device at regular intervals. After receiving the instruction, the device returns the collected data to the gateway.

[0109] 3) Support for TCP protocol packet processing configuration.

[0110] If the device uses a TCP protocol-based application layer protocol to report data, there is a problem of TCP packet disassembly and assembly. The present application supports the configuration of the following four TCP packet processing methods.

[0111] Fixed-length packet processing method: For fixed-length data packets, the gateway performs packet processing according to the pre-configured length when receiving data. For example, assuming that each data packet has a fixed length of 1024 bytes, the gateway reads 1024 bytes of data from the receive buffer as a complete data packet for processing each time. If the buffer data is less than 1024 bytes, wait for the data to be supplemented until it is full 1024 bytes before processing.

[0112] Special end symbol processing method: Each TCP data packet carries a special end symbol, such as "\r\n" or other custom end identifier. The gateway identifies the boundaries of the data packet by looking for the special end symbol according to the configuration information. When the gateway receives data, it starts from the beginning of the receive buffer to find the special end symbol. After finding it, the data before the end symbol is treated as a complete data packet, and then the search for the next data packet starts from the position after the end symbol.

[0113] Message header-based processing mode: Add a message header containing information such as packet length and data type to the header of the data packet. After receiving the data, the gateway first parses the message header according to the configuration information to obtain the length information of the data packet, and then reads the data of the corresponding length from the receive buffer as a complete data packet for processing according to the length information. For example, the message header specifies that the data packet length occupies 4 bytes. After receiving the data, the gateway first reads the first 4 bytes to parse the data packet length, and then reads the subsequent data according to the length for processing.

[0114] Custom (support dynamic scripts) processing mode: Support users to define the processing rules of data packets by writing dynamic scripts. For example, users can write scripts to implement the parsing of complex data packet structures according to specific business requirements. Scripts can make flexible judgments and processing according to the content and characteristics of data packets, and implement personalized unpacking and packet assembly solutions. After receiving the data, the gateway calls the corresponding script to process the data and parses it into complete data packets.

[0115] 4) Support for multi-round interaction configuration.

[0116] Multi-round interaction between devices and gateways is achieved by setting mapping nodes, parsing nodes, script nodes, and ACK nodes.

[0117] Mapping node: Mainly for key:value format data, mapping key1 in the data to key2, such as gateway internal protocol conversion specification stipulates that the device unique identifier is deviceId, while the device reported data uses deviceCode to identify the device unique identifier. At this time, the mapping node can be used to map deviceCode to deviceId; or store the value corresponding to a key in a global variable for use in protocol conversion.

[0118] Parsing node: Extract data that meets certain configuration rules from the message data, such as extracting the string with index 3-9, or extracting the type node content in json, etc. The configuration rules can be further extended according to requirements.

[0119] Script node: Support writing scripts (such as java, js, python, etc.) in the node to parse message data that cannot be parsed by existing node types. The input parameters and output values of the script are fixed types.

[0120] ACK node: Some protocols with complex interaction logic usually have an acknowledgment operation. During the communication process between the two parties, after one party sends a data packet, it is considered that the data interaction is successful only after receiving the ACK confirmation message returned by the other party. For example, in the device online process, after the device sends an online request packet, the gateway receives the request packet and verifies it, and then sends an ACK packet containing the online confirmation information to the device according to the pre-configured ACK format according to the protocol specification. After the device receives the ACK packet, it confirms that the online is successful. The ACK format supports user customization, and the user can set the content and format of the ACK packet according to the business requirements, such as adding additional status information, timestamps, etc.

[0121] 2. Gateway northward adaptive configuration.

[0122] Support gateway northward, that is, adaptive configuration on the cloud platform side. Since the gateway and the cloud platform usually interact through the MQTT protocol, the present application is based on the MQTT protocol specification to clarify the gateway northward adaptive configuration capability. Although the communication protocol has been determined, the format specifications of the business data part of different cloud platforms are different, which leads to the fact that the gateway data can only be reported in a transparent manner without changing the code on both sides, otherwise one side needs to adapt to the other side.

[0123] The present application supports the configuration of business data specifications based on the MQTT protocol Json format, in order to realize the adaptation of gateway uplink and downlink data messages to different cloud platforms. The configuration content mainly includes topic configuration and payload configuration.

[0124] Support for topic format configuration of uplink messages: the gateway supports user-defined topic format of uplink messages, which includes the placement of gateway id in the topic. For example, the user can configure the topic format as “iot / gw / device / {gateway_id} / data / upload” according to the format requirements of the cloud platform for the topic, where “gateway_id” represents the unique identifier of the gateway, and “{gateway_id}” is a placeholder for the gateway id. When the gateway sends an uplink message to the cloud, it fills in its own gateway id at the placeholder position to generate a complete topic. In this way, the cloud can confirm whether the message is compliant according to the topic, and accurately distinguish the uplink data from different gateways.

[0125] Supporting the configuration of the payload format of the uplink message: the user can configure the payload format of the uplink message, and the main configuration point is the placement position of the device id (gateway or sub-device) in the payload. For example, according to the gateway protocol specification of the cloud platform, when the payload in the Json format is configured, the gateway id is placed in the "gateway_id" field, and the sub-device id is placed in the "device_list[0].device_id" field (assuming the first device in the device list). When the gateway assembles the payload of the uplink message, the relevant id information is filled into the corresponding position according to the configured format, so that the cloud can accurately obtain the information of the sub-device and the gateway, and thus the business data can be accurately placed under the corresponding device.

[0126] Supporting the configuration of the topic format of the downlink message: similar to the uplink message, the gateway supports the configuration of the topic format of the downlink message, and the placement position of the gateway id in the topic. For example, the topic format of the downlink message is configured as "iot / gw / device / {gateway_id} / command / down", wherein "gateway_id" represents the unique identifier of the gateway, and "{gateway_id}" is the placeholder of the gateway id. When the cloud platform publishes the downlink instruction, the corresponding topic will be carried, and different gateway devices will subscribe to the topic belonging to themselves, so as to ensure that the message belonging to themselves is received.

[0127] The configuration of the payload format of the downlink message: the user can configure the payload format of the downlink message, and the placement position of the device id (gateway or sub-device) and the instruction id in the payload. For example, the payload format of the downlink message is configured as the Json format, the gateway id is placed in the "gateway_id" field, the sub-device id is placed in the "device_list[0].device_id" field (assuming the first device in the device list), and the instruction id is placed in "device_list[0].cmd_id". After the gateway receives the downlink message, the payload is parsed according to the configured format, the id information of the instruction and the related device is obtained, and then it is determined whether the instruction content belongs to itself, and the instruction is processed locally or forwarded to the corresponding sub-device.

[0128] In summary, the overall process of the edge-side device uploading to the cloud through the method and system described in the present application is as follows:

[0129] Step S81: analyzing the device protocol connection behavior, determining the device online mode, and performing corresponding parameter configuration according to the method described above;

[0130] Step S82, the analysis device protocol data interaction behavior is determined Device number sampling mode, and the corresponding parameter configuration is carried out according to the method described above;

[0131] Step S83, the analysis device protocol transmission layer protocol category, if it is TCP protocol, then according to the protocol specification, corresponding unpacking, packet configuration is carried out;

[0132] Step S84, the analysis device protocol data interaction logic, according to whether there is interaction, message category, field type definition, etc. Specific protocol specification, combined with mapping node, analysis node, script node, ACK node, the Payload layer of protocol is parsed and responded.

[0133] Step S85, the protocol adaptive conversion engine described in the application executes the protocol conversion process configured in steps S81 to S84, converts the device reported data into internal data format (usually Json format), and saves to local database for persistence;

[0134] Step S86, according to the cloud platform gateway access specification, the northward push data conversion configuration, the protocol adaptive conversion engine described in the application is converted into the business data format that the cloud platform can identify according to the configuration, finally completes the conversion of device data to cloud;

[0135] Step S87, the instruction is similar to the whole configuration process of data reporting, but the data flow direction is opposite, that is, under the drive of the protocol adaptive conversion engine described in the application, the cloud platform instruction is first converted into internal data format, and is encoded into the format that the device can identify according to the device protocol specification and is sent to the device.

[0136] The application provides a kind of Internet of Things terminal device adaptive protocol conversion and cloud method and system, by providing flexible configuration capability and protocol adaptation conversion engine, solve the compatibility problem of different device protocol access and with cloud;

[0137] The application provides a kind of through flexible configuration mode, adaptation Internet of Things terminal device online mode, number sampling mode, realizes the highly configurable device adaptive access engine of device protocol automatic conversion, so as to improve the access efficiency of complex device protocol;

[0138] The application provides a kind of through flexible configuration mode, effectively handle the device adaptive access engine based on TCP of Internet of Things device protocol unpacking, packet problem, ensure the accuracy and stability of data transmission between device and gateway;

[0139] The application realizes the multi-round interaction capability of the device and the gateway and the platform by providing highly configurable mapping nodes, parsing nodes, script nodes and ACK nodes, supports the interaction behavior of adapting to most complex protocols, and improves the protocol conversion adaptability.

[0140] The application provides a way of flexibly configuring the topic and payload format in the MQTT message, realizes the adaptive adaptation of the uplink and downlink specifications of the gateway and the northbound (cloud platform) business data, and improves the ability of the gateway to adapt to different cloud platforms.

[0141] The application improves compatibility and flexibility: through various configuration options of the gateway southbound, it can adapt to the access requirements of different types of devices. Whether the device initiates the request or the gateway initiates the request online mode, and the data collection mode of device active reporting or gateway active collection, can be flexibly selected according to the device characteristics and business requirements, greatly improving the compatibility of the gateway and various devices. At the same time, the flexibility of northbound configuration enables the gateway to communicate with the cloud to meet the diversified business scenarios, and different topic and payload format configurations can adapt to different cloud platforms and application requirements, enhancing the scalability of the system.

[0142] The application ensures data transmission accuracy: for the unpacking and packing of TCP protocol, multiple flexible configuration processing methods are provided, including fixed length, special end symbol, message header based and custom (supporting dynamic script) processing methods. These methods can select the most suitable processing method according to the data characteristics of different devices, effectively solve the error and loss problem in the data transmission process, and ensure the accuracy and stability of data transmission between devices and gateways.

[0143] The application enhances communication reliability: supports multi-round interaction and sets mapping nodes, parsing nodes, script nodes and ACK nodes to ensure the flexibility and reliability of communication between devices and gateways. This mechanism can adapt to the interaction behavior of most complex protocols, avoid data loss and transmission errors, and improve the protocol conversion adaptability.

[0144] The application improves the overall performance of the system: the protocol intelligent conversion method and system of the application optimize the communication process between the edge gateway device and the device and the cloud, reduce the data processing and transmission errors, improve the data transmission efficiency, and thus improve the overall performance of the Internet of Things system, providing more reliable technical support for smart home, industrial Internet of Things and other Internet of Things application scenarios.

[0145] The prior art scheme: a customized development method is adopted, and customized development is carried out for each protocol, and there are the defects of large workload and long cycle; some protocol conversion configuration schemes, on the one hand, do not consider the factors of the on-line mode and the data sampling mode of the equipment in the southward configuration, and lack the processing of the unpacking and packing problems of the TCP type protocol, and on the other hand, the adaptation of the northward platform is not considered.

[0146] The application comprehensively and in detail considers the adaptability of the edge side south-north service, provides a complete device protocol adaptive conversion cloud uploading process method, can meet the docking requirements of different types of device protocols in the southward, and can adapt to the access requirements of the northward platform, and can effectively reduce the workload of customized development of device protocols.

[0147] In the southward device protocol configuration access, on the one hand, the differentiated configuration problems caused by the on-line mode and the data sampling mode of the southward device are solved, and the unpacking and packing problems of the TCP type protocol configuration are solved, and meanwhile, the ability of adapting to complex protocols is improved by increasing a plurality of protocol conversion configuration nodes; on the other hand, through the configuration method, the adaptive adaptation problem of the northward platform is solved, and a quick and flexible communication bridge is built for the equipment and the platform.

[0148] The application is particularly suitable for the business scenario of the edge side of the Internet of Things field accessing the device through the gateway mode and uploading to the cloud.

[0149] Secondly, referring to the accompanying Figure 9 The application provides a data transmission system, and the system specifically comprises:

[0150] The behavior determination module 710 is configured to determine the corresponding device behavior according to the device protocol parameters of the gateway southward, wherein the device protocol parameters comprise connection behavior, data interaction behavior, transmission layer protocol type and data interaction logic, and the device behavior comprises device on-line, device data sampling, TCP protocol and interaction behavior.

[0151] The first configuration module 720 is configured to determine the first gateway configuration of the gateway southward based on the protocol specification according to the device behavior, wherein the first gateway configuration comprises device on-line mode configuration, data sampling mode configuration, TCP packet processing configuration and multi-round interaction configuration.

[0152] The second configuration module 730 is configured to determine the second gateway configuration of the gateway northward according to the push data format of the gateway northward.

[0153] The format conversion module 740 is configured to adjust the format of the to-be-uploaded data reported by the device to an internal data format according to the first gateway configuration, and adjust the internal data format to a service data format according to the second gateway configuration.

[0154] The uploading module 750 is configured to upload the to-be-uploaded data in the service data format to a cloud platform.

[0155] It can be seen that the content in the method embodiments is applicable to the system embodiments, the system embodiments specifically implement the functions of the method embodiments, and achieve the same beneficial effects as the method embodiments.

[0156] With reference to Figure 10 The data transmission device provided by the embodiment of the application comprises:

[0157] The at least one processor 810 is configured to execute the at least one program.

[0158] The at least one memory 820 is configured to store the at least one program.

[0159] When the at least one program is executed by the at least one processor 810, the at least one processor 810 implements the data transmission method.

[0160] Similarly, the content in the method embodiments is applicable to the device embodiments, the device embodiments specifically implement the functions of the method embodiments, and achieve the same beneficial effects as the method embodiments.

[0161] The embodiment of the application further provides a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for executing the data transmission method when the program executable by the processor is executed by the processor.

[0162] Similarly, the content in the method embodiments is applicable to the storage medium embodiments, the storage medium embodiments specifically implement the functions of the method embodiments, and achieve the same beneficial effects as the method embodiments.

[0163] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two blocks shown in succession can actually be executed substantially simultaneously or the blocks can sometimes be executed in reverse order. In addition, the embodiments presented and described in the flowcharts of the application are provided by way of example, and the purpose is to provide a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently executed.

[0164] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It will also be appreciated that detailed discussion of the actual implementation of each module is not necessary to an understanding of the application. Rather, the actual implementation of the modules, in light of the attributes, functions, and internal relationships of the various functional modules disclosed herein, will be apparent to one of ordinary skill in the art given the benefit of this disclosure. Accordingly, the present application is not limited to the specific embodiments illustrated herein, but is applicable for use in general with any device that can benefit from the functionality of the present application. It will also be appreciated that the specific concepts disclosed herein are merely illustrative of the application and that changes in implementation and design can be made without departing from the spirit of the application. The scope of the application is to be determined by the claims appended hereto, along with the full scope of equivalents to which such claims are entitled.

[0165] If the functions are implemented in software, the functions can be stored in or implemented as one or more computer program products, which can be incorporated into a computer-readable medium for use by or in connection with an apparatus, method, or system as described herein. The computer-readable medium can be a machine-readable storage device, an article of manufacture, or a computer program product. The computer-readable medium can be a non-transitory computer-readable medium. The computer-readable medium can be a tangible computer-readable medium. In this case, a tangible computer- readable medium can be considered to be a machine-readable storage device, an article of manufacture, or a computer program product. The tangible computer-readable medium can have stored thereon code or a computer program, software, or instructions that can be executed by or to configure one or more processors to perform a method described herein. The computer program product can have one or more features of a computer-readable medium described herein.

[0166] The logic and / or steps represented in the flowcharts and / or otherwise described herein, for example, can be embodied in computer-readable medium, which can be executed by a processing circuitry, such as a computer-based system, server, or other processing system. The computer-readable medium can be a non-transitory computer-readable medium. In this case, a tangible computer-readable medium can be considered to be a machine-readable storage device, an article of manufacture, or a computer program product. The tangible computer-readable medium can have stored thereon code or a computer program, software, or instructions that can be executed by or to configure one or more processors to perform a method described herein. The computer program product can have one or more features of a computer-readable medium described herein.

[0167] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0168] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above described embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable

[0169] In the above description of the present application, reference has been made to descriptive terms such as "one embodiment," "another embodiment," "some embodiments," etc. Such descriptive terms mean that a particular feature, structure, material or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily referring to the same embodiment. Further, when a particular feature, structure, material or characteristic is described in connection with any one or more embodiments, it is submitted that it is within the purview of the inventor(s) to effect such feature, structure, material or characteristic in connection with any other or all embodiments.

[0170] While the embodiments of the present application have been shown and described, it is to be understood that various modifications, substitutions, combinations, and alterations can be made to the embodiments without departing from the spirit and scope of the present application, which is defined by the following claims and their equivalents.

[0171] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the described embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present application, and these equivalent modifications or substitutions are included in the scope of the present application defined by the claims.

Claims

1. A data transmission method, characterized in that, Includes the following steps: Based on the device protocol parameters of the gateway southbound, the corresponding device behavior is determined; wherein, the device protocol parameters include connection behavior, data interaction behavior, transport layer protocol type and data interaction logic, and the device behavior includes device online, device data collection, TCP protocol and interaction behavior; Based on the device behavior and the protocol specifications, the first gateway configuration for the southbound direction is determined; wherein, the first gateway configuration includes device online mode configuration, data acquisition mode configuration, TCP packet processing configuration, and multi-round interaction configuration; Based on the push data format of the gateway to the north, determine the configuration of the second gateway to the north. According to the configuration of the first gateway, the format of the data to be uploaded reported by the device is adjusted to the internal data format, and according to the configuration of the second gateway, the internal data format is adjusted to the business data format; Upload the data to be uploaded in the aforementioned business data format to the cloud platform; The device online mode configuration is determined through the following steps: If the device is an active connection type, open the corresponding IP and port of the device, and establish a connection with the device through authentication according to the first connection request of the device to realize the device online mode configuration; If the device is a passive connection type, configure the IP address and port corresponding to the device, initiate a second connection request for the device, and determine the establishment of a connection with the device based on the response returned from the device, so as to realize the device online mode configuration.

2. The data transmission method according to claim 1, characterized in that, The TCP packet processing configuration is determined through the following steps: If the data to be uploaded is of fixed length, the received data of the preset length will be integrated into a complete data packet to realize TCP packet processing configuration; Alternatively, if the data to be uploaded contains a preset end character, the data to be uploaded before receiving the preset end character is integrated into a complete data table to realize TCP packet processing configuration; Alternatively, if the data to be uploaded contains a preset data header, the data to be uploaded is divided into packets according to the packetization parameters of the preset data header and integrated into a complete data packet to realize TCP packet processing configuration; wherein, the packetization parameters include data packet length and data type.

3. The data transmission method according to claim 1, characterized in that, The multi-round interaction configuration is determined through the following steps: A mapping node, a parsing node, a script node, and an ACK node are configured to enable multi-round interaction between the device and the gateway. The mapping node maps key information of key-value data to value information. The parsing node extracts data conforming to preset configuration rules from the data to be uploaded. The script node writes scripts to parse the data to be uploaded. The ACK node determines the confirmation parameters from the other party during the interaction process; these confirmation parameters include message content and message format.

4. The data transmission method according to claim 1, characterized in that, The second gateway configuration includes a topic format configuration, which is determined through the following steps: The receiving device defines a topic format; wherein, the topic format is the format in which the gateway sends uplink data to the cloud platform; Based on the topic format, determine the identifier and position to be written into the uplink data to achieve topic format configuration; the identifier is the gateway identifier, and the position is the location of the gateway identifier in the uplink data.

5. The data transmission method according to claim 1, characterized in that, The second gateway configuration includes a payload format configuration, which is determined through the following steps: The receiving device defines a payload format; wherein the payload format is the format in which the gateway sends uplink data to the cloud platform. Based on the payload format, the gateway ID, first position, sub-device ID, and second position to be written into the uplink data are determined to achieve payload format configuration; the first position is the position of the gateway ID in the uplink data, and the second position is the position of the sub-device ID in the uplink data.

6. The data transmission method according to claim 1, characterized in that, The method further includes: According to the second gateway configuration, the format of the instruction data issued by the cloud platform is adjusted to the first data format, and according to the first gateway configuration, the first data format is adjusted to the second data format; The instruction data in the second data format is sent to the device.

7. A data transmission system, characterized in that, include: The behavior determination module is used to determine the corresponding device behavior based on the device protocol parameters of the gateway southbound; wherein, the device protocol parameters include connection behavior, data interaction behavior, transport layer protocol type and data interaction logic, and the device behavior includes device online, device data acquisition, TCP protocol and interaction behavior; The first configuration module is used to determine the first gateway configuration for the southbound direction of the gateway based on the device behavior and the protocol specifications; wherein, the first gateway configuration includes device online mode configuration, data acquisition mode configuration, TCP packet processing configuration and multi-round interaction configuration; The second configuration module is used to determine the second gateway configuration for the northbound gateway based on the push data format of the gateway. The format conversion module is used to adjust the format of the data to be uploaded reported by the device to the internal data format according to the configuration of the first gateway, and to adjust the internal data format to the business data format according to the configuration of the second gateway. The upload module is used to upload the data to be uploaded in the business data format to the cloud platform; The device online mode configuration is determined through the following steps: If the device is an active connection type, open the corresponding IP and port of the device, and establish a connection with the device through authentication according to the first connection request of the device to realize the device online mode configuration; If the device is a passive connection type, configure the IP address and port corresponding to the device, initiate a second connection request for the device, and determine the establishment of a connection with the device based on the response returned from the device, so as to realize the device online mode configuration.

8. A data transmission device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the data transmission method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the data transmission method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method and device in data acquisition gateway based on Mqtt protocol and JSON message

    CN119071287A