CN117459610A - Data transmission method, device and equipment based on double protocols and readable storage medium - Google Patents

Data transmission method, device and equipment based on double protocols and readable storage medium Download PDF

Info

Publication number
CN117459610A
CN117459610A CN202311319134.5A CN202311319134A CN117459610A CN 117459610 A CN117459610 A CN 117459610A CN 202311319134 A CN202311319134 A CN 202311319134A CN 117459610 A CN117459610 A CN 117459610A
Authority
CN
China
Prior art keywords
data
data transmission
equipment
internet platform
protocol
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.)
Pending
Application number
CN202311319134.5A
Other languages
Chinese (zh)
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.)
Hangzhou Jiuxin Internet Of Things Science & Technology Co ltd
Original Assignee
Hangzhou Jiuxin Internet Of Things Science & Technology 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 Hangzhou Jiuxin Internet Of Things Science & Technology Co ltd filed Critical Hangzhou Jiuxin Internet Of Things Science & Technology Co ltd
Priority to CN202311319134.5A priority Critical patent/CN117459610A/en
Publication of CN117459610A publication Critical patent/CN117459610A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a data transmission method, a device, equipment and a readable storage medium based on double protocols, which relate to the technical field of data transmission, wherein the data transmission method based on double protocols comprises the steps of establishing communication connection between an edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform; under the condition that a data acquisition instruction issued by the Internet platform is received through the control instruction channel, responding to the data acquisition instruction, and acquiring equipment data of target equipment; and transmitting the equipment data to the Internet platform through the data transmission channel. According to the method and the device, based on the fact that the edge gateway uploads the data in time, network bandwidth or wireless traffic overhead can be reduced by reducing the size of data transmission, and the safety of data transmission can be improved.

Description

