A communication device for IoT devices

The communication device for IoT devices addresses security issues in IoT data transmission by using a main control module and auxiliary module to securely package and transmit data to the cloud, enhancing data integrity and security.

CN115865956BActive Publication Date: 2024-12-10BYD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111117467.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-23
Publication Date
2024-12-10
Estimated Expiration
2041-09-23

AI Technical Summary

Technical Problem

Existing methods for IoT devices reporting device information to the cloud result in poor security of the device information.

Method used

A communication device for IoT devices comprising a main control module, an auxiliary module, and a first communication module, which collects and stores device information, generates information frame data, packages it according to a preset format, and transmits it securely to the cloud through encryption and acknowledgement responses, ensuring data integrity and security.

Benefits of technology

Enhances the security and integrity of data transmission by preventing hacker attacks and ensuring data integrity during network disconnections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865956B_ABST
    Figure CN115865956B_ABST
Patent Text Reader

Abstract

The present disclosure provides a communication device for an Internet of Things device, comprising a main control module, an auxiliary module and a first communication module for connecting to the cloud; the main control module is configured to collect device information of the Internet of Things device and store the device information in its own database, and the main control module is also configured to generate information frame data according to the device information in the database at a set frequency, and send the information frame data to the auxiliary module; the auxiliary module is configured to package and process the received information frame data according to a preset format, and transmit the obtained data packet to the cloud through the first communication module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The disclosed embodiments relate to the technical field of circuit design, and more specifically, to a communication device for an Internet of Things device. Background Art

[0002] The Internet of Things refers to the use of various devices and technologies such as information sensors, radio frequency identification technology, global positioning system, infrared sensors, laser scanners, etc. to collect any objects or processes that need to be monitored, connected, and interacted in real time, and collect various required information such as sound, light, heat, electricity, mechanics, chemistry, biology, and location. Through various possible network access, it realizes ubiquitous connection between objects and objects and between objects and people, and realizes intelligent perception, identification, and management of objects and processes. The Internet of Things is an information carrier based on the Internet, traditional telecommunications networks, etc. It allows all ordinary physical objects that can be independently addressed to form an interconnected network.

[0003] In the prior art, in order to record the device information reported by each IoT device, a related background management service is usually established in the cloud, and the IoT device directly reports its own device information to the cloud.

[0004] However, this method of IoT devices directly reporting device information to the cloud results in poor security of the device information. Summary of the invention

[0005] An objective of the embodiments of the present disclosure is to provide a technical solution to improve the security of device information reported to the cloud by IoT devices.

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided a communication device for an Internet of Things device, comprising a main control module, an auxiliary module, and a first communication module for connecting to a cloud;

[0007] The main control module is configured to collect device information of the IoT device and store the device information in its own database. The main control module is also configured to generate information frame data according to the device information in the database at a set frequency and send the information frame data to the auxiliary module.

[0008] The auxiliary module is configured to package the received information frame data according to a preset format, and transmit the obtained data packets to the cloud through the first communication module.

[0009] Optionally, the information frame data includes a function code, a check code, data and an end code in sequence; and the data packet includes a packet length, a function code, a check code and data in sequence.

[0010] Optionally, the auxiliary module is further configured to send corresponding reply frame data to the main control module when receiving the information frame data, wherein the reply frame data is used to indicate whether the corresponding information frame data is received successfully.

[0011] Optionally, the main control module is also configured to issue a warning if no corresponding reply frame data is received within a set time after sending the information frame data to the auxiliary module.

[0012] Optionally, the auxiliary module is also configured to receive the control instruction issued by the cloud through the first communication module, and generate the reply frame data according to the control instruction, so that the reply frame data includes the control instruction.

[0013] Optionally, the reply frame data includes a function code, a reception correct and error flag, a control instruction code and an end code in sequence.

[0014] Optionally, the main control module is further configured to execute the control instruction when the control instruction is contained in the parsed reply frame data.

