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

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

Info

Publication number
CN115695504B
CN115695504B CN202310000647.3A CN202310000647A CN115695504B CN 115695504 B CN115695504 B CN 115695504B CN 202310000647 A CN202310000647 A CN 202310000647A CN 115695504 B CN115695504 B CN 115695504B
Authority
CN
China
Prior art keywords
message
data
format
target
internet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310000647.3A
Other languages
Chinese (zh)
Other versions
CN115695504A (en
Inventor
王晓峰
袁金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongfang Hezhi Data Technology Guangdong Co ltd
Original Assignee
Dongfang Hezhi Data Technology Guangdong 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 Dongfang Hezhi Data Technology Guangdong Co ltd filed Critical Dongfang Hezhi Data Technology Guangdong Co ltd
Priority to CN202310000647.3A priority Critical patent/CN115695504B/en
Publication of CN115695504A publication Critical patent/CN115695504A/en
Application granted granted Critical
Publication of CN115695504B publication Critical patent/CN115695504B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a communication method, a device, equipment and a storage medium for an Internet of things platform, wherein the method comprises the following steps: acquiring initial messages reported to a target Internet of things platform by different emqx servers; when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data verification type; if the message belongs to the data verification type, performing data verification on the initial message; and analyzing the initial message after the verification is finished, acquiring a json format target message corresponding to the action type of the message, and sending the json format target message to the target Internet of things platform. According to the method and the device, the initial message is analyzed into the json format target message after the initial message data is verified, the problem that the message format packaged by the existing emqx component cannot be directly read, used and circulated by an Internet of things platform is solved, the use of the returned content of the component is more convenient, and the user experience is improved.

Description

Internet of things platform communication method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of industrial Internet of things, in particular to a communication method, a device, equipment and a storage medium for an Internet of things platform.
Background
In the existing industrial internet of things, for mqtt equipment, information exchange between the equipment and an internet of things platform needs to be carried out by two parties in advance to negotiate an information format. The existing emqx open source component uniformly packages the message report of the equipment, but for an industrial internet of things platform with a large amount of equipment data, the message format packaged by the component cannot be directly used for reading, using and circulating of the internet of things platform, so that the content returned by the component is not convenient enough in the use of the industrial internet of things platform, and the user experience is influenced.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a communication method, a communication device, communication equipment and a storage medium for an Internet of things platform, and aims to solve the technical problems that in the prior art, the message format packaged by a component cannot be directly used for reading, using and circulating of the Internet of things platform, so that the content returned by the component is not convenient enough in the use of the industrial Internet of things platform, and the user experience is influenced.
In order to achieve the above object, the present invention provides an internet of things platform communication method, including the following steps:
acquiring initial messages reported to a target Internet of things platform by different emqx servers;
when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data verification type;
if the initial message belongs to the data verification type, performing data verification on the initial message;
analyzing the initial message after the verification is completed, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform.
Optionally, before the step of determining whether the message action type of the initial message belongs to a data check type when the initial message meets the preprocessing condition, the method further includes:
judging whether an action instruction in the initial message belongs to a preset standard instruction, whether user data in the initial message is empty, and whether a target theme in the initial message conforms to a rule configured by the target Internet of things platform;
if the action instruction belongs to the preset standard instruction, the user data is not empty, and the target theme conforms to the rule configured by the target Internet of things platform, judging that the initial message conforms to a preprocessing condition.
Optionally, the data verification includes a data format verification and a data content verification, and if the data format verification belongs to the data verification type, the step of performing data verification on the initial message includes:
if the type of the data format check belongs to the data format check type, carrying out data format check on the format of the target directory in the initial message;
and when the format verification is successful, performing data content verification on the target content in the initial message.
Optionally, if the format of the target directory in the initial message belongs to the data format check type, the step of performing data format check on the format of the target directory in the initial message includes:
if the data format is of the data format check type, detecting whether the format of the target directory in the initial message lacks preset content;
if the preset content is not lost, judging that the format verification is successful;
and if the preset content is lacked, judging that the format check fails.
Optionally, when the format verification is successful, the step of performing data content verification on the target content in the initial message includes:
when the format verification is successful, judging whether the target content in the initial message conforms to the correct content defined by the target Internet of things platform;
if the correct content is met, judging that the data content is verified successfully;
and if the correct content is not met, judging that the data content verification fails.
Optionally, before the step of analyzing the initial message after the verification is completed and obtaining the json format target message corresponding to the message action type, the method further includes:
and when the verification of the data content fails, performing data cleaning on the target content to obtain a cleaned initial message, and taking the cleaned initial message as the initial message after the verification is completed.
Optionally, after the step of determining whether the message action type of the initial message belongs to a data check type when the initial message meets the preprocessing condition, the method further includes:
and if the data is not in the data verification type, analyzing the initial message to obtain a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform.
In addition, in order to achieve the above object, the present invention further provides an internet of things platform communication device, where the device includes:
the message acquisition module is used for acquiring initial messages reported to a target Internet of things platform by different emqx servers;
the type judging module is used for judging whether the message action type of the initial message belongs to a data verification type when the initial message meets the preprocessing condition;
the verification module is used for performing data verification on the initial message if the initial message belongs to the data verification type;
and the message analysis module is used for analyzing the initial message after the verification is finished, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform.
In addition, in order to achieve the above object, the present invention further provides an internet of things platform communication device, including: the system comprises a memory, a processor and an internet of things platform communication program stored on the memory and capable of running on the processor, wherein the internet of things platform communication program is configured to realize the steps of the internet of things platform communication method.
In addition, in order to achieve the above object, the present invention further provides a storage medium, where an internet of things platform communication program is stored, and when executed by a processor, the internet of things platform communication program implements the steps of the internet of things platform communication method described above.
The invention discloses a communication method, a device, equipment and a storage medium for an Internet of things platform, wherein the method comprises the following steps: acquiring initial messages reported to a target Internet of things platform by different emqx servers; when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data check type; if the message belongs to the data verification type, performing data verification on the initial message; and analyzing the initial message after the verification is finished, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform. According to the method and the device, the initial message is analyzed into the json format target message after the initial message data is checked, the problem that the message format packaged by the existing emqx component cannot be directly read, used and circulated by an Internet of things platform is solved, the process of using the content returned by the component is more convenient, and the user experience is improved.
Drawings
Fig. 1 is a schematic structural diagram of an internet of things platform communication device in a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a communication method of an internet of things platform according to a first embodiment of the invention;
fig. 3 is a schematic diagram of data analysis in a first embodiment of the internet of things platform communication method according to the present invention;
fig. 4 is a schematic flowchart of a communication method of an internet of things platform according to a second embodiment of the present invention;
fig. 5 is a schematic flowchart of a communication method of an internet of things platform according to a third embodiment of the present invention;
fig. 6 is a block diagram of a first embodiment of an internet of things platform communication device according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an internet of things platform communication device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the internet of things platform communication device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001 described previously.
Those skilled in the art will appreciate that the architecture shown in fig. 1 does not constitute a limitation of an internet of things platform communication device and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and an internet of things platform communication program.
In the internet of things platform communication device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the platform communication device of the internet of things can be arranged in the platform communication device of the internet of things, and the platform communication device of the internet of things calls the platform communication program of the internet of things stored in the memory 1005 through the processor 1001 and executes the platform communication method of the internet of things provided by the embodiment of the invention.
An embodiment of the invention provides a communication method for an internet of things platform, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of the communication method for the internet of things platform.
In this embodiment, the internet of things platform communication method includes the following steps:
step S10: and acquiring initial information reported to a target Internet of things platform by different emqx servers.
It should be noted that the execution main body of the method of the embodiment may be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., and may also be other electronic devices that implement the same or similar functions. The present embodiment and the following embodiments are described below with reference to the internet of things platform communication device (communication device for short).
It can be understood that the above emqx server may be a server that transmits a communication message uploaded by a user device (e.g., an mqtt device) to a target internet of things platform, where different user devices have different corresponding emqx servers, and the emqx server includes an emqx open source component that uniformly encapsulates the message uploaded by the user device.
It should be noted that the target internet of things platform may be an internet of things platform that communicates with the user equipment and receives a message from the user equipment.
It can be understood that the device initial message may be a message including content transmitted by the device, such as device login, device logout, data reporting, and the like, and the initial message is generated by uniformly encapsulating initial content uploaded to the emqx server by the device.
In specific implementation, when the communication device is communicated with a target Internet of things platform, firstly, user equipment uploads content to be transmitted to an emqx server, an emqx open source component in the emqx server uniformly packages the content to be transmitted to form the initial message, and the initial message directly returned by different emqx servers is not traversed when the target Internet of things platform is in use, so that the communication device of the embodiment can intercept the initial message before the emqx server returns the initial message to the target Internet of things platform.
Step S20: and when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data verification type.
It should be noted that the preprocessing condition may be a condition for determining whether a message reported from the user equipment or the emqx server needs to be processed.
It can be understood that the data check type may be a message type requiring data check, and if data is reported, the data check type is used, and the device login is not the data check type.
In a specific implementation, when detecting that the initial message meets the preprocessing condition, the communication device indicates that the initial message meets the condition to be processed, and can determine whether the message action type of the initial message is a data verification type that needs to perform data verification, that is, what type of the initial message is, such as connection for reporting, login, offline, and data reporting.
Further, in order to improve the precision of message preprocessing, in this embodiment, before the step S20, the method further includes:
step S21: and judging whether the action instruction in the initial message belongs to a preset standard instruction, whether the user data in the initial message is empty, and whether the target theme in the initial message conforms to the rule configured by the target Internet of things platform.
It should be noted that the default specification command may be a motion command meeting the specification.
In a specific implementation, after the communication device acquires the initial message, it may determine whether an action instruction in the initial message belongs to the preset standard instruction, so as to determine whether the action instruction meets the standard, thereby avoiding reporting of a large amount of error action data due to a system error of an emqx source-opening component, and at the same time, it also needs to determine whether user data in the initial message is empty, thereby avoiding the user device from uploading invalid data, and finally, it also needs to determine whether a target theme in the initial message meets a rule configured by the target internet of things platform, thereby avoiding the user device from uploading a theme unmatched with the rule, and thus improving accuracy of message preprocessing.
Step S22: and if the action instruction belongs to the preset standard instruction, the user data is not empty, and the target theme conforms to the rule configured by the target Internet of things platform, judging that the initial message conforms to a preprocessing condition.
In a specific implementation, when the communication device determines that the action instruction, the user data, and the target topic all conform to the preprocessing condition, that is, the action instruction conforms to a specification, the user data is not null, and the target topic is matched with a rule configured by a target internet of things platform, it may be determined that the initial message conforms to the preprocessing condition and belongs to a message to be processed.
Step S30: and if the initial message belongs to the data verification type, performing data verification on the initial message.
In a specific implementation, when the communication device determines that the initial message belongs to the data verification type, where the initial message is a data reporting type message, data verification may be performed on the initial message, where the data verification may be to verify a data format or data content in the initial message, so as to ensure that a finally returned target message belongs to correct data defined by a target internet of things platform.
Step S40: analyzing the initial message after the verification is completed, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform.
It should be noted that the json format target message is a json format message, and the json format may be a format that can be accurately recognized by the target internet of things platform.
In specific implementation, after the initial message is checked, the communication equipment starts to analyze the initial message, the initial message is analyzed into a json format target message corresponding to the message action type, different actions are analyzed into different json messages, if the login is analyzed into a logged DFDJSON format, the messages in the json format are sent to a target Internet of things platform after the analysis is completed, so that the target Internet of things platform can accurately use the json format target message, the situation that the target Internet of things platform cannot identify messages returned by the emqx server is avoided, and the convenience of using the contents returned by the emqx server on the target Internet of things platform is effectively improved.
For ease of understanding, the description will be made with reference to fig. 3, but this scheme is not limited thereto. Fig. 3 is a schematic diagram of data analysis in a first embodiment of the internet of things platform communication method of the present invention, in the diagram, a DFDJSON driver is a communication device in this embodiment between an emqx server and a target internet of things platform, an initial message sent by the emqx server judges whether the message needs to be processed through message preprocessing, then information type processing is performed, that is, what type is determined, such as device connection, login, offline, data reporting, and the like, wherein the login and the offline are action types that do not need to perform data format verification, and then data content verification is directly performed, for action types belonging to the data format verification, if reporting connection and data reporting are performed, data format verification is performed, data content verification is performed after the data format verification is completed, a DFDJSON, that is, a json-format target message can be output after the data content verification is completed, and the final-format message is finally returned to the target internet of things platform, so as to implement communication between a user equipment and the internet of things platform.
In the embodiment, initial messages reported to a target Internet of things platform by different emqx servers are obtained; when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data verification type; if the initial message belongs to the data verification type, performing data verification on the initial message; and analyzing the initial message after the verification is finished, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform. According to the method and the device, the initial message is analyzed into the json format target message after the initial message data is verified, the problem that the message format packaged by the existing emqx component cannot be read, used and circulated by the Internet of things platform directly is solved, the use of the content returned by the component is more convenient and fast, and the user experience is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a communication method for an internet of things platform according to a second embodiment of the present invention.
Based on the first embodiment, in this embodiment, the data verification includes a data format verification and a data content verification, and the step S30 includes:
step S301: and if the data format is the data format check type, performing data format check on the format of the target directory in the initial message.
It should be noted that, in the process of encapsulating the initial content of the device, a system error of the emqx open-source component may cause part of the content of the encapsulated initial message to be missing, so that the target internet of things platform cannot identify or identify the incorrect message.
It is understood that the data format check type may be an action type that needs to perform data format check, such as data reporting.
It should be noted that the target directory may be a directory specified in the initial message, and the target directory may be specified by a technician according to actual situations, and mainly refers to the primary directory and the secondary directory in the initial message.
In a specific implementation, when the initial message belongs to the data format check type, that is, when the data format check is required, the communication device may check the format of the initial message, that is, read a target directory, such as a primary directory and a secondary directory, in the initial message, and perform the data format check on the target directory.
It should be understood that the above data format check mainly checks the format of the initial message, if the content delivered by the ue is not in a valid DFDJSON format, the emqx open source device does not check, the data format check of the present embodiment can effectively check the formats of the primary directory and the secondary directory in the initial message, and if a certain key or value is missing, the following data check is terminated.
Further, in order to improve the accuracy of the data format verification, in this embodiment, the step S301 includes:
step S3011: and if the data format is the data format check type, detecting whether the format of the target directory in the initial message lacks preset content.
It should be noted that the preset content may be a format of the target directory, and a content is required to be present, for example, a certain key or value, and if the preset content is missing, it indicates that the target directory of the initial message is incomplete, and the subsequent data check cannot be performed.
In a specific implementation, the communication device may perform data format check when the initial message is of a data format check type, and the data format check performed on the initial message may be to detect whether the target directory, that is, the formats of the primary directory and the secondary directory, is missing the preset content.
Step S3012: and if the preset content is not lost, judging that the format verification is successful.
In a specific implementation, when detecting that the format of the target directory does not lack the preset content, the communication device indicates that the initial message is complete, determines that the format verification is successful, and can perform subsequent data verification.
Step S3012': and if the preset content is lacked, judging that the format check fails.
In a specific implementation, when detecting that the format of the target directory lacks the preset content, the communication device indicates that the initial message is incomplete, determines that format verification fails, and cannot perform subsequent data verification, and terminates subsequent operations to reduce loss.
Step S302: and when the format verification is successful, performing data content verification on the target content in the initial message.
The target content may be specific content specified in the initial message, and the target content may be specified by a technician according to actual conditions, or may be all content in the initial message.
In a specific implementation, the communication device may perform data format verification on target content in the initial message when the initial message format verification is successful, where the data format verification process mainly performs data specific content verification on the content that the user fails to report, and according to a data format defined by the user on a target internet of things platform, such as a maximum data length, a maximum byte length, a data type, and the like, it is ensured that a finally generated json format target message is correct data defined by the target internet of things platform.
Further, in order to improve the accuracy of checking the data content, in this embodiment, the step S302 includes:
step S3021: and when the format verification is successful, judging whether the target content in the initial message conforms to the correct content defined by the target Internet of things platform.
In a specific implementation, when the data format is successfully checked, the communication device starts to check the data content, where the data content check may be to determine whether the target content in the initial message conforms to the correct content defined by the target internet of things platform, and may be to determine whether the maximum data length of the target content is correct, whether the maximum byte length is correct, whether the data type is correct, and the like.
Step S3022: and if the correct content is met, judging that the data content is verified successfully.
In specific implementation, when the communication device judges that the target content meets the correct content, the data content of the initial message meets the correct content defined by the target internet of things platform, the data content can be judged to be successfully verified, the verified initial message can be analyzed, and the content transmitted by the emqx open source component can be verified (data format verification and data content verification) and analyzed in advance.
Step S3022': and if the correct content is not met, judging that the data content verification fails.
In a specific implementation, when the communication device determines that the target content does not conform to the correct content, that is, one of the maximum data length, the maximum byte length, and the data type of the target content is incorrect, it indicates that the data content of the initial message has a problem, and may determine that the data content verification fails.
Further, in order to improve the analysis efficiency, in this embodiment, before the step S40, the method further includes:
step S41: and when the verification of the data content fails, performing data cleaning on the target content to obtain an initial message after cleaning, and taking the initial message after cleaning as the initial message after the verification is completed.
In specific implementation, when the initial message fails to be checked, the communication device indicates that data which does not conform to the correct content exists in the target content, data which does not conform to the limitation of the target internet of things platform can be cleaned, the data which does not conform to the correct content is removed, and then the cleaned initial message is used as the initial message after the checking is completed, so that the fact that the json target message which finally conforms to the correct data defined by the platform is ensured, the problem that the data content cannot be analyzed when the checking fails is avoided, and the analysis efficiency is effectively improved.
Referring to fig. 5, fig. 5 is a schematic flowchart of a communication method for an internet of things platform according to a third embodiment of the present invention.
Based on the foregoing embodiments, in this embodiment, after the step S20, the method further includes:
step S30': and if the data is not in the data verification type, analyzing the initial message to obtain a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform.
In specific implementation, if the initial message is not of the data verification type, that is, the initial message does not need to perform data format verification and data content verification, such as the logged-in or offline initial message, at this time, the initial message can be directly analyzed to be a json format target message corresponding to a message action type, if the login is analyzed to be a logged djdfson format, then the json format target message is sent to a target internet of things platform to complete communication, so that the content transmitted by the emqx open source component is analyzed in advance, and the accuracy of content transmission is ensured.
In addition, an embodiment of the present invention further provides a storage medium, where an internet of things platform communication program is stored on the storage medium, and the internet of things platform communication program, when executed by a processor, implements the steps of the internet of things platform communication method described above.
Referring to fig. 6, fig. 6 is a block diagram of a first embodiment of an internet of things platform communication device according to the present invention.
As shown in fig. 6, the internet of things platform communication device provided in the embodiment of the present invention includes:
the message obtaining module 501 is configured to obtain initial messages that are reported to a target internet of things platform by different emqx servers.
A type determining module 502, configured to determine whether a message action type of the initial message belongs to a data check type when the initial message meets a preprocessing condition.
A checking module 503, configured to perform data checking on the initial message if the initial message belongs to the data checking type.
And the message analysis module 504 is configured to analyze the initial message after the verification is completed, obtain a json format target message corresponding to the message action type, and send the json format target message to the target internet of things platform.
In the embodiment, initial messages reported to a target Internet of things platform by different emqx servers are obtained; when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data verification type; if the message belongs to the data verification type, performing data verification on the initial message; and analyzing the initial message after the verification is finished, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform. According to the method and the device, the initial message is analyzed into the json format target message after the initial message data is verified, the problem that the message format packaged by the existing emqx component cannot be read, used and circulated by the Internet of things platform directly is solved, the use of the content returned by the component is more convenient and fast, and the user experience is improved.
Other embodiments or specific implementation manners of the internet of things platform communication device may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a rom/ram, a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (6)

1. An Internet of things platform communication method is characterized by comprising the following steps:
acquiring initial messages reported to a target Internet of things platform by different emqx servers;
when the initial message meets the preprocessing condition, judging whether the message action type of the initial message belongs to a data verification type;
if the initial message belongs to the data verification type, performing data verification on the initial message;
analyzing the initial message after the verification is completed, obtaining a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform, wherein the format of the json format target message is a format recognized by the target Internet of things platform;
if the initial message belongs to the data verification type, performing data verification on the initial message, including:
if the data format is of the data format check type, reading a primary directory and a secondary directory in the initial message, and respectively detecting whether the format of the primary directory and the format of the secondary directory lack preset values;
when the preset value is not lost in the formats of the primary catalog and the secondary catalog, judging that the format verification is successful;
when the format of the primary directory lacks the preset value or the format of the secondary directory lacks the preset value, judging that the format verification fails;
when the format verification is successful, judging whether the maximum data length, the maximum byte length and the data type of the target content in the initial message accord with the correct content defined by the target Internet of things platform or not;
if the correct content is met, judging that the data content is verified successfully;
if the correct content is not met, judging that the data content verification fails;
and when the verification of the data content fails, performing data cleaning on the target content to obtain a cleaned initial message, and taking the cleaned initial message as the initial message after the verification is completed.
2. The internet of things platform communication method of claim 1, wherein before the step of determining whether the message action type of the initial message belongs to a data check type when the initial message meets a preprocessing condition, the method further comprises:
judging whether an action instruction in the initial message belongs to a preset standard instruction, whether user data in the initial message is empty, and whether a target theme in the initial message conforms to a rule configured by the target Internet of things platform;
and if the action instruction belongs to the preset standard instruction, the user data is not empty, and the target theme conforms to the rule configured by the target Internet of things platform, judging that the initial message conforms to a preprocessing condition.
3. The internet of things platform communication method of claim 1 or 2, wherein after the step of determining whether the message action type of the initial message belongs to a data check type when the initial message meets the preprocessing condition, the method further comprises:
and if the data is not in the data verification type, analyzing the initial message to obtain a json format target message corresponding to the message action type, and sending the json format target message to the target Internet of things platform.
4. An internet of things platform communication device, the device comprising:
the message acquisition module is used for acquiring initial messages reported to a target Internet of things platform by different emqx servers;
the type judging module is used for judging whether the message action type of the initial message belongs to a data verification type when the initial message meets the preprocessing condition;
the verification module is used for performing data verification on the initial message if the initial message belongs to the data verification type;
the message analysis module is used for analyzing the initial message after the verification is finished, obtaining a json format target message corresponding to the action type of the message, and sending the json format target message to the target Internet of things platform, wherein the format of the json format target message is a format recognized by the target Internet of things platform;
wherein, the check module further comprises:
if the data format is of the data format check type, reading a primary directory and a secondary directory in the initial message, and respectively detecting whether the format of the primary directory and the format of the secondary directory lack preset values;
when the preset value is not lost in the formats of the primary catalog and the secondary catalog, judging that the format verification is successful;
when the format of the primary directory lacks the preset value or the format of the secondary directory lacks the preset value, judging that the format verification fails;
when the format verification is successful, judging whether the maximum data length, the maximum byte length and the data type of the target content in the initial message accord with the correct content defined by the target Internet of things platform or not;
if the correct content is met, judging that the data content is verified successfully;
if the correct content is not met, judging that the data content verification fails;
and when the verification of the data content fails, performing data cleaning on the target content to obtain an initial message after cleaning, and taking the initial message after cleaning as the initial message after the verification is completed.
5. An internet of things platform communication device, the device comprising: a memory, a processor, and an internet of things platform communication program stored on the memory and executable on the processor, the internet of things platform communication program configured to implement the steps of the internet of things platform communication method of any one of claims 1 to 3.
6. A storage medium having an internet of things platform communication program stored thereon, wherein the internet of things platform communication program, when executed by a processor, implements the steps of the internet of things platform communication method according to any one of claims 1 to 3.
CN202310000647.3A 2023-01-03 2023-01-03 Internet of things platform communication method, device, equipment and storage medium Active CN115695504B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310000647.3A CN115695504B (en) 2023-01-03 2023-01-03 Internet of things platform communication method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310000647.3A CN115695504B (en) 2023-01-03 2023-01-03 Internet of things platform communication method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115695504A CN115695504A (en) 2023-02-03
CN115695504B true CN115695504B (en) 2023-04-11

Family

ID=85057123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310000647.3A Active CN115695504B (en) 2023-01-03 2023-01-03 Internet of things platform communication method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115695504B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108965484A (en) * 2018-09-30 2018-12-07 深圳市酷达通讯有限公司 A kind of transmission method of internet of things data, system and terminal
WO2022104555A1 (en) * 2020-11-17 2022-05-27 Oppo广东移动通信有限公司 Mqtt protocol-based communication method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527757B (en) * 2019-09-18 2022-11-15 无锡江南计算技术研究所 Rapid retrieval method based on large-scale chip test result
CN111629058A (en) * 2020-05-27 2020-09-04 广东浪潮大数据研究有限公司 Mirror image uploading method, device and system and back-end equipment
CN113014584A (en) * 2021-02-26 2021-06-22 北京金山云网络技术有限公司 Internet of things communication method and device, electronic equipment and storage medium
CN113676400B (en) * 2021-08-17 2022-07-15 国网湖南省电力有限公司 Cloud gateway system for Internet of things access of environment-friendly data acquisition equipment
CN114817671A (en) * 2022-05-09 2022-07-29 宁波奥克斯电气股份有限公司 Log analysis method and system for air conditioner Internet of things
CN115314571A (en) * 2022-06-20 2022-11-08 国网信息通信产业集团有限公司 Cloud protocol gateway implementation method and system supporting heterogeneous device access
CN115185951A (en) * 2022-07-29 2022-10-14 济南浪潮数据技术有限公司 Object uploading method, system, equipment and storage medium of storage system
CN115412602A (en) * 2022-11-02 2022-11-29 山东捷瑞数字科技股份有限公司 Data parsing and transferring method, device, equipment and medium for digital twin

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108965484A (en) * 2018-09-30 2018-12-07 深圳市酷达通讯有限公司 A kind of transmission method of internet of things data, system and terminal
WO2022104555A1 (en) * 2020-11-17 2022-05-27 Oppo广东移动通信有限公司 Mqtt protocol-based communication method and device

Also Published As

Publication number Publication date
CN115695504A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
CN108762803B (en) Configuration management method, device, terminal equipment and storage medium
CN111083225A (en) Data processing method and device in Internet of things platform and Internet of things platform
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN111198797B (en) Operation monitoring method and device and operation analysis method and device
CN112019609B (en) Equipment monitoring method, device, equipment and computer medium based on Internet of things
CN112835782B (en) Interface access test method and system
CN111327636B (en) S7-300PLC private protocol reverse method relating to network security
CN111723019A (en) Interface debugging method and system
CN105117340A (en) URL (Uniform Resource Locator) detection method and device used for quality evaluation of iOS browser application
CN113360300A (en) Interface calling link generation method, device, equipment and readable storage medium
CN115695504B (en) Internet of things platform communication method, device, equipment and storage medium
CN112817935A (en) Data processing method, device and equipment based on field type and storage medium
CN111049795B (en) Method and device for detecting sensitive data unencrypted vulnerability of distributed Web application
CN113934198A (en) Vehicle diagnosis method, vehicle diagnosis device, electronic device, and storage medium
CN112671615A (en) Method, system and storage medium for collecting operation behavior data of front-end user
CN108288135B (en) System compatibility method and device, computer readable storage medium and electronic equipment
CN114679336B (en) Authentication method, authentication system, authentication device, and readable storage medium
CN115994098B (en) Analysis method and system for software operation abnormality based on artificial intelligence
CN111026631A (en) Automatic interface detection method and device and server
CN114116520B (en) Algorithm evaluation method, device, gateway and storage medium
CN113672225B (en) User interface processing method, device, equipment and storage medium
CN113411250B (en) Real-time message processing method, system, equipment and storage medium
CN114915549B (en) Instruction query method, device, equipment and storage medium
US20160179480A1 (en) Computer application development assistance
CN116959755A (en) Analysis method of diagnosis receiving speed, client, server and computer equipment

Legal Events

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