Data transmission method, device and equipment based on double protocols and readable storage medium
Technical Field
The present disclosure relates to the field of data transmission technologies, and in particular, to a data transmission method, device, equipment and readable storage medium based on dual protocols.
Background
The industrial Internet is a novel infrastructure, an application mode and industrial ecology which are deeply fused with a new generation of information communication technology and industrial economy, and a brand new manufacturing and service system which covers a full industrial chain and a full value chain is constructed by comprehensively connecting people, machines, objects, systems and the like, so that an implementation way is provided for the development of industry and even industry digitization, networking and intellectualization.
At present, an edge gateway is generally required to be configured at the network edge side of an industrial internet so as to collect industrial data through the edge gateway and transmit the industrial data to an internet platform of the industrial internet for data storage, analysis and application, however, because control instruction transmission and data transmission between the edge gateway and the internet platform of the industrial internet are completed through the same channel, a process of control instruction transmission and data transmission cannot be performed between the edge gateway and the internet platform at the same time, so that the edge gateway is easy to be unable to transmit the industrial data to the internet platform in time due to control instruction transmission still performed in the channel after the industrial data is collected, and therefore, the problem of poor timeliness of data transmission exists between the internet platform of the existing industrial internet and the edge gateway.
Disclosure of Invention
The main purpose of the application is to provide a data transmission method, a device, an electronic device and a readable storage medium based on double protocols, which aim to solve the technical problem that the timeliness of data transmission is poor between an internet platform and an edge gateway of the existing industrial internet.
In order to achieve the above object, the present application provides a data transmission method based on dual protocols, which is applied to an edge gateway, and the data transmission method based on dual protocols includes:
establishing communication connection between the edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform;
under the condition that a data acquisition instruction issued by the Internet platform is received through the control instruction channel, responding to the data acquisition instruction, and acquiring equipment data of target equipment;
and transmitting the equipment data to the Internet platform through the data transmission channel.
Optionally, the step of acquiring device data of the target device in response to the data acquisition instruction includes:
responding to the data acquisition instruction, and acquiring acquisition information carried by the data acquisition instruction, wherein the acquisition information comprises a data access address, acquisition frequency and acquisition protocol;
Determining a data acquisition area of the target equipment according to the data access address;
and acquiring equipment data of the data acquisition area based on the acquisition frequency and the acquisition protocol.
Optionally, the step of transmitting the device data to the internet platform through the data transmission channel includes:
packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
and transmitting the data of the packaging equipment to the Internet platform through the data transmission channel.
Optionally, the device data includes a plurality of pieces of sub-device data, and the step of packaging the device data based on the binary message protocol to obtain packaged device data includes:
acquiring a time stamp corresponding to the equipment data and a gateway number of the edge gateway, and counting the number of each piece of sub-equipment data to obtain the data number;
analyzing the time stamp, the gateway number and the data quantity to obtain a target time stamp, a target gateway number and a target data quantity;
coding each piece of sub-equipment data based on the data type of each piece of sub-equipment data to obtain each piece of packaged sub-equipment data;
And combining the target timestamp, the target gateway number, the target data quantity and each piece of packaging sub-equipment data to obtain the packaging equipment data.
Optionally, the step of transmitting the device data to the internet platform through the data transmission channel includes:
acquiring key information carried by the data acquisition instruction;
encrypting the device data based on the key information to obtain encrypted device data;
and transmitting the data of the encryption equipment to the Internet platform through the data transmission channel.
Optionally, the key information includes an asymmetric key or a symmetric key, and the step of encrypting the device data based on the key information to obtain encrypted device data includes:
based on an asymmetric encryption algorithm, encrypting the device data through the asymmetric key to obtain the encrypted device data;
or based on a symmetric encryption algorithm, carrying out encryption processing on the device data through the symmetric key to obtain the encrypted device data.
Optionally, the step of transmitting the device data to the internet platform through the data transmission channel includes:
Packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
encrypting the packaging equipment data based on key information carried by a data acquisition instruction to obtain target equipment data;
and transmitting the target equipment data to the Internet platform through the data transmission channel.
The application also provides a data transmission device based on double protocols, which is applied to an edge gateway, and the data transmission device based on double protocols comprises:
the communication module is used for establishing communication connection between the edge gateway and the Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform;
the acquisition module is used for responding to the data acquisition instruction under the condition that the data acquisition instruction issued by the Internet platform is received through the control instruction channel, and acquiring equipment data of target equipment;
and the transmission module is used for transmitting the equipment data to the Internet platform through the data transmission channel.
The application also provides an electronic device, which is an entity device, and includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the dual protocol based data transmission method as described above.
The present application also provides a readable storage medium which is a computer readable storage medium having stored thereon a program for implementing a data transmission method based on a dual protocol, the program for implementing the data transmission method based on a dual protocol being executed by a processor to implement the steps of the data transmission method based on a dual protocol as described above.
The present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a dual protocol based data transmission method as described above.
The application provides a data transmission method based on double protocols, which comprises the steps of firstly establishing communication connection between an edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform, then responding to the data acquisition instruction by the edge gateway under the condition that the data acquisition instruction issued by the Internet platform is received through the control instruction channel, acquiring equipment data of target equipment, and then transmitting the equipment data to the Internet platform through the data transmission channel.
According to the method, the control command channel and the data transmission channel are carried between the edge gateway and the Internet platform through the LwM2M protocol and the MQTT protocol, so that the control command transmission and the data transmission are respectively carried out through the two channels, namely, the control command transmission is carried out through the control command channel, the data transmission is carried out through the data transmission channel, the process of simultaneously carrying out the control command transmission and the data transmission between the edge gateway and the Internet platform is ensured, the transmission delay influence when the control command transmission and the data transmission share the same channel is avoided, the edge gateway can timely transmit the acquired data to the Internet platform after the data acquisition is completed, the timeliness of the data transmission is guaranteed, and the technical problem that the timeliness of the data transmission is poor between the Internet platform and the edge gateway of the existing industrial Internet is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of control instruction transmission and data transmission between an edge gateway and an Internet platform using the same channel;
FIG. 2 is a schematic diagram of key transmission and data transmission between an edge gateway and an Internet platform using the same channel;
fig. 3 is a schematic structural diagram of a first embodiment of a data transmission system according to the present application;
fig. 4 is a schematic flow chart of a data transmission method based on dual protocols according to an embodiment of the present application;
fig. 5 is a schematic flow chart of a second embodiment of a data transmission method based on dual protocols in the present application;
fig. 6 is a schematic flow chart of a third embodiment of a data transmission method based on dual protocols in the present application;
fig. 7 is a schematic block diagram of a data transmission device based on dual protocols according to an embodiment of the present application;
fig. 8 is a schematic device structure diagram of a hardware operating environment related to a data transmission method based on dual protocols in an embodiment of the present application.
The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
Detailed Description
In order to make the above objects, features and advantages of the present invention more comprehensible, the following description of the embodiments accompanied with the accompanying drawings will be given in detail. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
The edge gateway is a gateway deployed at the edge side of the network, and is connected with the physical world and the digital world through functions such as network connection, protocol conversion and the like so as to provide the functions of light connection management, real-time data analysis and application management.
The industrial Internet is a novel infrastructure, an application mode and industrial ecology which are deeply fused with a new generation of information communication technology and industrial economy, and a brand new manufacturing and service system which covers a full industrial chain and a full value chain is constructed by comprehensively connecting people, machines, objects, systems and the like, so that an implementation way is provided for the development of industry and even industry digitization, networking and intellectualization.
At present, an edge gateway is generally required to be configured at the network edge side of an industrial internet so as to collect industrial data through the edge gateway and transmit the industrial data to an internet platform of the industrial internet for data storage, analysis and application, however, because control instruction transmission and data transmission between the edge gateway and the internet platform of the industrial internet are completed through the same channel, a process of control instruction transmission and data transmission cannot be performed between the edge gateway and the internet platform at the same time, so that the edge gateway is easy to be unable to transmit the industrial data to the internet platform in time due to control instruction transmission still performed in the channel after the industrial data is collected, and therefore, the problem of poor timeliness of data transmission exists between the internet platform of the existing industrial internet and the edge gateway.
Referring to fig. 1, fig. 1 shows a schematic diagram of control instruction transmission and data transmission between an edge gateway and an internet platform by adopting the same channel, the internet platform issues a data acquisition instruction to the edge gateway through a channel a, and the edge gateway transmits acquired data to the internet platform through the channel a after acquiring the data.
Referring to fig. 2, fig. 2 shows a schematic diagram of key transmission and data transmission between an edge gateway and an internet platform by adopting the same channel, the internet platform issues an encryption key to the edge gateway through a channel a, the edge gateway encrypts the acquired data through the encryption key after acquiring the data, so as to obtain encrypted data, and then the encrypted data is transmitted to the internet platform through the channel a.
As an example, referring to fig. 3, fig. 3 provides a data transmission system applied by a data transmission method based on dual protocols, where a channel B is a control command channel, and a channel C is a data transmission channel, where the data transmission system includes an edge gateway and an internet platform, where the edge gateway may include an LwM2M client 101, an acquisition information module 102, a key information module 103, an acquisition program module 104, and a reporting program module 105, where the LwM2M client 101 is configured to establish a connection with the internet platform through an LwM2M (Lightweight M2M) protocol to carry the control command channel for transmission of control commands between the edge gateway and the internet platform; the acquisition information module 102 is used for managing and storing acquisition information carried by a data acquisition instruction issued by an internet platform; the key information module 103 is used for storing and updating key information carried by a data acquisition instruction issued by the internet platform so as to be accessed and used by the reporting program module 105; the collection program module 104 is configured to collect device data from the target device according to the collection information; the reporting program module 105 is configured to package the collected device data in a binary message format, encrypt the device data with key information, and transmit the device data to the internet platform through a data transmission channel carried by MQTT (Message Queuing Telemetry Transport, message queue telemetry transport) protocol; the internet platform may include an LwM2M server 201, a gateway management module 202, a key management module 203, a data receiving program module 204, and a data parsing program module 205, where the LwM2M server 201 is configured to establish a connection with an edge gateway through an LwM2M protocol to carry a control instruction channel for transmission of control instructions between the edge gateway and the internet platform; the gateway management module 202 is used for performing configuration, management, upgrade procedures and other processes on the edge gateway; the key management module 203 is configured to generate a key, manage the key, and update the issued key to the edge gateway, in which the key management module 203 issues the public key to the edge gateway for encryption, and in the internet platform decrypts by using the private key to realize asymmetric encryption of data; the data receiving program module 204 is configured to receive device data reported by an edge gateway through a data transmission channel carried by an MQTT protocol; the data parsing program module 205 is configured to decrypt and parse received device data into data identifiable by the system in combination with a private key and a binary message protocol, and the structure of the data transmission system to which the data transmission method based on the dual protocol is applied is not particularly limited in this embodiment.
Based on this, the present application proposes a data transmission method based on dual protocols of the first embodiment, which is applied to an edge gateway, please refer to fig. 4, and the data transmission method based on dual protocols includes:
step S10, establishing communication connection between the edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform;
it should be noted that, the LwM2M (light M2M) protocol is a Lightweight, standard and general device management protocol for the internet of things proposed by the development mobile alliance, and may be used for rapidly deploying the internet of things service in the client or server mode. The MQTT (Message Queuing Telemetry Transport, message queue telemetry transport) protocol is a client-server based message publish or subscribe transport protocol with the advantages of light weight, simplicity, openness and ease of implementation.
Additionally, the control command channel is used for transmitting control commands between the edge gateway and the internet platform, the control command channel is generated by using an LwM2M protocol, the data transmission channel is used for transmitting data between the edge gateway and the internet platform, and the data transmission channel is generated by using an MQTT protocol.
Step S20, under the condition that a data acquisition instruction issued by the Internet platform is received through the control instruction channel, equipment data of target equipment are acquired in response to the data acquisition instruction;
the target device is used to characterize a device connected to the edge gateway, and the target device may be an industrial machine, an industrial device, an industrial instrument, an industrial system, or the like, and the device data is used to characterize data included in the target device.
And step S30, transmitting the equipment data to the Internet platform through the data transmission channel.
The embodiment of the application provides a data transmission method based on double protocols, which comprises the steps of firstly establishing communication connection between an edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform, then responding to the data acquisition instruction by the edge gateway under the condition that the data acquisition instruction issued by the Internet platform is received through the control instruction channel, acquiring equipment data of target equipment, and then transmitting the equipment data to the Internet platform through the data transmission channel. According to the embodiment of the application, the control instruction channel and the data transmission channel are carried between the edge gateway and the Internet platform through the LwM2M protocol and the MQTT protocol, so that the control instruction transmission and the data transmission are respectively carried out through the two channels, namely, the control instruction transmission is carried out through the control instruction channel, and the data transmission is carried out through the data transmission channel, so that the process of simultaneously carrying out the control instruction transmission and the data transmission between the edge gateway and the Internet platform is ensured, the transmission delay influence when the control instruction transmission and the data transmission share the same channel is avoided, the edge gateway can timely transmit the acquired data to the Internet platform after the data acquisition is completed, the timeliness of the data transmission is ensured, and the technical problem that the timeliness of the data transmission is poor between the Internet platform and the edge gateway of the existing industrial Internet is solved. Additionally, the embodiment of the application can directly establish the carrying control instruction channel for transmitting the control instruction between the edge gateway and the internet platform through the MQTT protocol, and other development and arrangement are not needed at the two ends of the edge gateway and the internet platform, so that the complexity of the system is reduced.
In one possible implementation manner, the step of acquiring device data of the target device in response to the data acquisition instruction includes:
step S21, responding to the data acquisition instruction, and acquiring acquisition information carried by the data acquisition instruction, wherein the acquisition information comprises a data access address, acquisition frequency and acquisition protocol;
the data access address is used for indicating equipment to be acquired and indicating which area of the equipment to acquire data, the acquisition frequency is used for representing the interval duration of each acquisition of equipment data, and the acquisition protocol is used for representing the protocol required to be used when the equipment is accessed in the data acquisition process.
Step S22, determining a data acquisition area of the target equipment according to the data access address;
it should be noted that the data acquisition region is used to characterize the region of the target device where data acquisition is required.
Step S23, collecting the device data of the data collection area based on the collection frequency and the collection protocol.
In this embodiment, firstly, a data access address, an acquisition frequency and an acquisition protocol carried by a data acquisition instruction are acquired in response to the data acquisition instruction, then, a data acquisition area of a target device is determined according to the data access address, and then, device data of the data acquisition area is acquired based on the acquisition frequency and the acquisition protocol, so that the data acquisition accuracy is ensured by accurately positioning an area required to be subjected to data acquisition in the target device through the data access address, the interval duration of each time of acquiring the device data is regulated through the acquisition frequency, so that the data acquisition is performed according to a certain rule, and the edge gateway can normally access the data acquisition area through the acquisition protocol, so that the stable operation of the data acquisition is ensured.
In one possible implementation manner, the step of transmitting the device data to the internet platform through the data transmission channel includes:
step A31, packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
it should be noted that, the packaging device data refers to the device data after being packaged by the binary message protocol, and the packaging process of the device data based on the binary message protocol refers to converting the representation form of the device data into the binary message format, which can be understood that the representation form of the character string is adopted in the binary message format to represent the data, for example, the original data representation form is in a text form, and after the representation form is converted into the character string form, the space occupied by the character string form is smaller than that required by the text form, so that the data size of the device data can be reduced after the packaging process of the device data by the binary message protocol.
As an example, the binary message protocol may be formed by the following code:
frame header format:
typedef struct TPayload
{
long time stamp; time stamp, number of milliseconds elapsed since 1970, 1/1 (UTC)
int gwid; number of/edge gateway
int num; the// indicates how many pairs of (ptid: result) data are in the data
TDatas datas [ ]; data//
}TPayload;
Data portion frame format:
typedef struct TDatas
{
int ptid; number of data/acquisition
short type; the// indicates result data type: 0-int (including char, bool, int, etc. within 4 bytes),
//1-float,2-long,3-double
short count; the number of data in result is expressed by//
int result[];
}TDatas;
CRC check with end of frame of 4 bytes:
typedef struct TCRC
{
int crc32; CRC32 check value for header and data portions
}TCRC;
The content of the whole message frame is as follows:
|timestamp|gwid|num|ptid#1|type|count|reault#1|ptid#2|type|……|ptid#n|type|count|reault#n|crc32|。
further, the device data includes a plurality of pieces of sub-device data, and the step of packaging the device data based on the binary message protocol to obtain packaged device data includes:
step A311, obtaining a time stamp corresponding to the equipment data and a gateway number of the edge gateway, and counting the number of each piece of sub-equipment data to obtain the number of data;
the time stamp refers to a time represented by a character sequence, and the time stamp corresponding to the device data refers to a character sequence representation corresponding to the occurrence time of the device data.
Step A312, analyzing the time stamp, the gateway number and the data quantity to obtain a target time stamp, a target gateway number and a target data quantity;
The analysis processing of the time stamp, the gateway number, and the data amount means converting the representation of the time stamp, the gateway number, and the data amount into a hexadecimal representation.
Step A313, coding each piece of sub-equipment data based on the data type of each piece of sub-equipment data to obtain each piece of packaged sub-equipment data;
the data type may be integer (int), array (char), single precision (float), double precision (double), or the like.
Step a314, combining the target timestamp, the target gateway number, the target data quantity, and each piece of packaging sub-device data to obtain the packaging device data.
Illustratively, assuming that the packetizing device data after the packetizing process is 0000 0189 8C8B 1F97 00000001 0000 0002 773C 343C 00000001 00000000 3BA1 F2E4 00000001 00000001, 0000 0189 8C8B 1F97 represents a target timestamp, 2023-07-25:14:35.159, 00000001 represents a target gateway number, 0000 0002 represents a target data amount of 2, 773c 343C represents a first data number, 0000 represents a data type of integer, 0001 represents one data, 000000000000 represents a value of the first data, 3ba 1f 2e4 represents a second data number, 0000 represents a data type of integer, 0001 represents one data, and 00000000 represents a value of the second data.
And step A32, transmitting the data of the packaging equipment to the Internet platform through the data transmission channel.
In this embodiment, the packaging device data is obtained by firstly performing packaging processing on the device data through the binary message protocol, and then transmitting the packaged device data to the internet platform through the data transmission channel, so that the embodiment converts the representation form of the device data into the binary message format through the binary message protocol, and the representation form of the device data processed through the binary message protocol occupies smaller space than the original representation form of the device data, so that the data size of the device data can be reduced, the network broadband or wireless traffic overhead is reduced, that is, the transmission overhead of the data transmission channel is reduced, and the transmission efficiency of the device data is improved.
Example two
In another embodiment of the present application, the same or similar content as the first embodiment may be referred to the description above, and will not be repeated. On this basis, referring to fig. 5, the step of transmitting the device data to the internet platform through the data transmission channel includes:
Step B31, obtaining key information carried by the data acquisition instruction;
the key information is used to characterize the encryption information used in the data encryption process, and may include an asymmetric key, a symmetric key, a time of validity of the key, and the like.
Step B32, encrypting the device data based on the key information to obtain encrypted device data;
the encrypted device data refers to device data after encryption processing.
As an example, the key information includes an encryption key and a validation time of the encryption key, and the step of encrypting the device data based on the key information to obtain encrypted device data includes: executing a timing task based on the effective time by calling a preset timer so as to trigger a key effective instruction when the timing task times the effective time; and carrying out encryption processing on the equipment data through the key validation instruction and the encryption key to obtain the encrypted equipment data.
And step B33, transmitting the data of the encryption equipment to the Internet platform through the data transmission channel.
In order to ensure the security of the device data stored in the internet platform, the encrypted device data can be updated periodically, and when the current encryption key for encrypting the device data is expired (when the interval duration of the current time from the expiration time is smaller than the preset duration), a new encryption key is generated, so that when the encryption key expires, the old encryption key is replaced by the new encryption key to complete the updating of the encryption key.
In this embodiment, key information carried by the data acquisition instruction is first obtained, then encryption processing is performed on the device data based on the key information to obtain encrypted device data, and then the encrypted device data is transmitted to the internet platform through the data transmission channel.
The key is a character string, and encryption can be divided into symmetric encryption and asymmetric encryption according to the use mode of the key, wherein symmetric encryption refers to the encryption mode using the same key in encryption and decryption, asymmetric encryption refers to the encryption mode using a public key in encryption, decryption using a private key in decryption or encryption using a private key in encryption, and decryption using a public key in decryption, namely, encryption modes using different keys in encryption and decryption.
In one possible implementation manner, the key information includes an asymmetric key or a symmetric key, and the step of encrypting the device data based on the key information to obtain encrypted device data includes:
step B321, encrypting the device data through the asymmetric key based on an asymmetric encryption algorithm to obtain the encrypted device data;
note that the asymmetric encryption algorithm may be an RSA encryption algorithm, a knapsack encryption algorithm, an elliptic curve encryption algorithm, or the like, and the embodiment is not particularly limited to the asymmetric encryption algorithm used.
It will be appreciated that since asymmetric encryption uses different keys for encryption and decryption, it is more difficult for an attacker to crack data encrypted via asymmetric encryption, and the security of the encrypted data is higher than that of symmetric encryption.
And step B322, or, based on a symmetric encryption algorithm, carrying out encryption processing on the device data through the symmetric key to obtain the encrypted device data.
Note that the symmetric encryption algorithm may be an AES (Advanced Encryption Standard ) encryption algorithm, DES (Data Encryption Standard, data encryption standard) encryption algorithm, TDES (Triple Data Encryption Standard ) encryption algorithm, or the like, and the symmetric encryption algorithm used in this embodiment is not particularly limited.
It can be appreciated that since symmetric encryption uses the same key to encrypt and decrypt, the encryption and decryption of symmetric encryption is more efficient than the encryption and decryption of asymmetric encryption, which requires the acquisition of two keys.
Example III
In another embodiment of the present application, the same or similar content as the first embodiment may be referred to the description above, and will not be repeated. On this basis, referring to fig. 6, the step of transmitting the device data to the internet platform through the data transmission channel includes:
step C31, packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
step C32, encrypting the packaging equipment data based on the key information carried by the data acquisition instruction to obtain target equipment data;
the target device data refers to the device data after being subjected to the packaging process and the encryption process, and compared with the original device data, the target device data has smaller data size and higher data security.
And step C33, transmitting the target equipment data to the Internet platform through the data transmission channel.
It can be understood that, at the edge gateway side, the device data is packaged, and then the packaged device data is encrypted, that is, the device data is encoded and then encrypted; and the internet platform side firstly carries out decryption processing on the received target data, and then carries out decoding processing on the equipment after the decryption processing, so that the original form of the equipment data can be obtained.
In this embodiment, firstly, packaging processing is performed on equipment data through a binary message protocol to obtain packaged equipment data, so as to reduce the data size of the equipment data; and then, encrypting the packaging equipment data through key information carried by the data acquisition instruction to obtain target equipment data so as to improve the safety of the equipment data, and finally, transmitting the target equipment data to an Internet platform through a data transmission channel. Therefore, the embodiment not only reduces the data size of the device data through the packaging processing and improves the transmission efficiency of the device data, but also improves the safety of the device data through the encryption processing by simultaneously packaging the device data and encrypting the device data.
Example IV
The embodiment of the invention also provides a data transmission device based on double protocols, which is applied to an edge gateway, please refer to fig. 7, and the data transmission device based on double protocols comprises:
the communication module 10 is configured to establish a communication connection between the edge gateway and the internet platform through an LwM2M protocol and an MQTT protocol, so as to carry a control instruction channel and a data transmission channel between the edge gateway and the internet platform;
the acquisition module 20 is used for responding to the data acquisition instruction to acquire the equipment data of the target equipment under the condition that the data acquisition instruction issued by the internet platform is received through the control instruction channel;
and the transmission module 30 is used for transmitting the device data to the internet platform through the data transmission channel.
Optionally, the acquisition module 20 is further configured to:
responding to the data acquisition instruction, and acquiring acquisition information carried by the data acquisition instruction, wherein the acquisition information comprises a data access address, acquisition frequency and acquisition protocol;
determining a data acquisition area of the target equipment according to the data access address;
and acquiring equipment data of the data acquisition area based on the acquisition frequency and the acquisition protocol.
Optionally, the transmission module 30 is further configured to:
packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
and transmitting the data of the packaging equipment to the Internet platform through the data transmission channel.
Optionally, the device data includes a plurality of sub-device data, and the transmission module 30 is further configured to:
acquiring a time stamp corresponding to the equipment data and a gateway number of the edge gateway, and counting the number of each piece of sub-equipment data to obtain the data number;
analyzing the time stamp, the gateway number and the data quantity to obtain a target time stamp, a target gateway number and a target data quantity;
coding each piece of sub-equipment data based on the data type of each piece of sub-equipment data to obtain each piece of packaged sub-equipment data;
and combining the target timestamp, the target gateway number, the target data quantity and each piece of packaging sub-equipment data to obtain the packaging equipment data.
Optionally, the transmission module 30 is further configured to:
acquiring key information carried by the data acquisition instruction;
encrypting the device data based on the key information to obtain encrypted device data;
And transmitting the data of the encryption equipment to the Internet platform through the data transmission channel.
Optionally, the key information includes an asymmetric key or a symmetric key, and the transmission module 30 is further configured to:
based on an asymmetric encryption algorithm, encrypting the device data through the asymmetric key to obtain the encrypted device data;
or based on a symmetric encryption algorithm, carrying out encryption processing on the device data through the symmetric key to obtain the encrypted device data.
Optionally, the transmission module 30 is further configured to:
packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
encrypting the packaging equipment data based on key information carried by a data acquisition instruction to obtain target equipment data;
and transmitting the target equipment data to the Internet platform through the data transmission channel.
The data transmission device based on the double protocols provided by the invention adopts the data transmission method based on the double protocols in the first embodiment or the second embodiment, and can solve the technical problem that the timeliness of data transmission is poor between the internet platform and the edge gateway of the existing industrial internet. Compared with the prior art, the data transmission device based on the dual protocol provided by the embodiment of the invention has the same beneficial effects as the data transmission method based on the dual protocol provided by the embodiment, and other technical features in the data transmission device based on the dual protocol are the same as the features disclosed by the method of the embodiment, and are not repeated herein.
Example five
The embodiment of the invention provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the dual protocol based data transmission method of the first embodiment.
Referring now to fig. 8, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant: personal digital assistants), PADs (Portable Application Description: tablet computers), PMPs (Portable Media Player: portable multimedia players), vehicle terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, the electronic apparatus may include a processing device 1001 (e.g., a central processing unit, a graphics processor, or the like) that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access Memory (RAM: random Access Memory) 1004. In the RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, the ROM1002, and the RAM1004 are connected to each other by a bus 1005. An input/output (I/O) interface 1006 is also connected to the bus. In general, the following systems may be connected to the I/O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, and the like; an output device 1008 including, for example, a liquid crystal display (LCD: liquid Crystal Display), a speaker, a vibrator, and the like; storage device 1003 including, for example, a magnetic tape, a hard disk, and the like; and communication means 1009. The communication means 1009 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While electronic devices having various systems are shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. The above-described functions defined in the method of the embodiment of the present disclosure are performed when the computer program is executed by the processing device 1001.
The electronic equipment provided by the invention adopts the data transmission method based on the double protocols in the embodiment, and can solve the technical problem that the timeliness of data transmission is poor between the internet platform and the edge gateway of the existing industrial internet. Compared with the prior art, the electronic device provided by the embodiment of the invention has the same beneficial effects as the data transmission method based on the dual protocol provided by the embodiment, and other technical features in the electronic device are the same as the features disclosed by the method of the previous embodiment, and are not described in detail herein.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Example six
An embodiment of the present invention provides a computer readable storage medium having computer readable program instructions stored thereon for performing the dual protocol based data transmission method of the first embodiment.
The computer readable storage medium according to the embodiments of the present invention may be, for example, a usb disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access Memory (RAM: random Access Memory), a Read-Only Memory (ROM: read Only Memory), an erasable programmable Read-Only Memory (EPROM: erasable Programmable Read Only Memory or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wire, fiber optic cable, RF (Radio Frequency), and the like, or any suitable combination of the foregoing.
The above-described computer-readable storage medium may be contained in an electronic device; or may exist alone without being assembled into an electronic device.
The computer-readable storage medium carries one or more programs that, when executed by an electronic device, cause the electronic device to: establishing communication connection between the edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform; under the condition that a data acquisition instruction issued by the Internet platform is received through the control instruction channel, responding to the data acquisition instruction, and acquiring equipment data of target equipment; and transmitting the equipment data to the Internet platform through the data transmission channel.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN: local Area Network) or a wide area network (WAN: wide Area Network), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The readable storage medium provided by the invention is a computer readable storage medium, and the computer readable storage medium stores computer readable program instructions for executing the data transmission method based on the double protocols, so that the technical problem of poor timeliness of data transmission between an internet platform and an edge gateway of the existing industrial internet can be solved. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the embodiment of the invention are the same as those of the data transmission method based on the dual protocol provided by the above embodiment, and are not described herein.
Example seven
The embodiments of the present invention also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of the dual protocol based data transmission method as described above.
The computer program product provided by the application can solve the technical problem that the timeliness of data transmission is poor between an internet platform and an edge gateway of the existing industrial internet. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as those of the data transmission method based on the dual protocol provided by the above embodiment, and are not described herein.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims.

