CN114244648B - Method, device, equipment and medium for equipment to actively register Internet of things platform - Google Patents

Method, device, equipment and medium for equipment to actively register Internet of things platform Download PDF

Info

Publication number
CN114244648B
CN114244648B CN202210154659.7A CN202210154659A CN114244648B CN 114244648 B CN114244648 B CN 114244648B CN 202210154659 A CN202210154659 A CN 202210154659A CN 114244648 B CN114244648 B CN 114244648B
Authority
CN
China
Prior art keywords
equipment
internet
data
registration packet
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.)
Active
Application number
CN202210154659.7A
Other languages
Chinese (zh)
Other versions
CN114244648A (en
Inventor
张照平
孙丽君
曹雪韬
傅慧
王力哲
陈天飞
牛海旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Digital Grain Storage Technology Co Ltd
Original Assignee
Inspur General Software 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 Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN202210154659.7A priority Critical patent/CN114244648B/en
Publication of CN114244648A publication Critical patent/CN114244648A/en
Application granted granted Critical
Publication of CN114244648B publication Critical patent/CN114244648B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2854Wide area networks, e.g. public data networks
    • H04L12/2856Access arrangements, e.g. Internet access
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • 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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

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

Abstract

The invention provides a method, a device, equipment and a readable medium for equipment to actively register an Internet of things platform, wherein the method comprises the following steps: responding to the connection of the equipment to the platform of the Internet of things, and sending a registration packet to the platform of the Internet of things through the IP address and the port number of the platform of the Internet of things; responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database; determining a protocol for docking with the Internet of things; and storing the information of the docked protocol in a database, and changing the state of the equipment into the accessed state. By using the scheme of the invention, the equipment can be automatically registered to the Internet of things platform and the equipment protocol can be displayed without manual configuration. The present invention relates to the field of computers.

Description

Method, device, equipment and medium for equipment to actively register Internet of things platform
Technical Field
The present invention relates to the field of computers, and more particularly, to a method, an apparatus, a device and a readable medium for actively registering an internet of things platform by a device.
Background
With the development of the internet of things, simplifying the docking configuration difficulty of the equipment and the platform of the internet of things becomes a more critical task. At present, the mainstream docking modes include active registration and device access, the device docking needs to configure more contents such as a device IP in a platform, the active registration needs to configure platform information in the device, and a docking protocol needs to be configured in the platform after the registration, so that certain thresholds exist, and the docking modes are not suitable for people without relevant knowledge.
At present, the butt joint of the Internet of things platform and equipment has been developed for a long time, and each company has the own Internet of things platform. Some of these platforms only support devices developed according to their own protocols, and some require complex configuration to interface with devices of common protocols, and require implementation personnel with more knowledge reserves to use the devices. At present, many devices already support general protocols, such as GB28181, DTL645, etc., but the internet of things platform on the market is not friendly to support for reasons of market share, etc.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, an apparatus, a device and a readable medium for actively registering a device in an internet of things platform, which enable the device to automatically register in the internet of things platform and display a device protocol without manual configuration.
Based on the above object, an aspect of the embodiments of the present invention provides a method for a device to actively register an internet of things platform, including the following steps:
responding to the connection of the equipment to the platform of the Internet of things, and sending a registration packet to the platform of the Internet of things through the IP address and the port number of the platform of the Internet of things;
Responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database;
determining a protocol for docking with the Internet of things;
and storing the information of the docked protocol in a database, and changing the state of the equipment into the accessed state.
According to one embodiment of the invention, determining a protocol for interfacing with the internet of things comprises:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
responding to the fact that the size of a registration packet sent by the equipment exceeds 30 bytes, and judging whether data in the registration packet contains CmdType and is a REGISTER;
and in response to the data in the registration packet containing CmdType and having a value of REGISTER, determining that the protocol for the device to interface with the Internet of things is the GB28181 protocol.
According to one embodiment of the invention, determining a protocol for interfacing with the internet of things comprises:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
in response to the size of the registration packet sent by the device not exceeding 30 bytes, determining whether a first byte of data in the registration packet is binary data XXX 10000;
in response to the first byte of data in the registration packet being binary data XXX 10000, determining whether the first three bits of binary data XXX 10000 are equal to the length of the remaining message;
Responding to the first three bits of binary data XXX 10000 being equal to the length of the residual message, judging whether the data formed by the fourth, fifth, sixth and seventh bytes of the data in the registration packet is MQTT;
and responding to the fact that data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, and determining that the protocol for the equipment to be docked with the Internet of things is MQTT protocol.
According to an embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the equipment by the Internet of things platform, and sending specified data to the equipment at preset time intervals according to a preset sequence;
in response to the device sending reply data to any of the specified data, determining whether the reply data complies with the CRC16 check and with the address bit resolution;
and in response to the reply data conforming to the CRC16 check and conforming to the address bit resolution, determining that the protocol for the equipment to interface with the Internet of things is the modbus protocol.
According to an embodiment of the present invention, in response to unsuccessful parsing of a registration packet sent by a device by an internet of things platform, sending specified data to the device in a preset sequence at intervals of a preset time includes:
and in response to the fact that the internet of things platform fails to analyze the registration packet sent by the device, sending first designated data 010100000001 FD CA, second designated data 010200000001B 9 CA, third designated data 010300000001840A and fourth designated data 01040000000131 CA to the device in sequence, wherein the interval for sending the designated data is 5 seconds.
According to an embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, and sending data 6801000000000068110433333D 33 BC 16 to the equipment;
in response to the device sending the reply data, determining whether the reply data begins at 68 and is different from the sent data and conforms to the CS sum check;
in response to the reply data beginning at 68 and being different from the sent data and conforming to the CS and checksum, determining that the protocol for the device to interface with the internet of things is the DLT645 protocol.
According to an embodiment of the present invention, further comprising:
and in response to the fact that the Internet of things platform fails to analyze the registration packet sent by the equipment and the protocol for docking with the Internet of things is determined to fail, the process is repeatedly executed for 2-3 times.
In another aspect of the embodiments of the present invention, there is provided an apparatus for actively registering an internet of things platform by a device, where the apparatus includes:
the sending module is configured to respond to the connection of the equipment to the Internet of things platform and send a registration packet to the Internet of things platform through the IP address and the port number of the Internet of things platform;
the analysis module is configured to respond to the successful analysis of the registration packet sent by the Internet of things platform to the equipment and store the information of the equipment into the database;
The judging module is configured to determine a protocol for docking with the Internet of things;
and the storage module is configured to store the information of the butted protocols in a database and change the state of the equipment into the accessed state.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any one of the above-mentioned methods.
The invention has the following beneficial technical effects: according to the method for actively registering the platform of the Internet of things by the equipment, which is provided by the embodiment of the invention, the equipment is connected to the platform of the Internet of things in response, and a registration packet is sent to the platform of the Internet of things through the IP address and the port number of the platform of the Internet of things; responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database; determining a protocol for docking with the Internet of things; the information of the docked protocol is stored in the database, the state of the equipment is changed into the accessed technical scheme, the equipment can be automatically registered to the Internet of things platform, and the protocol of the equipment is displayed without manual configuration.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for a device to actively register with an internet of things platform according to an embodiment of the invention;
fig. 2 is a schematic diagram of an apparatus for actively registering a platform of the internet of things by a device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the present invention;
FIG. 4 is a schematic diagram of a computer-readable storage medium according to one embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the foregoing, a first aspect of the embodiments of the present invention provides an embodiment of a method for a device to actively register an internet of things platform. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may comprise the steps of:
s1, responding to the connection of the equipment to the Internet of things platform, and sending a registration packet to the Internet of things platform through the IP address and the port number of the Internet of things platform.
S2, responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database.
S3 determines a protocol to interface with the internet of things.
S4 saves the information of the docked protocol in the database, changing the state of the device to accessed.
The equipment needs to support configuration of an IP and a port number of the platform of the Internet of things, when the equipment is accessed to a network, TCP connection is actively established with the platform of the Internet of things and a registration packet is sent, or a UDP registration packet is directly sent, and after the registration packet is sent, heartbeat packets are sent to the platform of the Internet of things at regular intervals. After receiving the registration packet, the internet of things platform firstly analyzes according to a protocol containing a registration flow, if the analysis is successful, the equipment protocol, the IP address and the port are stored in a database, after the access information is stored, the internet of things platform sends request packets for obtaining the equipment state and the equipment information to the IP and the port of the access information in sequence according to the supported protocol, and waits for equipment response. The acquisition modes of each protocol are different, so that the device directly ignores or replies error information if receiving the requests of different protocols, and when the information of the internet of things platform is received overtime or information which is sent by the device and does not conform to the expected format is received, the device is considered not to support the protocol of the attempt, and the next round of attempt is started. After multiple attempts, if the supported protocols are matched, updating the device protocol field in the database, and changing the device state into the accessed state, if the supported protocols are not matched, not modifying, and identifying and configuring by the user.
Through the technical scheme of the invention, the equipment can be automatically registered to the platform of the Internet of things and the equipment protocol is displayed without manual configuration.
In a preferred embodiment of the present invention, determining a protocol for interfacing with the internet of things includes:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
responding to the fact that the size of a registration packet sent by the equipment exceeds 30 bytes, and judging whether data in the registration packet contains Cmdtype and the value is REGISTER;
and in response to the data in the registration packet containing CmdType and the value being REGISTER, determining that the protocol for the equipment to interface with the Internet of things is GB28181 protocol. If the internet of things platform successfully analyzes the registration packet sent by the equipment, judging the size of the registration packet, if the size exceeds 30 bytes, trying to analyze data according to the format of the SIP protocol, firstly judging whether the data contains CmdType, if so, detecting whether the value of the data is a REGISTER, and if both detections pass, determining that the equipment is the GB28181 protocol.
In a preferred embodiment of the present invention, determining a protocol for interfacing with the internet of things includes:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
in response to the size of the registration packet sent by the device not exceeding 30 bytes, determining whether a first byte of data in the registration packet is binary data XXX 10000;
In response to the first byte of data in the registration packet being binary data XXX 10000, determining whether the first three bits of binary data XXX 10000 are equal to the length of the remainder message;
responding to the first three bits of binary data XXX 10000 being equal to the length of the residual message, judging whether the data formed by the fourth, fifth, sixth and seventh bytes of the data in the registration packet is MQTT;
and responding to the fact that data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, and determining that the protocol for the equipment to be docked with the Internet of things is MQTT protocol. If the size of the registration packet does not exceed 30 bytes, judging whether the first byte of the registration packet is binary data XXX 10000, if so, judging whether the value of the three bits XXX is equal to the length of the residual message, if so, continuously judging whether the data formed by the 4 th, 5 th, 6 th and 7 th bytes is MQTT, and if so, determining that the equipment is an MQTT protocol.
In a preferred embodiment of the present invention, the method further comprises:
responding to unsuccessful analysis of the registration packet sent by the equipment by the Internet of things platform, and sending specified data to the equipment at intervals of preset time according to a preset sequence;
in response to the device sending reply data to any of the specified data, determining whether the reply data complies with the CRC16 check and with the address bit resolution;
And in response to the reply data being in accordance with the CRC16 check and in accordance with the address bit resolution, determining that the protocol for the device to interface with the Internet of things is the modbus protocol. If the Internet of things platform fails to analyze the registration packet sent by the equipment, entering a stage of sending an identification instruction by the platform, and sending a piece of hexadecimal data to the equipment at intervals of 5 seconds according to the following sequence:
1)01 01 00 00 00 01 FD CA
2)01 02 00 00 00 01 B9 CA
3)01 03 00 00 00 01 84 0A
4)01 04 00 00 00 01 31 CA
if the equipment sends reply data to any one of the four pieces of information, the Internet of things platform analyzes the reply data, if the data accords with CRC16 verification and the reply data accords with address bit analysis, the equipment is considered to belong to a modbus protocol, protocol information is stored in a database, and if no return information is received or format verification of the return information fails, other protocol attempts are carried out.
In a preferred embodiment of the present invention, in response to unsuccessful parsing of a registration packet sent by a device by an internet of things platform, sending specified data to the device according to a preset sequence at intervals of a preset time includes:
and in response to the fact that the internet of things platform fails to analyze the registration packet sent by the device, sending first designated data 010100000001 FD CA, second designated data 010200000001B 9 CA, third designated data 010300000001840A and fourth designated data 01040000000131 CA to the device in sequence, wherein the interval for sending the designated data is 5 seconds.
In a preferred embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, and sending data 6801000000000068110433333D 33 BC 16 to the equipment;
in response to the device sending the reply data, determining whether the reply data begins at 68 and is different from the sent data and conforms to the CS sum check;
in response to the reply data beginning at 68 and being different from the sent data and conforming to the CS and checksum, determining that the protocol for the device to interface with the internet of things is the DLT645 protocol. If the internet of things platform fails to analyze the registration packet sent by the equipment, entering a stage of sending an identification instruction by the platform, and sending data to the equipment: 6801000000000068110433333D 33 BC 16, if the device replies with data beginning with 68 and different from the data sent and conforming to the CS sum check, then the device is considered to belong to the DLT645 protocol and the protocol is saved.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the fact that the Internet of things platform fails to analyze the registration packet sent by the equipment and the fact that the protocol for docking with the Internet of things fails, repeatedly executing the process for 2 to 3 times.
In the communication flow with the equipment, each protocol is tried only once, and if the network connection error exists, the supported protocols still fail to be matched, so that the communication flow can be repeated for 2-3 times, and the communication stability is improved.
The communication flow only comprises common communication protocols in the market, and some cold protocols are not contained in the communication flow, so that in a preferred embodiment, the protocol can be expanded, the capabilities of the supported devices and the Internet of things platform are expanded, and more devices are supported for identification. At present, most manufacturers support active registration of devices, but except for a protocol for specifying registration content, the registration information of the devices of many manufacturers is different. Therefore, the registration packets are not matched in the scheme except for the GB28181 protocol and the MQTT protocol. If the registration packet of the device supports customization, the registration packet may be set according to the following format, and the data is 16-ary: 6B 00 XX 0X XX XX, wherein the first byte 6B 00 is a fixed message header, the second byte high 8 bit XX represents a docking protocol 01 to represent a modbus protocol, 02 represents a DLT645 protocol, 03 represents an OPC UA protocol, the second byte low 8 bit represents a data acquisition mode, 01 represents that the equipment is actively requested by an Internet of things platform, 02 represents that the equipment is actively pushed to the Internet of things platform, and the third byte is CRC16 check.
After receiving the registration packet, the server preferentially matches the GB28181 protocol with the MQTT protocol according to the original logic, after the matching fails, the server analyzes according to the predefined format, and after the analysis succeeds, the server can directly acquire the docking protocol of the equipment without the step of sending an identification instruction by a platform, so that the identification speed is increased, and the network pressure is reduced.
At present, the detailed communication flow of the scheme only comprises GB28181, MQTT, modbus and DLT645 protocols, although the protocols comprise higher-occupation docking protocols in the market, the internet of things docking protocols are more, and more novel protocols or existing protocols occupy more markets along with the development of the times. Therefore, the communication flow in the scheme can be expanded, other protocol analysis flows are added, and analysis and judgment are carried out in sequence. In a preferred embodiment, more protocols, such as OPC UA protocol, etc., may be supported, and the manner of determination thereof is added after the detailed communication flow. When the internet of things platform identifies the protocol, the protocol is analyzed only once, and if the protocol is not supported completely by the equipment due to network reasons, the identification is wrong, so that in the preferred embodiment, more identification data can be sent to the equipment, and the judgment is more complete. In the above embodiment, the basic information of each protocol is sent only once, and due to network fluctuation, device power failure, and other reasons, return information may be lost, which may result in failure of protocol determination. Therefore, in a preferred embodiment, a retry mechanism can be established, wherein the protocol identification is performed on the device once every 5 minutes, the identification is not performed again after the identification is successful, and the retry is performed after the identification is failed. Considering the factors such as bandwidth pressure, the user can set the retry interval and the maximum retry number to ensure the normal operation of the system.
In a preferred embodiment, the detailed communication flow of the device analyzes different communication protocols in sequence, but the difference between different protocols is large, and the analysis sequence can be disturbed to form a new scheme.
In a preferred embodiment, the information content registered by the device is fixed content, a first byte is fixed, a second byte represents the protocol content, and the definition can be modified, for example, the first two bytes are fixed, and a third byte represents the protocol information.
In the scheme, the communication with the equipment uses TCP and UDP according to different protocols, but in practice, the equipment uses other protocols for communication, and the communication protocol in the scheme can be replaced by other protocols.
Through the technical scheme of the invention, the equipment can be automatically registered to the platform of the Internet of things and the equipment protocol is displayed without manual configuration.
It should be noted that, as can be understood by those skilled in the art, all or part of the processes in the methods of the embodiments described above can be implemented by instructing relevant hardware by a computer program, and the program may be stored in a computer-readable storage medium, and when executed, the program may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments corresponding thereto.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the functions defined above in the methods disclosed in the embodiments of the present invention.
In view of the foregoing, in a second aspect of the embodiment of the present invention, an apparatus for actively registering a platform of an internet of things by a device is provided, as shown in fig. 2, an apparatus 200 includes:
the sending module is configured to respond to the connection of the equipment to the Internet of things platform and send a registration packet to the Internet of things platform through the IP address and the port number of the Internet of things platform;
the analysis module is configured to respond to the successful analysis of the registration packet sent by the Internet of things platform to the equipment and store the information of the equipment into the database;
the judging module is configured to determine a protocol for docking with the Internet of things;
and the storage module is configured to store the information of the butted protocols in a database and change the state of the equipment into the accessed state.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor 21; and a memory 22, the memory 22 storing computer instructions 23 executable on the processor, the instructions when executed by the processor implementing the method of:
Responding to the connection of the equipment to the platform of the Internet of things, and sending a registration packet to the platform of the Internet of things through the IP address and the port number of the platform of the Internet of things;
responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database;
determining a protocol for docking with the Internet of things;
and storing the information of the docked protocol in a database, and changing the state of the equipment into the accessed state.
In a preferred embodiment of the present invention, determining a protocol for interfacing with the internet of things includes:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
responding to the fact that the size of a registration packet sent by the equipment exceeds 30 bytes, and judging whether data in the registration packet contains CmdType and is a REGISTER;
and in response to the data in the registration packet containing CmdType and having a value of REGISTER, determining that the protocol for the device to interface with the Internet of things is the GB28181 protocol.
In a preferred embodiment of the present invention, determining a protocol for interfacing with the internet of things includes:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
in response to the size of the registration packet sent by the device not exceeding 30 bytes, determining whether a first byte of data in the registration packet is binary data XXX 10000;
In response to the first byte of data in the registration packet being binary data XXX 10000, determining whether the first three bits of binary data XXX 10000 are equal to the length of the remainder message;
responding to the first three bits of binary data XXX 10000 being equal to the length of the residual message, judging whether the data formed by the fourth, fifth, sixth and seventh bytes of the data in the registration packet is MQTT;
and responding to the fact that data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, and determining that the protocol for the equipment to be docked with the Internet of things is MQTT protocol.
In a preferred embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the equipment by the Internet of things platform, and sending specified data to the equipment at preset time intervals according to a preset sequence;
in response to the device sending reply data to any of the specified data, determining whether the reply data complies with the CRC16 check and with the address bit resolution;
and in response to the reply data conforming to the CRC16 check and conforming to the address bit resolution, determining that the protocol for the equipment to interface with the Internet of things is the modbus protocol.
In a preferred embodiment of the present invention, in response to unsuccessful parsing of a registration packet sent by a device by an internet of things platform, sending specified data to the device according to a preset sequence at intervals of a preset time includes:
Responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, sequentially sending first appointed data 010100000001 FD CA, second appointed data 010200000001B 9 CA, third appointed data 010300000001840A and fourth appointed data 01040000000131 CA to the equipment, wherein the interval for sending the appointed data is 5 seconds.
In a preferred embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, and sending data 6801000000000068110433333D 33 BC 16 to the equipment;
in response to the device sending the reply data, determining whether the reply data begins at 68 and is different from the sent data and conforms to the CS sum check;
in response to the reply data beginning at 68 and being different from the sent data and conforming to the CS and checksum, determining that the protocol for the device to interface with the internet of things is the DLT645 protocol.
In a preferred embodiment of the present invention, further comprising:
and in response to the fact that the Internet of things platform fails to analyze the registration packet sent by the equipment and the fact that the protocol for docking with the Internet of things fails, repeatedly executing the process for 2 to 3 times.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the method of:
Responding to the connection of the equipment to the Internet of things platform, and sending a registration packet to the Internet of things platform through the IP address and the port number of the Internet of things platform;
responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database;
determining a protocol for docking with the Internet of things;
and storing the information of the docked protocol in a database, and changing the state of the equipment into the accessed state.
In a preferred embodiment of the present invention, determining a protocol for interfacing with the internet of things includes:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
responding to the fact that the size of a registration packet sent by the equipment exceeds 30 bytes, and judging whether data in the registration packet contains CmdType and is a REGISTER;
and in response to the data in the registration packet containing CmdType and having a value of REGISTER, determining that the protocol for the device to interface with the Internet of things is the GB28181 protocol.
In a preferred embodiment of the present invention, determining a protocol for interfacing with the internet of things includes:
judging whether the size of a registration packet sent by the equipment exceeds 30 bytes or not;
in response to the size of the registration packet sent by the device not exceeding 30 bytes, determining whether a first byte of data in the registration packet is binary data XXX 10000;
In response to the first byte of data in the registration packet being binary data XXX 10000, determining whether the first three bits of binary data XXX 10000 are equal to the length of the remainder message;
responding to the first three bits of binary data XXX 10000 being equal to the length of the residual message, judging whether the data formed by the fourth, fifth, sixth and seventh bytes of the data in the registration packet is MQTT;
and responding to the fact that data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, and determining that the protocol for the equipment to be docked with the Internet of things is MQTT protocol.
In a preferred embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the equipment by the Internet of things platform, and sending specified data to the equipment at intervals of preset time according to a preset sequence;
in response to the device sending reply data to any of the specified data, determining whether the reply data complies with the CRC16 check and with the address bit resolution;
and in response to the reply data conforming to the CRC16 check and conforming to the address bit resolution, determining that the protocol for the equipment to interface with the Internet of things is the modbus protocol.
In a preferred embodiment of the present invention, in response to unsuccessful parsing of a registration packet sent by a device by an internet of things platform, sending specified data to the device according to a preset sequence at intervals of a preset time includes:
Responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, sequentially sending first appointed data 010100000001 FD CA, second appointed data 010200000001B 9 CA, third appointed data 010300000001840A and fourth appointed data 01040000000131 CA to the equipment, wherein the interval for sending the appointed data is 5 seconds.
In a preferred embodiment of the present invention, further comprising:
responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, and sending data 6801000000000068110433333D 33 BC 16 to the equipment;
in response to the device sending the reply data, determining whether the reply data begins at 68 and is different from the sent data and conforms to the CS sum check;
in response to the reply data beginning at 68 and being different from the sent data and conforming to the CS checksum, determining that the protocol for interfacing the device with the internet of things is the DLT645 protocol.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the fact that the Internet of things platform fails to analyze the registration packet sent by the equipment and the fact that the protocol for docking with the Internet of things fails, repeatedly executing the process for 2 to 3 times.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing are exemplary embodiments of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the above embodiments of the present invention are merely for description, and do not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, where the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant only to be exemplary, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit or scope of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (8)

