CN117793164A - Internet of things communication method, device, equipment and storage medium - Google Patents

Internet of things communication method, device, equipment and storage medium Download PDF

Info

Publication number
CN117793164A
CN117793164A CN202311862117.6A CN202311862117A CN117793164A CN 117793164 A CN117793164 A CN 117793164A CN 202311862117 A CN202311862117 A CN 202311862117A CN 117793164 A CN117793164 A CN 117793164A
Authority
CN
China
Prior art keywords
internet
things
gateway
equipment
control instruction
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
CN202311862117.6A
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.)
Shenzhen Qianhai Yanxiang Asia Pacific Electronic Equipment Technology Co ltd
Original Assignee
Shenzhen Qianhai Yanxiang Asia Pacific Electronic Equipment 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 Shenzhen Qianhai Yanxiang Asia Pacific Electronic Equipment Technology Co ltd filed Critical Shenzhen Qianhai Yanxiang Asia Pacific Electronic Equipment Technology Co ltd
Priority to CN202311862117.6A priority Critical patent/CN117793164A/en
Publication of CN117793164A publication Critical patent/CN117793164A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides an Internet of things communication method, device, equipment and storage medium. The method comprises the steps of receiving a control instruction message sent to internet of things equipment by an internet of things platform, wherein the control instruction message comprises the following components: frame header and operation instruction; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is used for indicating the gateway to execute related type service operation by the internet of things platform; according to the Internet of things equipment identification in the equipment identification field, the operation instruction in the control instruction message is sent to the Internet of things equipment; and executing related business operations according to the content of the business operation type field. According to the technical scheme, the gateway of the Internet of things can perform various business operations according to the business operation type field carried in the received control instruction message, and the parameter configuration efficiency of the gateway of the Internet of things is improved.

Description