Claims (10)

1. The data transmission method based on the double protocols is characterized by being applied to an edge gateway and comprising the following steps of:
establishing communication connection between the edge gateway and an Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform;
under the condition that a data acquisition instruction issued by the Internet platform is received through the control instruction channel, responding to the data acquisition instruction, and acquiring equipment data of target equipment;
and transmitting the equipment data to the Internet platform through the data transmission channel.
2. The dual protocol based data transmission method of claim 1, wherein the step of collecting device data of the target device in response to the data collection instruction comprises:
Responding to the data acquisition instruction, and acquiring acquisition information carried by the data acquisition instruction, wherein the acquisition information comprises a data access address, acquisition frequency and acquisition protocol;
determining a data acquisition area of the target equipment according to the data access address;
and acquiring equipment data of the data acquisition area based on the acquisition frequency and the acquisition protocol.
3. The dual protocol based data transmission method of claim 1, wherein the step of transmitting the device data to the internet platform through the data transmission channel comprises:
packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
and transmitting the data of the packaging equipment to the Internet platform through the data transmission channel.
4. The dual-protocol based data transmission method as claimed in claim 3, wherein the device data includes a plurality of sub-device data, and the step of packing the device data based on the binary message protocol to obtain packed device data includes:
acquiring a time stamp corresponding to the equipment data and a gateway number of the edge gateway, and counting the number of each piece of sub-equipment data to obtain the data number;
Analyzing the time stamp, the gateway number and the data quantity to obtain a target time stamp, a target gateway number and a target data quantity;
coding each piece of sub-equipment data based on the data type of each piece of sub-equipment data to obtain each piece of packaged sub-equipment data;
and combining the target timestamp, the target gateway number, the target data quantity and each piece of packaging sub-equipment data to obtain the packaging equipment data.
5. The dual protocol based data transmission method of claim 1, wherein the step of transmitting the device data to the internet platform through the data transmission channel comprises:
acquiring key information carried by the data acquisition instruction;
encrypting the device data based on the key information to obtain encrypted device data;
and transmitting the data of the encryption equipment to the Internet platform through the data transmission channel.
6. The dual protocol based data transmission method of claim 5, wherein the key information includes an asymmetric key or a symmetric key, and the step of encrypting the device data based on the key information to obtain encrypted device data comprises:
Based on an asymmetric encryption algorithm, encrypting the device data through the asymmetric key to obtain the encrypted device data;
or based on a symmetric encryption algorithm, carrying out encryption processing on the device data through the symmetric key to obtain the encrypted device data.
7. The dual protocol based data transmission method of claim 1, wherein the step of transmitting the device data to the internet platform through the data transmission channel comprises:
packaging the equipment data based on a binary message protocol to obtain packaged equipment data;
encrypting the packaging equipment data based on key information carried by a data acquisition instruction to obtain target equipment data;
and transmitting the target equipment data to the Internet platform through the data transmission channel.
8. A dual-protocol based data transmission apparatus, for use in an edge gateway, the dual-protocol based data transmission apparatus comprising:
the communication module is used for establishing communication connection between the edge gateway and the Internet platform through an LwM2M protocol and an MQTT protocol so as to carry a control instruction channel and a data transmission channel between the edge gateway and the Internet platform;
The acquisition module is used for responding to the data acquisition instruction under the condition that the data acquisition instruction issued by the Internet platform is received through the control instruction channel, and acquiring equipment data of target equipment;
and the transmission module is used for transmitting the equipment data to the Internet platform through the data transmission channel.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the dual protocol based data transmission method of any one of claims 1 to 7.
10. A readable storage medium, characterized in that the readable storage medium is a computer readable storage medium having stored thereon a program implementing a dual protocol based data transmission method, the program implementing the dual protocol based data transmission method being executed by a processor to implement the steps of the dual protocol based data transmission method according to any one of claims 1 to 7.
CN202311319134.5A 2023-10-12 2023-10-12 Data transmission method, device and equipment based on double protocols and readable storage medium Pending CN117459610A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311319134.5A CN117459610A (en) 2023-10-12 2023-10-12 Data transmission method, device and equipment based on double protocols and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311319134.5A CN117459610A (en) 2023-10-12 2023-10-12 Data transmission method, device and equipment based on double protocols and readable storage medium