1. A method for actively registering an Internet of things platform by equipment is characterized by comprising the following steps:
responding to the connection of the equipment to the Internet of things platform, and sending a registration packet to the Internet of things platform through the IP address and the port number of the Internet of things platform;
responding to the successful analysis of the registration packet sent by the Internet of things platform to the equipment, and storing the information of the equipment into a database;
determining a protocol for the equipment to be docked with the Internet of things according to the information of the registration packet sent by the equipment, wherein the protocol for determining the equipment to be docked with the Internet of things according to the information of the registration packet sent by the equipment comprises the following steps: judging whether the size of a registration packet sent by the equipment exceeds 30 bytes, responding to the fact that the size of the registration packet sent by the equipment exceeds 30 bytes, judging whether data in the registration packet contains CmdType and is a REGISTER, responding to the fact that the data in the registration packet contains CmdType and is a REGISTER, determining that a protocol for the equipment to be docked with the Internet of things is a GB28181 protocol, wherein the protocol for the equipment to be docked with the Internet of things according to the information of the registration packet sent by the equipment further comprises the following steps: judging whether the size of a registration packet sent by equipment exceeds 30 bytes, responding to the fact that the size of the registration packet sent by the equipment does not exceed 30 bytes, judging whether the first byte of data in the registration packet is binary data XXX 10000, responding to the fact that the first byte of data in the registration packet is binary data XXX 10000, judging whether the first three bits of the binary data XXX 10000 are equal to the length of a residual message, responding to the fact that the first three bits of the binary data XXX 10000 are equal to the length of the residual message, judging whether data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, responding to the fact that the data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, and determining that a protocol for interfacing the equipment with the Internet of things is an MQTT protocol;
And storing the information of the docked protocol in a database, and changing the state of the equipment into the accessed state.
2. The method of claim 1, further comprising:
responding to unsuccessful analysis of the registration packet sent by the equipment by the Internet of things platform, and sending specified data to the equipment at intervals of preset time according to a preset sequence;
in response to the device sending reply data to any of the specified data, determining whether the reply data complies with the CRC16 check and with the address bit resolution;
and in response to the reply data being in accordance with the CRC16 check and in accordance with the address bit resolution, determining that the protocol for the device to interface with the Internet of things is the modbus protocol.
3. The method of claim 2, wherein in response to unsuccessful parsing of the registration packet sent by the device by the internet of things platform, sending the specified data to the device in a preset sequence at preset time intervals comprises:
and in response to the fact that the internet of things platform fails to analyze the registration packet sent by the device, sending first designated data 010100000001 FD CA, second designated data 010200000001B 9 CA, third designated data 010300000001840A and fourth designated data 01040000000131 CA to the device in sequence, wherein the interval for sending the designated data is 5 seconds.
4. The method of claim 1, further comprising:
responding to unsuccessful analysis of the registration packet sent by the Internet of things platform to the equipment, and sending data 6801000000000068110433333D 33 BC 16 to the equipment;
in response to the device sending the reply data, determining whether the reply data begins at 68 and is different from the sent data and conforms to the CS sum check;
in response to the reply data beginning at 68 and being different from the sent data and conforming to the CS checksum, determining that the protocol for interfacing the device with the internet of things is the DLT645 protocol.
5. The method of claim 1, further comprising:
and in response to the fact that the Internet of things platform fails to analyze the registration packet sent by the equipment and the fact that the protocol for docking with the Internet of things is determined to fail, repeating the steps for 2 to 3 times.
6. An apparatus for actively registering a platform of internet of things by a device, the apparatus comprising:
a sending module configured to send a registration packet to an internet of things platform through an IP address and a port number of the internet of things platform in response to a device being connected to the internet of things platform;
the analysis module is configured to respond to the successful analysis of the registration packet sent by the Internet of things platform to the equipment and store the information of the equipment into a database;
The judgment module is configured to determine a protocol for interfacing with the internet of things according to information of a registration packet sent by a device, wherein the determination of the protocol for interfacing between the device and the internet of things according to the information of the registration packet sent by the device includes: judging whether the size of a registration packet sent by equipment exceeds 30 bytes, responding to the fact that the size of the registration packet sent by the equipment exceeds 30 bytes, judging whether data in the registration packet contains CmdType and has a value of REGISTER, responding to the fact that the data in the registration packet contains CmdType and has a value of REGISTER, determining that a protocol for butting the equipment and the Internet of things is a GB28181 protocol, wherein the protocol for butting the equipment and the Internet of things according to the information of the registration packet sent by the equipment further comprises the following steps: judging whether the size of a registration packet sent by equipment exceeds 30 bytes, responding to the fact that the size of the registration packet sent by the equipment does not exceed 30 bytes, judging whether a first byte of data in the registration packet is binary data XXX 10000 or not, responding to the fact that the first byte of the data in the registration packet is binary data XXX 10000, judging whether the first three bits of the binary data XXX 10000 are equal to the length of a residual message or not, responding to the fact that the first three bits of the binary data XXX 10000 are equal to the length of the residual message, judging whether data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT or not, responding to the fact that the data formed by the fourth byte, the fifth byte, the sixth byte and the seventh byte of the data in the registration packet is MQTT, and determining that a protocol for butting the equipment and the Internet of things is an MQTT protocol;
A saving module configured to save information of the docked protocol in a database, changing a state of the device to accessed.
7. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN202210154659.7A 2022-02-21 2022-02-21 Method, device, equipment and medium for equipment to actively register Internet of things platform Active CN114244648B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210154659.7A CN114244648B (en) 2022-02-21 2022-02-21 Method, device, equipment and medium for equipment to actively register Internet of things platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210154659.7A CN114244648B (en) 2022-02-21 2022-02-21 Method, device, equipment and medium for equipment to actively register Internet of things platform