Internet of things communication method, device, equipment and storage medium
Technical Field
The application belongs to the technical field of internet of things communication, and particularly relates to an internet of things communication method, device, equipment and storage medium.
Background
In the related art, the gateway can only complete the function of transparent transmission, and the parameter setting work of the gateway is also required to be carried out manually and independently, when the main body communicating with the gateway is replaced, the parameters of the gateway are often required to be reset, the parameters of the gateway are modified manually each time, and the parameter configuration efficiency of the gateway is low.
Disclosure of Invention
The invention aims to provide an Internet of things communication method, device, equipment and storage medium, which aim to solve the problem that a gateway cannot automatically configure relevant parameters according to received control instruction messages to cause a great deal of labor waste in the related art.
A first aspect of an embodiment of the present application provides an internet of things communication method, applied to an internet of things gateway, where the method includes:
receiving a control instruction message sent to internet of things equipment by an internet of things platform, wherein the control instruction message comprises: frame header and operation instruction; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is used for indicating the gateway to execute related type service operation by the internet of things platform;
according to the Internet of things equipment identifier in the equipment identifier field, the operation instruction in the control instruction message is sent to the Internet of things equipment;
and executing related business operations according to the content of the business operation type field.
A second aspect of the embodiments of the present application provides an internet of things communication method, applied to an internet of things platform, where the method includes:
responding to an operation request sent by a client to the Internet of things equipment, and determining equipment identification and an operation instruction of the Internet of things equipment;
determining a frame header of a control instruction message according to the service operation type requirement of the gateway and the equipment identifier;
determining a control instruction message according to the frame header and the operation instruction;
sending the control instruction message to an Internet of things gateway;
and receiving a feedback message sent by the gateway of the Internet of things, wherein the feedback message carries the result of the operation instruction executed by the equipment of the Internet of things, and sending the feedback message to the client so that the client obtains the result of the operation instruction.
A third aspect of the embodiments of the present application provides an internet of things communication device, applied to an internet of things gateway, including:
the first receiving module is used for receiving a control instruction message sent to the internet of things equipment by the internet of things platform, and the control instruction message comprises: frame header and operation instruction; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is used for indicating the gateway to execute related type service operation by the internet of things platform;
the first sending module is used for sending the operation instruction in the control instruction message to the Internet of things equipment according to the Internet of things equipment identifier in the equipment identifier field;
and the processing module is used for executing related business operations according to the content of the business operation type field.
A fourth aspect of the present embodiment provides an internet of things communication device, applied to an internet of things platform, including:
the first determining module is used for responding to an operation request sent by the client to the Internet of things equipment and determining equipment identification and an operation instruction of the Internet of things equipment;
the second determining module is used for determining the frame head of the control instruction message according to the service operation type requirement of the gateway and the equipment identifier;
the third determining module is used for determining a control instruction message according to the frame header and the operation instruction;
the second sending module is used for sending the control instruction message to the gateway of the Internet of things;
the second receiving module is configured to receive a feedback packet sent by the gateway of the internet of things, where the feedback packet carries a result of the operation instruction executed by the device of the internet of things, and send the feedback packet to the client, so that the client obtains the result of the operation instruction.
A fifth aspect of the embodiments of the present application provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the computer program.
A fourth aspect of the embodiments of the present application provides a storage medium storing a computer program which, when executed by a processor, implements the steps of the method as described above.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the gateway of the Internet of things receives a control instruction message sent to the equipment of the Internet of things by the platform of the Internet of things, wherein the control instruction message comprises: frame header, operation instruction and check bit; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is configured to instruct the gateway to execute a service operation of a related type by using the platform of the internet of things. In this way, by carrying the above service operation type field in the control instruction message, the internet of things platform can enable the internet of things gateway to execute various service operations, so that service operation efficiency of the internet of things gateway is improved, no separate manual operation is needed for carrying out service operation on the internet of things gateway, operation efficiency of the internet of things gateway in service operation is also improved, the internet of things gateway can carry out various service operations according to the service operation type field carried in the received control instruction message, the service operation can be closely related to the current control instruction message, which is more beneficial to the internet of things equipment to execute the control instruction, and can provide good surrounding environment, such as meter reading instructions carried out by a user, a tight heartbeat connection is needed between the internet of things gateway and the internet of things platform, connection safety is improved, if connection between the internet of things gateway and the internet of things platform is disconnected, collected data of various internet of things equipment cannot be returned to the internet of things platform, and a user cannot acquire various collected data of the internet of things equipment.
Drawings
Fig. 1 is a schematic diagram of a system architecture of internet of things communication according to an embodiment of the present application;
fig. 2 is a flowchart of a communication method of the internet of things according to an embodiment of the present application;
FIG. 3 is a flowchart of another communication method of Internet of things according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an internet of things communication device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another communication device of internet of things according to an embodiment of the present application;
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical schemes and beneficial effects to be solved by the present application more clear, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It will be understood that when an element is referred to as being "mounted" or "disposed" on another element, it can be directly on the other element or be indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or be indirectly connected to the other element.
It is to be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate or are based on the orientation or positional relationship shown in the drawings, merely to facilitate description of the present application and simplify description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be configured and operated in a particular orientation, and therefore should not be construed as limiting the present application.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Fig. 1 shows a scene diagram of an internet of things communication system provided in a preferred embodiment of the present application, where the system includes an internet of things device, an internet of things gateway and an internet of things platform. Wherein, the thing networking device can include: water meter, ammeter, sensor and collector, etc. In the system, the Internet of things platform and an Internet of things gateway are connected with the same Mqtt server, and the communication is performed through the same group of topics of publishing and subscribing. And the user sends meter reading information to the Internet of things platform through the client, wherein meter reading means that acquired data of all Internet of things devices are acquired. And the internet of things platform encapsulates meter reading instructions of the equipment to the Mqtt server, the Mqtt server issues Mqtt messages to the internet of things gateway, and the internet of things gateway sends the messages to the internet of things equipment. The Internet of things equipment reports the acquired data to the Internet of things gateway, and then sends the acquired data to the Internet of things platform, and returns to the client of the user.
In the related art, the message forwarding work is carried out along with the gateway of the internet of things, wherein many needed parameter configuration works often need to be carried out manually, but cannot be carried out automatically. Based on the above, the application provides an Internet of things communication method.
Fig. 2 shows a flowchart of a communication method of the internet of things according to the preferred embodiment of the present application, for convenience of explanation, only the portions related to the present embodiment are shown, and the details are as follows:
the communication method of the Internet of things is applied to a gateway and can comprise the following steps:
in step S102, a control instruction packet sent by the internet of things platform to the internet of things device is received, where the control instruction packet includes: frame header and operation instructions.
The frame header at least comprises a plurality of service operation type fields and a device identification field of the internet of things device. The service operation type field is configured to instruct the gateway to execute a service operation of a related type by using the platform of the internet of things.
In this embodiment, the gateway may be instructed to perform related types of service operations according to the current scenario needs. For example, in the current scenario, a heartbeat connection needs to be indicated between the gateway and the platform of the internet of things, and the security of the connection is improved through a heartbeat detection mechanism, and then a field for executing the gateway to establish the heartbeat connection may be included in the service operation type field.
For example, in the current scenario, an operation that instructs the gateway to execute a task at regular time is required, and in the service operation type field, a field that instructs the gateway to execute the task at regular time may be set.
In step S104, the operation instruction in the control instruction packet is sent to the internet of things device according to the internet of things device identifier in the device identifier field.
In step S106, the relevant business operation is performed according to the content of the business operation type field.
The above step S106 may be performed before the above step S104, or the above step S106 and the above step S104 may be performed simultaneously.
According to the technical scheme, the gateway of the Internet of things receives a control instruction message sent to the Internet of things equipment by the platform of the Internet of things, wherein the control instruction message comprises: frame header, operation instruction and check bit; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is configured to instruct the gateway to execute a service operation of a related type by using the platform of the internet of things. In this way, by carrying the above service operation type field in the control instruction message, the internet of things platform can enable the internet of things gateway to execute various service operations, so that the service operation of the internet of things gateway is improved, no separate manual operation is needed for carrying out the service operation on the internet of things gateway, the operation efficiency of the service operation on the internet of things gateway is also improved, the internet of things gateway can carry out various service operations according to the service operation type field carried in the received control instruction message, the service operation can be closely related to the current control instruction message, which is more beneficial to the internet of things equipment to execute the control instruction, and can provide good surrounding environment, such as meter reading instructions carried out by a user, the tight heartbeat connection is needed between the internet of things gateway and the internet of things platform, the connection safety is improved, if the connection between the internet of things gateway and the internet of things platform is disconnected, the acquired data of various internet of things equipment cannot be returned to the internet of things platform, and the user cannot acquire the acquired data of the internet of things equipment.
In some embodiments, the control instruction packet further includes a check field, and before step S104, the method for communication of the internet of things may further include the following steps:
and according to the check field, checking the operation instruction, specifically, the operation instruction can be checked by a sampling check algorithm to obtain a calculated check value, if the calculated check value is the same as the check value in the check field, the check is passed, and if the calculated check value is different from the check value in the check field, the check is not passed. The check algorithm may be a sum check algorithm or a parity check algorithm.
In some embodiments, the frame header may further include the following fields:
device identification field, reserved field, command source field. The reserved field is used for indicating the internet of things gateway to execute a timing task or indicating the internet of things gateway to execute offline maintenance. The command source field is used to indicate the source location of the control command, and may also be understood as a link. Wherein the source location may include: user identification, page identification, and task identification.
See table 1 for the field structure of control instruction messages:
frame header field Operation instruction field Check field
TABLE 1
The check algorithm can adopt sum check, and check bit= (Byte [0] +byte [1] +byte [2] + … … +byte [ n-1 ]) 0x0FF during sum check.
For example, control instruction packet bits: 0x112233445566XX, wherein XX is a sum check bit, xx= (0x11+0x22+0x33+0x44+0x55+0x66) & 0xff=0x65.
See field distribution in header shown in table 2:
TABLE 2
Wherein the device identification field starts from 01 and is 255 (0 xFF) max.
A command source identification field for tracking which user is the command triggered at which interface or task; starting from 01, 255 (0 xFF) max.
And checking: check bit= (Byte [0] +byte [1] +byte [2] + … … +byte [ n-1 ]) 0x0FF.
For example 0x112233445566XX, where XX bits and check bits, xx= (0x11+0x22+0x33+0x44+0x55+0x66) & 0xff=0x65. Wherein 0x indicates that the control instruction message is 16.
In some embodiments, the above-mentioned business operation type field includes one or several of the following: the system comprises a heartbeat related operation field, a serial port parameter field for configuring a serial port for communicating the Internet of things gateway with the Internet of things device, a security identification field for configuring the Internet of things gateway, an Internet of things gateway initialization field and an upgrade field for upgrading the Internet of things gateway.
In this embodiment, the above-mentioned internet of things gateway and the above-mentioned internet of things device are connected through an RS485 serial port, and the above-mentioned serial port parameter field may instruct the above-mentioned internet of things gateway to perform serial port parameter setting work, where the serial port parameter may be set according to the current requirement of the control instruction, so that dynamic configuration of the serial port parameter may be implemented, and different serial port parameters may be set according to different control instructions. Serial port parameters may include, but are not limited to: baud rate, data bits, stop bits, check bits.
See serial port parameter set field shown in table 3:
for example, the fields of the serial port are: 0x03080100, wherein 0x represents 16 bins, 03 represents baud rate 9600, and 08 represents data bits: 01 represents a stop bit: 00 indicates no verification.
The gateway response data is defined as follows, and the configuration success is represented by 0x00, and the configuration failure is represented by 0x01.
See the business operation type field shown in table 4:
in this embodiment, the service operation types include: configuring serial port parameters; and the gateway of the Internet of things executes the operation of configuring the serial port parameters in response to the determination that the service operation type is the configuration serial port parameters.
The service operation types include: configuring a heartbeat interval; and the gateway of the Internet of things executes the operation of configuring the heartbeat interval in response to the determination that the service operation type is configured the heartbeat interval.
The service operation types include: upgrading; and the gateway of the Internet of things executes upgrading operation in response to determining that the service operation type is upgrading.
The service operation types include: and configuring a security identifier. For example, the security identifiers may be sequentially set to 1, 2, 3, and 4 in order of security level from small to large. And the gateway of the Internet of things executes the operation of configuring the security identifier in response to the determination that the service operation type is configuring the security identifier.
The service operation types include: controlling the first equipment to restart; and the gateway of the Internet of things executes restarting operation in response to determining that the service operation type is to control the restarting of the first equipment.
The service operation types include: initializing the first equipment access state; and the gateway of the Internet of things executes the operation of deleting the second device in response to the fact that the service operation type is determined to be the initialization of the access state of the first device.
The service operation types include: initializing the first equipment access state; and the gateway of the Internet of things executes the operation of clearing data in response to the fact that the service operation type is determined to be the initialization of the access state of the first equipment.
The service operation types include: controlling a restarting operation; and the gateway of the Internet of things restarts in response to determining that the service operation type is a control restarting operation.
In some embodiments, the frame header further includes a reserved field, where the reserved field is used to instruct the internet of things gateway to perform a timing task, or is used to instruct the internet of things gateway to perform offline maintenance.
In this embodiment, the gateway of the internet of things may perform a timing task according to the reserved field, or perform an offline maintenance task.
In some embodiments, the frame header further comprises a command source field: the command source field is used for representing the source position of the control instruction message; the above communication method of the internet of things may further include the following steps:
and receiving feedback data sent after the Internet of things equipment executes the operation instruction.
And packaging the frame header and the feedback data to obtain a feedback message.
And sending the feedback message to the internet of things platform according to the source position of the control instruction, so that the internet of things platform sends the feedback message according to the source position of the control instruction.
In some embodiments, the above-mentioned communication method of the internet of things may further include the following steps:
and performing check operation on the feedback data by adopting a check algorithm to obtain a check value, wherein the feedback message can also comprise the check value.
In this embodiment, after the gateway of the internet of things receives the control message, the gateway of the internet of things analyzes the control message according to a protocol to obtain a frame header, an operation instruction and a check value. Checking the control message according to the check bit value, and caching the frame header of the control message after the check bit value passes the check; and transmitting the operation instruction to the Internet of things equipment through the RS485 serial port. The internet of things equipment returns a feedback operation result to the internet of things gateway through the RS485, wherein the operation result comprises but is not limited to environment data, sensor data, equipment state and the like. The system can also comprise collected business data, wherein the collected business data can comprise various data types such as temperature, humidity, illumination intensity, current, voltage and the like. And the gateway of the Internet of things assembles the operation result, the cached frame header and the cached check bit and sends the operation result, the frame header and the cached check bit to the platform of the Internet of things through an Mqtt protocol. And the internet of things platform sends the feedback message according to the source position of the control instruction. For example, the source position of the control instruction is set to user 01, page 2, task 10.
For example, the control instruction message issued by the internet of things platform is 0X01000101000104. Wherein 0X represents 16, 0100010100 is a frame header, 04 is a check value, and 01 is operation instruction data sent to the internet of things device.
In a second aspect, the present application proposes an internet of things communication method, referring to fig. 3, applied to an internet of things platform, where the method may include the following steps:
step S302, in response to an operation request sent by a client for the Internet of things equipment, determining the equipment identification and the operation instruction of the Internet of things equipment.
The operation request may be to request each internet of things device to report the collected data. Tasks may also be performed for each internet appliance at regular time. The operation instruction may be generated according to the operation request described above.
The operation request carries the device identifier of the internet of things device.
Step S304, the frame head of the control instruction message is determined according to the service operation type requirement of the gateway and the equipment identification.
Step S306, determining a control instruction message according to the frame header, the operation instruction and the operation instruction.
Step S308, the control instruction message is sent to the gateway of the Internet of things.
Step S310, receiving a feedback message sent by the gateway of the internet of things, where the feedback message carries a result of the operation instruction executed by the device of the internet of things, and sending the feedback message to the client, so that the client obtains the result of the operation instruction.
In some embodiments, the above-mentioned internet of things communication method may further include the following steps:
the operation instruction may be subjected to a check algorithm operation to obtain a check value, and the frame header may further include the check value.
In some embodiments, in response to a request operation sent by a client to an internet of things device, source location information of the request operation is determined.
The source location information may include: user identification, web page identification and task identification. Source location information may be further included in the frame header.
And determining the frame head of the control instruction message according to the service operation type requirement of the gateway, the equipment identifier and the source position information.
The following describes in detail an internet of things communication method, which comprises the following steps:
1. in the page of the client, the user can click a meter reading button on a single device, and the user identification, the page identification and the session identification are transmitted to the Internet of things platform.
2. And the internet of things platform encapsulates meter reading instructions of the equipment.
1) Assume that the meter reading instruction of the device is 0x0108FF01, where 0x represents 16.
2) Business operation type field: 0x01.
3) Sub-function field: 0x04.
4) And (3) equipment identification: 0x00 (assuming that the device is the first device under the gateway).
5) Reserved bits: 00.
6) And a check field: 0x0E.
7) The above fields are written into the cache, key=mqtt: 01:04:00:00:00, value= { user id, page id, session id }. Wherein a command source field of 00 indicates. In some embodiments, the command source field may be a specific field, for example, the field may include a user identification, a page identification, and a session identification. In this embodiment, the command source field is written with the value described above. And caching the key value and the value in the gateway of the Internet of things.
8) The control command message sent by the internet of things platform to the internet of things gateway is prefix + operation instruction + check value 0x01040000000108FF010E. Wherein 0x represents 16.
3. The internet of things platform publishes to the MQTT theme.
4. After receiving the subscribed main body information, the gateway of the internet of things executes the following operations:
1) Checking whether the operation instruction is correct according to the check value 0E; if the control command message is incorrect, the alarm information can be sent to the Internet of things platform, and the Internet of things platform is requested to send the control command message again.
2) The decomposed header 0104000000 is cached in memory.
3) And transmitting the operation instruction data 0108FF01 to the Internet of things equipment through RS 485.
5. The gateway of the Internet of things receives the returned data of the equipment of the Internet of things, and the assumption is 0x01; wherein 0x represents 16.
1) The buffered header 0104000000 is fetched.
2) And (3) calculating and checking: 0x010400000001 =0x06.
3) Combining the check values, the frame header and the feedback data to obtain a feedback message: 0x01040000000106.
6. The gateway of the internet of things issues the feedback message to the mqtt theme.
7. The internet of things platform receives the feedback message, 0x01040000000106, uploaded by the internet of things gateway.
1) Checking whether the returned data is correct or not according to the check value 06; if the feedback message is incorrect, the feedback message is discarded, and an alarm message can be sent to the gateway of the Internet of things to request to resend the feedback message once.
2) The header content is decomposed 0104000000.
3) And analyzing the data 01 returned by the equipment.
8. And matching the service scene according to the content.
1) And decomposing out the equipment identification: 00.
2) Matching key: mqtt:01:04:00:00:00, value= { user id, page id, session id } is found from the cache.
3) Matching user identification+device identification: 00, determining the device name.
4) And matching the session id and the page id, determining the page seen by the client of the user, and storing 01 data into a database.
5) The interface at the back end of the page request returns 01 from the database to display to the page.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
In a third aspect, the present application proposes an internet of things communication device, referring to fig. 4, applied to a first apparatus, where the first internet of things communication device 4 includes:
the first receiving module 41 is configured to receive a control instruction packet sent by the internet of things platform to the internet of things device, where the control instruction packet includes: frame header and operation instruction; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is used for indicating the gateway to execute related type service operation by the internet of things platform;
a first sending module 42, configured to send the operation instruction in the control instruction packet to the internet of things device according to the internet of things device identifier in the device identifier field;
a processing module 43, configured to perform related business operations according to the content of the business operation type field.
In some embodiments, the frame header further comprises a command source field: the command source field is used for representing the source position of the control instruction message; the apparatus may further include:
the first receiving module is further configured to receive feedback data sent by the internet of things device after the operation instruction is executed.
And the packaging module is used for packaging the frame header and the feedback data to obtain a feedback message.
The first sending module is further configured to send the feedback message to the internet of things platform according to the source position, so that the internet of things platform sends the feedback message according to the source position.
In some embodiments, the control instruction packet further includes a check field, and the apparatus further includes a first check module configured to check the operation instruction according to the check field.
In a fourth aspect, the present application proposes an internet of things communication apparatus, referring to fig. 5, applied to a second device, where the second internet of things communication apparatus 5 may include:
the first determining module 51 is configured to determine, in response to an operation request sent by a client for an internet of things device, a device identifier and an operation instruction of the internet of things device.
A second determining module 52, configured to determine a frame header of the control instruction packet according to the service operation type requirement for the gateway and the device identifier.
And a third determining module 53, configured to determine a control instruction packet according to the frame header and the operation instruction.
And the second sending module 54 is configured to send the control instruction packet to the gateway of the internet of things.
The second receiving module 55 is configured to receive a feedback packet sent by the gateway of the internet of things, where the feedback packet carries a result of the operation instruction executed by the device of the internet of things, and send the feedback packet to the client, so that the client obtains the result of the operation instruction.
In some embodiments, the foregoing apparatus may further include a fourth determining module, configured to determine, in response to a request operation sent by the client for the internet of things device, source location information of the request operation.
The second determining module is further configured to determine a frame header of the control instruction packet according to a service operation type requirement on the gateway of the internet of things, the device identifier and the source location information.
In some embodiments, the system further includes a second checking module, configured to perform a checking algorithm operation on the operation instruction to obtain a check value. The frame header may further include a check value.
Fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present application. As shown in fig. 6, the electronic device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in the memory 61 and executable on the processor 60, such as an internet of things communication program. The processor 60, when executing the computer program 62, implements the steps of the various internet of things communication method embodiments described above, such as steps 102 through 106 shown in fig. 2. Alternatively, the processor 60 may perform the functions of the modules/units in the above embodiments of the apparatus when executing the computer program 62, for example, the first receiving module 41, the first transmitting module 42, the processing module 43, or the first determining module 51, the second determining module 52, the third determining module 53, the second transmitting module 54, and the second receiving module 55 shown in fig. 4 and 5.
By way of example, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used to describe the execution of the computer program 62 in the electronic device 6. For example, the computer program 62 may be divided into a first receiving module 41, a first transmitting module 42, a processing module 43, or a first determining module 51, a second determining module 52, a third determining module 53, a second transmitting module 54, a second receiving module 55.
The electronic device 6 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The electronic device may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is merely an example of the electronic device 6 and is not meant to be limiting as the electronic device 6 may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device may further include an input-output device, a network access device, a bus, etc.
The processor 60 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the electronic device 6, such as a hard disk or a memory of the electronic device 6. The memory 61 may be an external storage device of the electronic device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 61 is used for storing the computer program and other programs and data required by the electronic device. The memory 61 may also be used for temporarily storing data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. 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 present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each method embodiment described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. The communication method of the Internet of things is characterized by being applied to a gateway of the Internet of things, and comprises the following steps:
receiving a control instruction message sent to internet of things equipment by an internet of things platform, wherein the control instruction message comprises: frame header and operation instruction; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is used for indicating the gateway to execute related type service operation by the internet of things platform;
according to the Internet of things equipment identifier in the equipment identifier field, the operation instruction in the control instruction message is sent to the Internet of things equipment;
and executing related business operations according to the content of the business operation type field.
2. The Internet of things communication method of claim 1, wherein,
the business operation type field comprises one or more of the following: the system comprises a heartbeat related operation field, a serial port parameter field for configuring a serial port through which the Internet of things gateway and the Internet of things equipment communicate, a security identification field for configuring the Internet of things gateway, an Internet of things gateway initialization field for configuring the Internet of things gateway and an upgrade field for configuring the Internet of things gateway for upgrading.
3. The internet of things communication method of claim 1, wherein the frame header further comprises:
and the reserved field is used for indicating the Internet of things gateway to execute a timing task or indicating the Internet of things gateway to execute offline maintenance.
4. The internet of things communication method of claim 1, wherein the frame header further comprises a command source field: the command source field is used for representing the source position of the control instruction message; the method further comprises the steps of:
receiving feedback data sent by the Internet of things equipment after executing the operation instruction;
encapsulating the frame header and the feedback data to obtain a feedback message;
and sending the feedback message to the internet of things platform according to the source position, so that the internet of things platform sends the feedback message according to the source position.
5. The communication method of the Internet of things is characterized by being applied to an Internet of things platform, and comprises the following steps:
responding to an operation request sent by a client to the Internet of things equipment, and determining equipment identification and an operation instruction of the Internet of things equipment;
determining a frame header of a control instruction message according to the service operation type requirement of the gateway and the equipment identifier;
determining a control instruction message according to the frame header and the operation instruction;
sending the control instruction message to an Internet of things gateway;
and receiving a feedback message sent by the gateway of the Internet of things, wherein the feedback message carries the result of the operation instruction executed by the equipment of the Internet of things, and sending the feedback message to the client so that the client obtains the result of the operation instruction.
6. The internet of things communication method of claim 5, further comprising:
responding to request operation of the Internet of things equipment sent by a client, and determining source position information of the request operation;
and determining the frame header of the control instruction message according to the service operation type requirement of the gateway of the Internet of things, the equipment identifier and the source position information.
7. The utility model provides a thing networking communication device which characterized in that is applied to thing networking gateway, includes:
the first receiving module is used for receiving a control instruction message sent to the internet of things equipment by the internet of things platform, and the control instruction message comprises: frame header and operation instruction; the frame header at least comprises a plurality of service operation type fields and a device identification field of the Internet of things device; the service operation type field is used for indicating the gateway to execute related type service operation by the internet of things platform;
the first sending module is used for sending the operation instruction in the control instruction message to the Internet of things equipment according to the Internet of things equipment identifier in the equipment identifier field;
and the processing module is used for executing related business operations according to the content of the business operation type field.
8. The utility model provides a thing networking communication device which characterized in that is applied to thing networking platform, includes:
the first determining module is used for responding to an operation request sent by the client to the Internet of things equipment and determining equipment identification and an operation instruction of the Internet of things equipment;
the second determining module is used for determining the frame head of the control instruction message according to the service operation type requirement of the gateway and the equipment identifier;
the third determining module is used for determining a control instruction message according to the frame header and the operation instruction;
the second sending module is used for sending the control instruction message to the gateway of the Internet of things;
the second receiving module is configured to receive a feedback packet sent by the gateway of the internet of things, where the feedback packet carries a result of the operation instruction executed by the device of the internet of things, and send the feedback packet to the client, so that the client obtains the result of the operation instruction.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 4 or any one of claims 5 to 6 when the computer program is executed.
10. A storage medium storing a computer program, which when executed by a processor performs the steps of the method according to any one of claims 1 to 4, or any one of claims 5 to 6.
CN202311862117.6A 2023-12-28 2023-12-28 Internet of things communication method, device, equipment and storage medium Pending CN117793164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311862117.6A CN117793164A (en) 2023-12-28 2023-12-28 Internet of things communication method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311862117.6A CN117793164A (en) 2023-12-28 2023-12-28 Internet of things communication method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117793164A true CN117793164A (en) 2024-03-29