[0015] Optionally, the main control module is further configured to resend the current information frame data when the number of consecutive times of receiving the current reply frame data is less than or equal to a preset number threshold; wherein the current reply frame data is reply frame data indicating that the auxiliary module has not successfully received the current information frame data;

[0016] The main control module is also configured to stop sending the current information frame data, record an error log, and send the next information frame data to the auxiliary module when the consecutive number is greater than the number threshold.

[0017] Optionally, the auxiliary module is further configured to send a notification to the main control module to stop sending information frame data through the reply frame data when abnormal communication between the communication device and the cloud is detected;

[0018] The main control module is configured to stop executing the steps of generating information frame data according to the device information in the database at a set frequency and sending the information frame data to the auxiliary module when receiving a notification of stopping sending information frame data.

[0019] Optionally, the auxiliary module is further configured to send a notification to the main control module to continue sending the information frame data through the reply frame data when it is detected that the communication device and the cloud resume normal communication;

[0020] The main control module is also configured to: upon receiving a notification to continue sending information frame data, determine device information that has not been uploaded during the network disconnection period according to the timestamp of receiving the notification to stop sending information frame data, generate information frame data according to the device information that has not been uploaded, and send the information frame data to the auxiliary module.

[0021] Optionally, the auxiliary module is further configured to call a preset program interface when the data packet is obtained, encrypt the data packet, and transmit it to the cloud through the first communication module.

[0022] Optionally, the communication device also includes a second communication module for connecting to a local area network, and the main control module is also configured to receive a data query request input by a client in the local area network through the second communication module, and return a data query result to the client through the second communication module in response to the data query request.

[0023] Optionally, the auxiliary module is further configured to, upon receiving a resending notification sent by the cloud, repack the received information frame data according to a preset format, and transmit the obtained new data packet to the cloud through the first communication module;

[0024] The resending notification is sent by the cloud when it detects that the data packet is incomplete.

[0025] By uploading the collected device information of the IoT devices to the cloud through the communication device in the embodiment of the present disclosure, the security and integrity of data transmission can be improved.

[0026] In addition, the main control module is connected to the auxiliary module of Microsoft Cloud encryption authentication through the serial port. The main control module transmits data to the auxiliary module through the serial port receiving processing program, and the auxiliary module is connected to the Microsoft Cloud, which can realize data security on the cloud and prevent hacker attacks.

[0027] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0029] Figure 1 is a block diagram of a communication device of an Internet of Things device according to an embodiment of the present disclosure;

[0030] Figure 2is a block diagram of a communication device of an Internet of Things device according to another embodiment of the present disclosure;

[0031] Figure 3 is a schematic diagram of a serial communication process between a main control module and an auxiliary module according to an embodiment of the present disclosure;

[0032] Figure 4 It is a schematic diagram of the communication process between the auxiliary module and the cloud according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0033] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0034] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0035] Technologies, methods and equipment known to persons of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods and equipment should be considered part of the specification.

[0036] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0037] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0038] The present disclosure provides a communication device for an Internet of Things device. Figure 1 Schematic diagram of a communication device of an Internet of Things device according to an embodiment of the present disclosure.

[0039] like Figure 1 As shown, the communication device 1000 of the Internet of Things device may include a main control module 1100, an auxiliary module 1200 and a first communication module 1300 for connecting to the cloud.

[0040] The IoT device 2000 in this embodiment may be, for example, an energy storage system. The device information of the IoT device may be battery information of the energy storage system, such as battery model, voltage, current, temperature, and the like.

[0041] The main control module 1100 is configured to collect device information of the Internet of Things devices and store the device information in its own database. The main control module 1100 is also configured to generate information frame data according to the device information in the database at a set frequency and send the information frame data to the auxiliary module.

[0042] In this embodiment, the main control module 1100 may be provided by a Cortex-A7 32-bit microprocessor. Specifically, it may be equipped with a memory and a flash memory, and a database is set in the program of the main control module 1100, and the database may be stored in the flash memory. In one example, the capacity of the memory of the main control module 1100 may be 256M, and the capacity of the flash memory may also be 256M.

[0043] In an example, Figure 2 As shown, the main control module 1100 may be provided with a collection program, a database and a first serial port sending and receiving processing program.

[0044] The collection program may collect device information of IoT devices at a set frequency and store the collected device information in a database.

[0045] The database may store different types of device information into corresponding data tables according to the interval requirements of the sending time.

[0046] The first serial port sending and receiving program can take a data table record from the corresponding data table at a predetermined time interval to perform framing, obtain information frame data, and send the information frame data to the auxiliary module.

[0047] The predetermined time interval may be pre-set for each data table according to an application scenario or specific requirements. For example, the time interval corresponding to one data table may be 1 second, and the time interval corresponding to another data table may be 1 minute.

[0048] Specifically, for different data tables, the first serial port sending and receiving program can take a data table record from the corresponding data table at different time intervals to perform framing, obtain information frame data, and send the information frame data to the auxiliary module.

[0049] In one embodiment of the present disclosure, the information frame data may include a function code, a check code, data and an end code in sequence.

[0050] In an example, the data structure of the information frame data may be as shown in Table 1 below.

[0051] Table 1

[0052]

[0053] The auxiliary module 1200 is configured to package the received information frame data according to a preset format, and transmit the obtained data packets to the cloud 3000 through the first communication module 1300.

[0054] In this embodiment, the auxiliary module 1200 may be provided by a Cortex-A7 32-bit microprocessor, and may be specifically equipped with memory and flash memory (flash), and the capacity of the configured memory and flash may be slightly smaller.

[0055] In an example, Figure 2 As shown, the auxiliary module 1200 may be provided with a second serial port sending and receiving processing program and a cloud client processing program.

[0056] The second serial port sending and receiving processing program may package the received information frame data according to a preset format, and transmit the obtained data packet to the cloud client processing program.

[0057] The cloud client processing program may transmit the data packet to the cloud through the first communication module.

[0058] The received information frame data is packaged and processed according to a preset format to obtain a data packet, and then the data packet is transmitted to the cloud, which can achieve efficient and secure data transmission with a minimum number of bytes.

[0059] In one embodiment of the present disclosure, the auxiliary module 1200 may also be configured to call a preset program interface when a data packet is obtained, encrypt the data packet, and transmit it to the cloud through the first communication module 1300.

[0060] The auxiliary module 1200 may also be provided with an encryption verification interface and a security assurance program for secure communication with the cloud. After the cloud client processing program organizes the data packets uploaded to the cloud, it calls the communication encryption verification interface to achieve secure data upload.

[0061] Furthermore, after the second serial port transceiver processor receives the information frame data sent by the first serial port transceiver processor, it can easily remove the terminator, verify the packet length according to the function code classification and attach it to the packet header, obtain the data packet, and transmit the data packet to the cloud client processor; the cloud client processor uses the program interface provided in the cloud client SDK to add corresponding handshake, encryption, verification and other measures to securely transmit the data packet to the cloud.

[0062] Specifically, the cloud client processing program may be configured to call a preset program interface to encrypt the data packet and transmit the encrypted data packet to the cloud through the first communication module.

[0063] The cloud also uses predefined function codes to verify the integrity of the data packet, and when it detects that the data packet is complete, it writes the data in the data packet into the cloud database for the cloud display interface to call and display the data in the cloud database.

[0064] When the cloud detects that the received data packet is incomplete, it will send a resend notification to the auxiliary module 1200.

[0065] The auxiliary module 1200 may be configured to repackage the information frame data according to a preset format upon receiving a retransmission notification, and transmit the obtained new data packet to the cloud via the first communication module 1300 .

[0066] In one embodiment of the present disclosure, a data packet may include a packet length, a function code, a check code and data in sequence.

[0067] In one example, the structure of the data packet may be as shown in Table 2 below:

[0068] Table 2

[0069]

[0070] By uploading the collected device information of the IoT devices to the cloud through the communication device in the embodiment of the present disclosure, the security and integrity of data transmission can be improved.

[0071] In addition, the main control module is connected to the auxiliary module of Microsoft Cloud encryption authentication through the serial port. The main control module transmits data to the auxiliary module through the serial port receiving processing program, and the auxiliary module is connected to the Microsoft Cloud, which can realize data security on the cloud and prevent hacker attacks.

[0072] In one embodiment of the present disclosure, the auxiliary module 1200 may also be configured to send corresponding reply frame data to the main control module 1100 upon receiving information frame data, wherein the reply frame data is used to indicate whether the corresponding information frame data is received successfully.

[0073] In this embodiment, the second serial port sending and receiving processing program of the auxiliary module 1200 may send corresponding reply frame data to the first serial port sending and receiving processing program of the main control module 1100 each time when receiving information frame data.

[0074] That is to say, under normal circumstances, each time the first serial port sending and receiving processing program sends information frame data to the second serial port sending and receiving processing program, the second serial port sending and receiving processing program will return the reply frame data corresponding to the latest received information frame data to the first serial port sending and receiving processing program upon receiving the information frame data.

[0075] Through this embodiment, during the serial port communication process between the main control module 1100 and the auxiliary module 1200, a master-slave acknowledgement response method is adopted to ensure the correctness and efficiency of the transmission of the reply frame data.

[0076] Furthermore, the main control module 1100 may also be configured to issue a warning if the corresponding reply frame data is not received within a set time after sending the information frame data to the auxiliary module 1200.

[0077] In this embodiment, the set time may be pre-set according to the application scenario or specific requirements. For example, the set time may be 3 seconds.

[0078] If no corresponding reply frame data is received within 3 seconds after the first serial port sending and receiving processing program of the main control module 1100 sends information frame data to the second serial port sending and receiving processing program of the auxiliary module 1200, it means that the information frame data sent by the main control module 1100 may be lost. Therefore, the main control module 1100 can issue a warning to remind the user of the abnormal serial port communication, check the hardware or re-burn the program of the auxiliary module 1200.

[0079] In one example, the way of issuing a warning may include controlling a buzzer to sound, or controlling an indicator light to emit light. On the basis of issuing a warning, a log may also be recorded for subsequent tracing of the data transmission process.

[0080] Furthermore, the main control module can also be configured to resend the current information frame data when the number of consecutive times the current reply frame data is received is less than or equal to a preset number threshold. The current reply frame data is reply frame data corresponding to the current information frame data and indicating that the auxiliary module 1200 has not successfully received the current information frame data.

[0081] The main control module 1100 may also be configured to record an error log, generate and send the next information frame data to the auxiliary module 1200 when the number of consecutive times the current reply frame data is received is greater than a threshold number.

[0082] The error log in this embodiment may be a log indicating that the auxiliary module fails to successfully receive the current information frame data.

[0083] The number threshold may be pre-set according to application scenarios or specific requirements. For example, the number threshold may be 3.

[0084] Specifically, the first serial port sending and receiving processing program sends the current information frame data to the second serial port sending and receiving processing program, and after the second serial port sending and receiving processing program receives the current information frame data, it sends the corresponding current reply frame data to the first serial port sending and receiving processing program. If the current reply frame data indicates that the current information frame data fails to be received, the first serial port sending and receiving processing program re-sends the current information frame data to the second serial port sending and receiving processing program, and the first serial port sending and receiving processing program re-sends the current information frame data to the second serial port sending and receiving processing program for a continuous number of times not exceeding a set number.

[0085] In one embodiment of the present disclosure, the auxiliary module 1200 may also be configured to receive a control instruction sent from the cloud through the first communication module 1300, and generate reply frame data according to the control instruction, so that the reply frame data includes the control instruction. The reply frame data may be specifically as shown in Table 3.