Publications (2)

Publication Number Publication Date
CN114244648A CN114244648A (en) 2022-03-25
CN114244648B true CN114244648B (en) 2022-06-28

Family

ID=80747573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210154659.7A Active CN114244648B (en) 2022-02-21 2022-02-21 Method, device, equipment and medium for equipment to actively register Internet of things platform

Country Status (1)

Country Link
CN (1) CN114244648B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766913B (en) * 2022-11-09 2024-08-09 国网湖南省电力有限公司 Automatic registration method and system for electric power internet of things terminal, equipment and storage medium
CN117714564B (en) * 2024-02-05 2024-04-23 成都汉度科技有限公司 Universal DLT645 protocol analysis method and device based on java language

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103686848A (en) * 2012-09-18 2014-03-26 中国移动通信集团公司 Method, gateway, platform and system for processing messages of family Internet of Things
CN105897652A (en) * 2014-10-21 2016-08-24 北京京航计算通讯研究所 Standard protocol based heterogeneous terminal dynamic access method
CN106549863A (en) * 2016-10-27 2017-03-29 北京物联港科技发展有限公司 A kind of things-internet gateway, terminal and its protocol self-adapting method and apparatus
CN109150703A (en) * 2018-08-23 2019-01-04 北方工业大学 Intelligent cloud gateway for industrial Internet of things and communication method thereof
CN112312590A (en) * 2020-10-10 2021-02-02 腾讯科技(深圳)有限公司 Equipment communication protocol identification method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818040A (en) * 2020-07-06 2020-10-23 统一通信(苏州)有限公司 Method for realizing communication by Internet of things transmission standard protocol

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103686848A (en) * 2012-09-18 2014-03-26 中国移动通信集团公司 Method, gateway, platform and system for processing messages of family Internet of Things
CN105897652A (en) * 2014-10-21 2016-08-24 北京京航计算通讯研究所 Standard protocol based heterogeneous terminal dynamic access method
CN106549863A (en) * 2016-10-27 2017-03-29 北京物联港科技发展有限公司 A kind of things-internet gateway, terminal and its protocol self-adapting method and apparatus
CN109150703A (en) * 2018-08-23 2019-01-04 北方工业大学 Intelligent cloud gateway for industrial Internet of things and communication method thereof
CN112312590A (en) * 2020-10-10 2021-02-02 腾讯科技(深圳)有限公司 Equipment communication protocol identification method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《Access Control Model for IoT Environment Including Automated Configuration》;Kenta Yokogi等;《IEEE》;20180622;616-621 *