Publications (1)

Publication Number Publication Date
CN117459610A true CN117459610A (en) 2024-01-26

Family

ID=89592035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311319134.5A Pending CN117459610A (en) 2023-10-12 2023-10-12 Data transmission method, device and equipment based on double protocols and readable storage medium

Country Status (1)

Country Link
CN (1) CN117459610A (en)

Similar Documents

Publication Publication Date Title
CN107529132B (en) Method and device for transmitting data between Bluetooth device and application program
CN109818962B (en) Service data processing method and device, electronic equipment and storage medium
CN111930709B (en) Data storage method, apparatus, electronic device, and computer readable medium
CN112149168B (en) File data encryption method and device and electronic equipment
CN110633575A (en) Data encryption method, device, equipment and storage medium
CN112689020B (en) Message transmission method, message middleware, electronic equipment and storage medium
US20170034303A1 (en) Methods and apparatus to create and transmit a condensed logging data file
CN113537512B (en) Model training method, device, system, equipment and medium based on federal learning
CN112464068B (en) Data processing method and device and electronic equipment
CN116720202B (en) Service information detection method, device, electronic equipment and computer readable medium
CN117459610A (en) Data transmission method, device and equipment based on double protocols and readable storage medium
CN108270546A (en) A kind of method and system of information transmission
CN110719233A (en) Method and device for sending information
CN112203103B (en) Message processing method, device, electronic equipment and computer readable storage medium
CN112416887B (en) Information interaction method and device and electronic equipment
CN115022328A (en) Server cluster, server cluster testing method and device and electronic equipment
CN116702169B (en) Data encryption migration method, electronic device and computer readable medium
CN116578427B (en) Resource device scheduling method, electronic device and computer readable medium
CN115065852B (en) Sound and picture synchronization method and device, electronic equipment and readable storage medium
CN116226888B (en) Power data interactive encryption method, system and equipment based on privacy protection
CN113742774B (en) Data processing method and device, readable medium and electronic equipment
WO2024119917A1 (en) Sensing measurement method and apparatus, and related device
CN114968621B (en) Data communication method, device, equipment, storage medium and system
CN116702168B (en) Method, device, electronic equipment and computer readable medium for detecting supply end information
CN116703190B (en) Power consumption information processing method, device, electronic equipment and computer readable 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