[0086] When the cloud issues relevant instructions, the security requirements are high due to the small amount of data. When the cloud is a backend management service based on Microsoft Cloud, the cloud can directly use the instructions of the Microsoft Cloud IOT channel to issue corresponding control quality, maximize the use of Microsoft Cloud's mature security interaction mechanism, and ensure the safe issuance of control instructions.

[0087] Furthermore, the main control module 1100 may also be configured to execute the control instruction when the control instruction is contained in the parsed reply frame data.

[0088] In one embodiment of the present disclosure, the reply frame data may include a function code, a reception correct and error flag, a control instruction code and an end code in sequence.

[0089] In an example, the data structure of the reply frame data may be as shown in Table 3 below.

[0090] Table 3

[0091]

[0092]

[0093] In this embodiment, if Figure 2 As shown, a central control program may also be provided in the main control module 1100. The first serial port sending and receiving processing program may determine whether the reply frame data contains a control instruction by parsing the reply frame data, and transmit the control instruction to the central control program if the reply frame data contains a control instruction. The central control program executes the received control instruction.

[0094] In one embodiment of the present disclosure, the auxiliary module 1200 may also be configured to send a notification to stop sending information frame data to the main control module 1100 via reply frame data when abnormal communication between the communication device 1000 and the cloud is detected.

[0095] The main control module is configured to stop executing the steps of generating information frame data according to device information in a database at a set frequency and sending the information frame data to the auxiliary module when receiving a notification to stop sending information frame data.

[0096] Since the communication device 1000 communicates abnormally with the cloud, the auxiliary module cannot transmit the data packet to the cloud. Therefore, in order to avoid data omission or loss, the main control module may stop generating information frame data and then transmit the information frame data to the cloud through the auxiliary module, and only save the collected device information in the database.

[0097] Furthermore, the auxiliary module 1200 can also be configured to send a notification to the main control module 1100 to continue sending information frame data via reply frame data when it is detected that the communication device 1000 has resumed normal communication with the cloud.

[0098] The main control module 1100 can also be configured to, upon receiving a notification to continue sending information frame data, determine device information that has not been uploaded during the network disconnection period based on the timestamp of receiving the notification to stop sending information frame data, generate information frame data based on the device information that has not been uploaded, and send the information frame data to the auxiliary module 1200.

[0099] In this embodiment, the device information stored in the database has a timestamp indicating its collection time, so the device information that was not uploaded during the network disconnection period can be determined based on the timestamp of receiving the notification of stopping sending information frame data. Specifically, the device information that was not uploaded can be the device information whose timestamp indicating its collection time is after the timestamp of receiving the notification of stopping sending information frame data.

[0100] The main control module 1100 can generate information frame data according to the device information that has not been uploaded at a set frequency, and send the generated information frame data to the auxiliary module so that the auxiliary module can package and process the received information frame data according to a preset format and transmit the obtained data packet to the cloud through the first communication module.

[0101] Through this embodiment, the problem of data loss in the event of a network disconnection between the communication device and the cloud can be avoided, thereby ensuring the integrity of data transmitted between the communication device and the cloud.

[0102] In one embodiment of the present disclosure, Figure 2As shown, the communication device 1000 may also include a second communication module 1400, and the main control module 1100 may also be configured to receive a data query request input by the client through the second communication module 1400, and in response to the data query request, return a data query result to the client through the second communication module 1400.

[0103] In this embodiment, the second communication module 1400 can be used for local data access, installation and monitoring, and has the characteristics of fast access speed and fast data transmission speed.

[0104] Specifically, the communication device can be connected to the local area network through the second communication module 1400 to manage the Internet of Things devices.

[0105] In this embodiment, if Figure 2 As shown, the main control module 1100 may also be provided with a Web program or an external data interface server program.

[0106] Specifically, the user can use the client to access the web of the main control module 1100 through the IP address of the second communication module 1400 to query data or view the current operating status of the energy storage system.

[0107] The user can also set in the client not to upload the device information to the cloud, but to keep the device information locally. There is no need for the main control module to generate information frame data based on the device information in the database and send the information frame data to the auxiliary module. There is no need for the auxiliary module to package and process the received information frame data according to a preset format and transmit the obtained data packet to the cloud through the first communication module 1300.

[0108] A second communication module that does not pass through the auxiliary module is set in the communication device, which not only ensures the speed of local data transmission when there is no need to upload to the cloud, but also takes into account the security of data transmission through the Internet when it needs to be uploaded to the cloud.

[0109] Through the communication device of this embodiment, it is possible to flexibly respond to and solve the needs of users to monitor the operation of the Internet of Things device under different network conditions. When there is a network on site, the operation of the Internet of Things device can be easily monitored by accessing the cloud service anytime and anywhere. Even if there is no network on site, the operation of the Internet of Things device can be efficiently monitored by accessing the page service provided by the second communication module through the client.

[0110] <Example 1>

[0111] Figure 3The figure is a schematic diagram of the serial communication process between the main control module and the auxiliary module according to an embodiment of the present disclosure. The solid line in the figure represents the implementation process of the main control module and the auxiliary module respectively, and the dotted line represents the implementation process of the interaction between the main control module and the auxiliary module.

[0112] like Figure 3 As shown, the serial communication process between the main control module and the auxiliary module may include steps S3001 to S3013 as shown below:

[0113] Step S3001: the main control module 1100 collects device information of the Internet of Things devices.

[0114] Step S3002: the main control module 1100 stores the device information in its own database.

[0115] Step S3003 , the main control module 1100 generates information frame data according to the device information in the database at a set frequency.

[0116] Step S3004 , the main control module 1100 sends the information frame data to the auxiliary module 1200 .

[0117] Step S3005: the auxiliary module 1200 receives information frame data.

[0118] Step S3006 , the auxiliary module 1200 sends reply frame data corresponding to the received information frame data to the main control module 1100 .

[0119] In step S3007, the main control module 1100 detects whether the corresponding reply frame data is received within the set time. If yes, step S3009 is executed; if not, step S3008 is executed.

[0120] Step S3008: the main control module 1100 issues a warning.

[0121] Step S3009: the main control module 1100 parses the reply frame data.

[0122] In step S3010, the main control module 1100 executes the control instruction when the reply frame data includes the control instruction.

[0123] In step S3011, the main control module 1100 determines whether the reply frame data indicates that the auxiliary module successfully receives the information frame data. If so, step S3003 is executed; if not, step S3012 is executed.

[0124] In step S3012, the main control module 1100 determines whether the number of consecutive times of receiving the reply frame data indicating that the auxiliary module successfully receives the information frame data exceeds the number threshold, if yes, execute step S3013; if no, execute step S3003.

[0125] Step S3013: the main control module 1100 stops sending the information frame data and records an error log.

[0126] <Example 2>

[0127] Figure 4 The figure is a schematic diagram of the communication process between the auxiliary module and the cloud according to an embodiment of the present disclosure. The solid lines in the figure represent the implementation process of the auxiliary module and the cloud, respectively, and the dotted lines represent the implementation process of the interaction between the auxiliary module and the cloud.

[0128] like Figure 4 As shown, the communication process between the auxiliary module and the cloud may include steps S4001 to S4009 as shown below:

[0129] In step S4001, the auxiliary module 1200 detects whether the network connection between the test communication device and the cloud is normal. If so, step S4002 is executed; if not, step S4003 is executed.

[0130] Step S4002, the auxiliary module 1200 sends a notification to the main control module to stop sending information frame data, so that the main control module stores the data in a local database and uploads it after the network is restored.

[0131] Step S4003: the auxiliary module 1200 receives the information frame data sent by the main control module.

[0132] Step S4004: the auxiliary module 1200 packages the received information frame data according to a preset format to obtain a data packet.

[0133] In step S4005, the auxiliary module 1200 transmits the data packet to the cloud via the first communication module.

[0134] In step S4006, the cloud 3000 detects whether the received data packet is complete. If so, it continues to execute step S4007; if not, it re-executes step S4008.