Family

ID=90396260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311862117.6A Pending CN117793164A (en) 2023-12-28 2023-12-28 Internet of things communication method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117793164A (en)

Similar Documents

Publication Publication Date Title
CN109510759B (en) System and method for realizing rapid universal multi-protocol gateway
US20180007173A1 (en) Data Processing Method and Apparatus for Performing Protocol Parsing in a Cloud
CN108337120A (en) A kind of remote upgrade method of internet-of-things terminal equipment
CN112685248B (en) Intelligent network card monitoring log acquisition method and device, electronic equipment and storage medium
CN111083168A (en) Configurable data transmission method and device of Internet of things platform gateway and gateway
CN112788128B (en) Business information pushing method and device, storage medium and electronic device
CN110928561B (en) Vehicle controller software version management method and device, vehicle and storage medium
CN111694828A (en) Data processing method, device, system and storage medium
CN108429739A (en) A kind of method, system and the terminal device of identification honey jar
CN112087475A (en) Message pushing method and device for cloud platform component application and message server
CN113965904A (en) Device registration method, device and storage medium
CN117793164A (en) Internet of things communication method, device, equipment and storage medium
KR20220074972A (en) System performance parameter transmission method, apparatus, management equipment and storage medium
CN114138771B (en) Abnormal data processing method and device and electronic equipment
CN107885169A (en) A kind of collection method of field data, device and system
CN113965447B (en) Online cloud diagnosis method, device, system, equipment and storage medium
CN115134380A (en) Data transmission method and device, electronic equipment and storage medium
US20220368780A1 (en) Assembly type edge system
CN117061588B (en) Device access method, electronic device, and computer-readable storage medium
CN113141366B (en) Message submitting method and device, storage medium and electronic equipment
CN110971644A (en) Page access monitoring method and device
CN220085381U (en) Device for remote reading and writing of serial port equipment
CN118158289B (en) Meteorological automatic station standard format data message transmission method, device and equipment
CN114363311B (en) Message reporting method and system for simulation tool of intelligent operation and maintenance monitoring system of turnout
CN114172877B (en) Middleware data transmission method, device, equipment and storage medium based on HTTP protocol

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication