Message transceiving method based on MQTT protocol for acquisition terminals

A technology for sending and receiving messages and collecting terminals. It is used in inter-program communication, instruments, multi-program devices, etc., and can solve problems such as inability to meet cross-container message communication.

Inactive Publication Date: 2021-11-30
QINGDAO TOPSCOMM COMM +1
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Especially using the existing application layer protocol for communication, ordinary inter-process ipc communication and other methods can no longer meet and realize cross-container message communication, and need to have both inter-process communication capabilities and cross-container communication capabilities
[0003] Therefore, it is necessary to provide a message sending and receiving method based on the MQTT protocol for collecting terminals and its implementation, which is used to solve the problem of information interaction between multiple containers and apps in the Linux environment

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Message transceiving method based on MQTT protocol for acquisition terminals
  • Message transceiving method based on MQTT protocol for acquisition terminals
  • Message transceiving method based on MQTT protocol for acquisition terminals

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] The present invention will be further described below in conjunction with the accompanying drawings. The following content is only used to illustrate the technical solution of the present invention more clearly, but not to limit the protection scope of the present invention.

[0036] The present invention provides a method for sending and receiving messages based on the MQTT protocol for collecting terminals and its implementation, including: S11, sending synchronous messages;

[0037] S12, asynchronous message sending; S21, message receiving and processing;

[0038] figure 1 It is a flow chart of synchronous message sending in the present invention, which mainly includes the following steps:

[0039] S111, call the unit_plat_infc_msg_send interface and then determine whether it is in the callback function, if it is called, it will directly return failure; S112, format the MQTT topic and resubscribe to the topic according to the parameters; S113, the unit_plat_msg_to_b...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a message transceiving method based on an MQTT protocol for acquisition terminals. A model comprises: a message sending part and a message receiving part, wherein the message sending of a message framework is divided into synchronous message sending, asynchronous message sending, and synchronous message sending, and comprises the following steps that: firstly, a message sending interface is called, and whether messages are in a callback function or not is judged; if not, MQTT theme formatting and preliminary message formatting are carried out; a message sending function is called to send the messages; finally, log printing and recording are carried out; the asynchronous message sending is as shown in a thread in figure 1 that: an asynchronous sending interface is called, messages are stored in a message queue after the messages are formatted, and then the messages are periodically obtained from the message queue through a periodic execution and by keeping threads alive, and then the messages are sent out; after a message receiving thread receives the messages, for messages with the callback function, a callback function will be called to process the messages, and for messages without the callback function, the messages will be stored in the message queue, and wait to be obtained.

Description

technical field [0001] The invention relates to the field of communication between a container and an app in a linux environment, in particular to an MQTT protocol-based message sending and receiving method for a collection terminal and its implementation. Background technique [0002] As the deployment scale and number of APP applications and container applications in the Linux environment become larger and larger, apps and containers require more frequent message interaction. In the linux environment, deploying multiple containers, and multiple apps, requires one-to-many between apps and containers, low-redundancy data push based on tcp connection, efficient, convenient and flexible communication, and a heartbeat mechanism to achieve flexibility and lightness. With the will message function, the final message can be retained after the application or container is disconnected and dropped. oS quality level + offline messages, messages of offline persistent sessions can also...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/54G06F9/455
CPCG06F9/546G06F9/45558G06F2209/548
Inventor 葛玉磊魏远文郑亚岗李勇峰赵靖石
Owner QINGDAO TOPSCOMM COMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products