[0135] In step S4007, the cloud 3000 writes the data in the data packet into the cloud database.

[0136] Step S4008, the cloud 3000 sends a resending notification to the auxiliary module 1200.

[0137] Step S4009: the auxiliary module 1200 receives the resending notification and re-executes step S4004.

[0138] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A communication device for an Internet of Things device, characterized in that: It includes a main control module, an auxiliary module and a first communication module for connecting to the cloud; The main control module is configured to collect device information of the IoT device and store the device information in its own database. The main control module is also configured to generate information frame data according to the device information in the database at a set frequency and send the information frame data to the auxiliary module. The auxiliary module is configured to package the received information frame data according to a preset format, and transmit the obtained data packet to the cloud through the first communication module; The communication device further comprises a second communication module for connecting to a local area network, and the main control module is further configured to receive a data query request input by a client in the local area network through the second communication module, and in response to the data query request, return a data query result to the client through the second communication module; The information frame data includes a function code, a check code, data and an end code in sequence, the function code of the information frame data is a start code, the data packet includes a packet length, a function code, a check code and data in sequence, and the function code indicates the functional meaning of the data; The auxiliary module is also configured to receive the control instructions issued by the cloud through the first communication module, and generate reply frame data according to the control instructions so that the reply frame data includes the control instructions; wherein the reply frame data includes a function code, a reception correct and error mark, a control instruction code and an end code in sequence.

2. The communication device according to claim 1, characterized in that The auxiliary module is further configured to send corresponding reply frame data to the main control module when receiving the information frame data, wherein the reply frame data is used to indicate whether the corresponding information frame data is received successfully.

3. The communication device according to claim 2, characterized in that The main control module is also configured to issue a warning if the corresponding reply frame data is not received within a set time after the information frame data is sent to the auxiliary module.

4. The communication device according to claim 1, characterized in that The main control module is further configured to execute the control instruction when the control instruction is contained in the parsed reply frame data.

5. The communication device according to claim 2, characterized in that The main control module is further configured to resend the current information frame data when the number of consecutive times of receiving the current reply frame data is less than or equal to a preset number threshold; wherein the current reply frame data is reply frame data indicating that the auxiliary module has not successfully received the current information frame data; The main control module is also configured to stop sending the current information frame data, record an error log, and send the next information frame data to the auxiliary module when the consecutive number is greater than the number threshold.

6. The communication device according to claim 1, characterized in that The auxiliary module is also configured to call a preset program interface when receiving the data packet, encrypt the data packet, and transmit the encrypted data packet to the cloud through the first communication module.

7. The communication device according to claim 2, characterized in that The auxiliary module is further configured to send a notification of stopping sending information frame data to the main control module through the reply frame data when abnormal communication between the communication device and the cloud is detected; The main control module is configured to stop executing the steps of generating information frame data according to the device information in the database at a set frequency and sending the information frame data to the auxiliary module when receiving a notification of stopping sending information frame data.

8. The communication device according to claim 7, characterized in that: The auxiliary module is further configured to send a notification to the main control module to continue sending information frame data through the reply frame data when it is detected that the communication device and the cloud resume normal communication; The main control module is also configured to: upon receiving a notification to continue sending information frame data, determine device information that has not been uploaded during the network disconnection period according to the timestamp of receiving the notification to stop sending information frame data, generate information frame data according to the device information that has not been uploaded, and send the information frame data to the auxiliary module.

9. The communication device according to claim 1, characterized in that The auxiliary module is further configured to, upon receiving a resending notification sent by the cloud, repack the received information frame data according to a preset format, and transmit the obtained new data packet to the cloud through the first communication module; The resending notification is sent by the cloud when it detects that the data packet is incomplete.

Citation Information

Patent Citations

  • Ammeter data collection system based on NB-IoT (Narrow Band Internet of Things)

    CN107240247A

  • Design method of communication protocol based on serial port communication

    CN112910856A