Disclosure of Invention
The invention aims to provide a data conversion processing method and a data conversion processing system based on an MQTT protocol and a 698 protocol, which can solve the technical problem that the management and maintenance of access networks of devices with different protocols are difficult.
In order to achieve the above object, the present invention provides a data conversion processing method based on MQTT protocol and 698 protocol, comprising the following steps:
s1, comparing the function points of the MQTT protocol with the function points of the 698 protocol one by one, finding out the function points which are not realized in the 698 protocol, and correspondingly supplementing perfect fields and the function points which need to be redesigned;
s2, based on the function points of MQTT protocol, adding new protocol to corresponding unrealized function points in 698 protocol content;
s3, converting the data message sent down by the platform side into a corresponding 698 protocol type according to the MQTT protocol type, and sending the message data to the 698 protocol terminal equipment;
and aiming at the data message actively reported by the 698 protocol terminal equipment, converting the data message into a corresponding MQTT protocol type according to the 698 protocol type, and reporting the message data to the platform side.
Preferably, the S2 specifically includes: completing the functional field missing in 698 protocol content; and redesigning and implementing the functions of the file transmission class.
Preferably, at least one device access request method in the 698 protocol corresponds to the MQTT protocol request method.
Preferably, the S1 specifically includes: the contents of the equipment access request messages of the MQTT protocol and the 698 protocol are compared, the content fields of the 698 protocol messages are expanded and increased, and the 698 protocol terminal side is developed and debugged according to the revised 698 protocol.
Preferably, the S3 specifically includes: when the platform side issues the equipment state query command to the message theme 1, the conversion service monitors the message theme 1 to acquire information and then performs processing analysis, knows that the message belongs to the equipment state query command according to the corresponding relation of a predefined 698 protocol request method, analyzes and processes the message content according to the MQTT protocol, reassembles the message content into a 698 protocol terminal equipment state query command, and then sends the message content to the message theme 2 for the subsequent 698 protocol terminal equipment to receive and process.
Preferably, when the 698 protocol terminal device actively requests for access, the device access request message contents of the MQTT protocol and the 698 protocol are compared, the 698 protocol message content fields are expanded and increased, and the terminal side is developed and debugged according to the revised 698 protocol;
the terminal side sends a 698 protocol device access request to a message subject 4, the conversion service monitors the message subject 4 to acquire the message and then processes and analyzes the message content, the message belongs to the device access request according to the corresponding relation of a predefined 698 protocol request method, then the message content is analyzed and processed according to the 698 protocol, the message content is assembled into a MQTT protocol device access request message again, and then the message content is sent to a message subject 3 for the subsequent platform side to receive and process.
The invention also provides an electronic device, which comprises a memory and a processor, wherein the processor is used for realizing the steps of the data conversion processing method based on the MQTT protocol and the 698 protocol when executing the computer management program stored in the memory.
The invention also provides a computer readable storage medium, on which a computer management program is stored, which when executed by a processor implements the steps of the data conversion processing method based on the MQTT protocol and the 698 protocol.
Compared with the prior art, the data conversion processing method and the electronic equipment based on the MQTT protocol and the 698 protocol provided by the invention comprise the following steps: s1, comparing the function points of the MQTT protocol with the function points of the 698 protocol one by one, finding out the function points which are not realized in the 698 protocol, and correspondingly supplementing perfect fields and the function points which need to be redesigned; s2, based on the function points of MQTT protocol, adding new protocol to corresponding unrealized function points in 698 protocol content; s3, converting the data message sent down by the platform side into a corresponding 698 protocol type according to the MQTT protocol type, and sending the message data to the 698 protocol terminal equipment; and aiming at the data message actively reported by the 698 protocol terminal equipment, converting the data message into a corresponding MQTT protocol type according to the 698 protocol type, and reporting the message data to the platform side. By comparing the function points of the MQTT protocol and the 698 protocol, the 698 protocol is supplemented and perfected to support the access management and maintenance of 698 protocol equipment.
Detailed Description
The following detailed description of the present invention is provided in conjunction with the accompanying drawings, but it should be understood that the scope of the present invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the word "comprise", or variations such as "comprises" or "comprising", will be understood to imply the inclusion of a stated element or component but not the exclusion of any other element or component.
As shown in fig. 1, a data conversion processing method based on MQTT protocol and 698 protocol according to a preferred embodiment of the present invention includes the following steps: s1, comparing the function points of the MQTT protocol with the function points of the 698 protocol one by one, finding out the function points which are not realized in the 698 protocol, and correspondingly supplementing perfect fields and the function points which need to be redesigned; s2, based on the function points of MQTT protocol, adding new protocol to corresponding unrealized function points in 698 protocol content; s3, converting the data message sent down by the platform side into a corresponding 698 protocol type according to the MQTT protocol type, and sending the message data to the 698 protocol terminal equipment; and aiming at the data message actively reported by the 698 protocol terminal equipment, converting the data message into a corresponding MQTT protocol type according to the 698 protocol type, and reporting the message data to the platform side. By comparing the function points of the MQTT protocol and the 698 protocol, the 698 protocol is supplemented and perfected to support the access management and maintenance of 698 protocol equipment.
The specific implementation method is as follows:
1. protocol comparison: and comparing the function points of the MQTT protocol and the function points of the 698 protocol one by one, and finding out the function points which are not realized in the 698 protocol, wherein the function points need to be supplemented with perfect fields and need to be redesigned.
2. And (3) perfecting a protocol: adding a protocol to the unrealized functional points in 698 protocol content according to the function of the MQTT protocol; completing the functional field missing in 698 protocol content; and redesigning and implementing the functions of the file transmission class.
3. The function is realized: an association table of MQTT protocol types and 698 protocol types is maintained. Aiming at the issued data message, converting the data message into a corresponding 698 protocol type according to the MQTT protocol type, and sending message data to 698 protocol equipment; and aiming at the data message reported by the 698 equipment, converting the data message into a corresponding MQTT protocol type according to the 698 protocol type, and reporting message data to the platform side.
In a specific implementation scenario, the following is specifically described with reference to fig. 4:
as shown in fig. 4, on the open source processing platform kafka, there are four topic information in total from the topic 1 to the topic 4, and the data conversion processing is performed on the four topic information.
The terminal actively requests for example a device access request:
the contents of the equipment access request messages of the MQTT protocol and the 698 protocol are compared, the content fields of the 698 protocol messages are expanded and increased, and the terminal side is developed and debugged according to the revised 698 protocol.
The terminal sends 698 protocol equipment access request to message topic 4, the conversion service monitors the message topic 4 to obtain the message and then processes and analyzes the message content, the message belongs to the equipment access request according to the corresponding relation of the predefined 698 protocol request method, the message content is analyzed and processed according to the 698 protocol, the message content is assembled into MQTT protocol equipment access request message again, and then the message is sent to the message topic 3 for subsequent service processing.
The operation instruction issued by the platform side, i.e. the upper layer application, takes the device status query as an example:
the platform issues a device status query command, i.e., production service, to message topic 1.
The conversion service monitors the message subject 1 to obtain the message and then processes and analyzes the message content, knows that the message belongs to the equipment state query command according to the corresponding relation of the predefined 698 protocol request method, analyzes and processes the message content according to the MQTT protocol, reassembles the message content into the equipment state query command of the 698 protocol, and then sends the message subject 2 for subsequent service processing.
Fig. 2 is a schematic diagram of an embodiment of an electronic device according to an embodiment of the invention. As shown in fig. 2, an embodiment of the present invention provides an electronic device, which includes a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320, where the processor 1320 executes the computer program 1311 to implement the following steps: s1, comparing the function points of the MQTT protocol with the function points of the 698 protocol one by one, finding out the function points which are not realized in the 698 protocol, and correspondingly supplementing perfect fields and the function points which need to be redesigned;
s2, based on the function points of MQTT protocol, adding new protocol to corresponding unrealized function points in 698 protocol content;
s3, converting the data message sent down by the platform side into a corresponding 698 protocol type according to the MQTT protocol type, and sending the message data to the 698 protocol terminal equipment;
and aiming at the data message actively reported by the 698 protocol terminal equipment, converting the data message into a corresponding MQTT protocol type according to the 698 protocol type, and reporting the message data to the platform side.
Please refer to fig. 3, which is a schematic diagram of an embodiment of a computer-readable storage medium according to the present invention. As shown in fig. 3, the present embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored, which computer program 1411, when executed by a processor, implements the steps of: s1, comparing the function points of the MQTT protocol with the function points of the 698 protocol one by one, finding out the function points which are not realized in the 698 protocol, and correspondingly supplementing perfect fields and the function points which need to be redesigned;
s2, based on the function points of MQTT protocol, adding new protocol to corresponding unrealized function points in 698 protocol content;
s3, converting the data message sent down by the platform side into a corresponding 698 protocol type according to the MQTT protocol type, and sending the message data to the 698 protocol terminal equipment;
and aiming at the data message actively reported by the 698 protocol terminal equipment, converting the data message into a corresponding MQTT protocol type according to the 698 protocol type, and reporting the message data to the platform side.
The technical scheme has the advantages that:
the invention is mainly suitable for increasing the access management and maintenance of the device supporting 698 protocol; the conversion of data messages of the MQTT protocol and the 698 protocol is flexibly supported.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing descriptions of specific exemplary embodiments of the present invention have been presented for purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the invention and its practical application to enable one skilled in the art to make and use various exemplary embodiments of the invention and various alternatives and modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.