Also Published As

Publication number Publication date
CN114244648A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN114244648B (en) Method, device, equipment and medium for equipment to actively register Internet of things platform
JP4122341B2 (en) System and method for session resetting between client terminal device and server
JP4971324B2 (en) Automatic management of mobile device capabilities
US8402132B2 (en) Method, system and device for device capabilities exchange
US11395189B2 (en) State machine handling at a proxy node in an Ethernet-based fronthaul network
US7383541B1 (en) Method and apparatus providing interoperation of execution images of different versions
US20130036453A1 (en) System, method and user interface for network status reporting
JP5361750B2 (en) Medical information communication connection management apparatus and medical information communication connection management method
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
CN101651721A (en) Method and system for judging type of network address translation equipment
CN115499489B (en) Method, device, equipment and readable medium for managing sub-network in link
US20230208679A1 (en) Tunnel Keepalive Method, Network Device, System, and Storage Medium
CN111405018B (en) File transmission method and device, electronic equipment and storage medium
US20070130346A1 (en) Method for maintaining telnet session, telnet agency and computer network system
CN113992508A (en) Local area network automatic networking method of intelligent equipment and intelligent equipment
US10033689B2 (en) Method for addressing node address for device management and apparatus therefor
CN117596091A (en) Method and system for scanning Profinet bus device by adopting DCP protocol
WO2020113936A1 (en) Bidirectional forwarding detection (bfd) parameter negotiation method, apparatus and chip
CN115190042B (en) Network target range target access state detection system and method
US6763001B1 (en) Discovering non managed devices in a network such as a LAN using telnet
CN109861796B (en) Communication connection method, client, cloud and readable storage medium
CN111294382A (en) Real-time data pushing method and device
CN114244734B (en) Message sending method and device
CN115118398B (en) Protocol fault tolerance testing method and system of PPP client based on Ethernet
JP4411188B2 (en) Online system and communication method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230403

Address after: Room 701, 7th Floor, S01 Building, 1036 Langchao Road, High-tech Zone, Jinan City, Shandong Province, 250101

Patentee after: Inspur Digital Grain Storage Technology Co.,Ltd.

Address before: 250101 Inspur science and Technology Park, 1036 Inspur Road, hi tech Zone, Jinan City, Shandong Province

Patentee before: Inspur Genersoft Co.,Ltd.