CN117201591A - Message tracking method and device based on MQTT protocol and related products - Google Patents

Message tracking method and device based on MQTT protocol and related products Download PDF

Info

Publication number
CN117201591A
CN117201591A CN202311085051.4A CN202311085051A CN117201591A CN 117201591 A CN117201591 A CN 117201591A CN 202311085051 A CN202311085051 A CN 202311085051A CN 117201591 A CN117201591 A CN 117201591A
Authority
CN
China
Prior art keywords
message
identifier
server
tracking
release
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311085051.4A
Other languages
Chinese (zh)
Inventor
白明
刘瑞强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Ruichi Automotive Technology Dalian Co ltd
Original Assignee
Neusoft Ruichi Automotive Technology Dalian 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 Neusoft Ruichi Automotive Technology Dalian Co ltd filed Critical Neusoft Ruichi Automotive Technology Dalian Co ltd
Priority to CN202311085051.4A priority Critical patent/CN117201591A/en
Publication of CN117201591A publication Critical patent/CN117201591A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a message tracking method and device based on an MQTT protocol and related products. When the method is executed, the server generates a first distribution message through an MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier; the server side sends the first publishing message to the client side according to the first identifier, and then the server side carries out association analysis on the first publishing message and the second publishing message according to the second identifier to obtain a message tracking result; and the second release message is generated by the client through an MQTT protocol according to the first release message and is sent to the server, and the second release message at least comprises a second identifier. In this way, by adding the tracking identifier for tracking information, that is, the second identifier, to the incoming and outgoing information, the server can perform association analysis on the first published message and the second published message through the second identifier. In this way, message tracking for multiple posted messages may be achieved.

Description

Message tracking method and device based on MQTT protocol and related products
Technical Field
The present application relates to the field of computer technologies, and in particular, to a message tracking method and apparatus based on MQTT protocol, and related products.
Background
With the rapid development of the mobile internet and the internet of things, more and more information acquisition modes are available. MQTT (Message Queuing Telemetry Transport, message queue telemetry transport protocol), a "lightweight" communication protocol based on publish/subscribe (TCP/IP) mode, is built on top of TCP/IP protocols. The biggest advantage of MQTT is that it can provide real-time reliable messaging services to connected remote devices with very little code and limited bandwidth. As an instant messaging protocol with low cost and low bandwidth occupation, the method has wider application in the aspects of Internet of things, small-sized equipment, mobile application and the like.
In the related art, a message issuing process often needs to be interacted with a client side for multiple times by a server side to form a plurality of issued messages, but the MQTT protocol cannot realize message tracking of the plurality of issued messages.
Therefore, how to implement message tracking for multiple distributed messages is a current urgent problem to be solved.
Disclosure of Invention
In view of the above, the present application provides a message tracking method, device and related products based on MQTT protocol, which aims to implement message tracking for multiple distributed messages.
In a first aspect, the present application provides a message tracking method based on MQTT protocol, including:
the server generates a first distribution message through an MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier; the first identifier is a client identifier, and the second identifier is a tracking identifier;
the server side sends the first sending message to a client side according to the first identifier;
the server side carries out association analysis on the first release message and the second release message according to the second identifier to obtain a message tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier.
Optionally, the server generates a first publishing message, including:
the server generates a second identifier based on the first request message; the first request message includes first base data and first user data;
the server adds the second identifier to the first user data in the first request message to obtain the first distribution message; the first basic data at least comprises a fixed head of an MQTT protocol; the first user data is used to define user attributes.
Optionally, the server performs association analysis on the first published message and the second published message according to the second identifier to obtain a message tracking result, including:
the server receives a second release message sent by the client;
the server analyzes the second release message to obtain the second identifier;
and the server side carries out association analysis on the second release message and the first release message according to the second identifier to obtain a message tracking result.
Optionally, the server parses the second published message to obtain the second identifier, including:
the server analyzes the second release message to obtain second basic data and second user data;
and the server determines the second identifier according to the second user data.
Optionally, the service end comprises a push service end and an MQTT server;
the server generating the first distribution message through the MQTT protocol comprises:
the push server generates a first distribution message through an MQTT protocol, stores the first distribution message and sends the first distribution message to an MQTT server;
the server sending the first sending message to the client according to the first identifier includes:
the MQTT server receives the first distribution message;
and the MQTT server sends the first sending message to the client according to the first identifier.
Optionally, the server performs association analysis on the first published message and the second published message according to the second identifier, and the obtaining the message tracking result includes:
the server side associates the first release message with the second release message according to the second identifier to obtain a message association record;
and the server performs association analysis according to the message association record to obtain a message tracking result.
Optionally, the message tracking result includes one or more of message source, message target, message content, message status, message latency, and exception data.
In a second aspect, the present application provides a message tracking device based on MQTT protocol, which is characterized in that it includes:
the generating module is used for generating a first distribution message by the server through the MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier; the first identifier is a client identifier, and the second identifier is a tracking identifier;
the sending module is used for sending the first sending message to the client according to the first identifier by the server;
the association module is used for carrying out association analysis on the first published message and the second published message according to the second identifier by the server side to obtain a message tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier.
In a third aspect, the present application provides an electronic device, the device comprising: a processor, memory, system bus;
the processor and the memory are connected through the system bus;
the memory is configured to store one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the MQTT protocol-based message tracking method described above.
In a fourth aspect, the present application provides a computer readable storage medium having instructions stored therein, which when executed on a terminal device, cause the terminal device to perform the above-described MQTT protocol-based message tracking method.
The application provides a message tracking method based on an MQTT protocol. When the method is executed, the server generates a first distribution message through an MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier, wherein the first identifier is a client identifier, and the second identifier is a tracking identifier; the back server side sends the first distribution information to the client side according to the first identifier, and then the server side carries out association analysis on the first distribution information and the second distribution information according to the second identifier to obtain an information tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier. Therefore, by adding the tracking identifier for tracking information, namely the second identifier, in the past information, the server can perform association analysis on the first release message and the second release message through the second identifier, so that the effect of tracking multiple release messages is achieved. In this way, message tracking for multiple posted messages may be achieved.
Drawings
In order to more clearly illustrate this embodiment or the technical solutions of the prior art, the drawings that are required for the description of the embodiment or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a scene structure diagram of a message tracking method based on MQTT protocol according to an embodiment of the present application;
FIG. 2 is a flow chart of a message tracking method based on the MQTT protocol according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a data format of a first request message portion according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a data format of a response data portion according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a message tracking device based on MQTT protocol according to an embodiment of the present application.
Detailed Description
As described above, as an instant messaging protocol with low overhead and low bandwidth occupation, MQTT has a wide application in the internet of things, small devices, mobile applications, and the like. For example, in the scene of the internet of vehicles, the MQTT can be flexible, rapid and safe to access to mass vehicle-to-machine systems, and the real-time performance and reliability of messages in a complex network environment are ensured. However, in the internet of vehicles service, one message issuing process often needs to interact with a client multiple times to form multiple issued messages. If there is no effective message tracking mechanism, these published messages cannot be effectively associated, nor can they be fully tracked and analyzed for the entire message delivery process. Message tracking refers to recording and analyzing information such as sources, targets, contents, states and the like of a message in the process of message acquisition and transmission so as to realize visualization and monitoring of a message circulation process. But the MQTT protocol itself does not support message tracking of multiple published messages.
In view of this, the present application provides a message tracking method based on MQTT protocol. When the method is executed, the server generates a first distribution message through an MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier; the first identifier is a client identifier, the second identifier is a tracking identifier, the rear server side sends the first distribution message to the client side according to the first identifier, and then the server side carries out association analysis on the first distribution message and the second distribution message according to the second identifier to obtain a message tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier.
The first and second release messages comprise the second identifier, namely the tracking identifier for tracking information, so that the server side can perform association analysis on the first and second release messages through the second identifier, and the effect of tracking multiple release messages is achieved. In this way, message tracking for multiple posted messages may be achieved.
Referring to fig. 1, the diagram is a scene structure diagram of a message tracking method based on MQTT protocol according to an embodiment of the present application. As shown in fig. 1, includes a server and various forms of terminal devices. The servers shown in fig. 1 may be independent physical servers, or may be a server cluster or a distributed system formed by a plurality of physical servers. In addition, the server may also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal equipment comprises, but is not limited to, a mobile phone, a tablet, a computer, an intelligent camera, intelligent voice interaction equipment, intelligent household appliances, a vehicle-mounted terminal, an aircraft and the like.
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 2 is a flowchart of a message tracking method based on MQTT protocol according to an embodiment of the present application. Referring to fig. 2, the message tracking method based on MQTT protocol provided by the embodiment of the present application may include:
s201: the server generates a first distribution message through an MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier.
The MQTT protocol is an asynchronous communication message protocol constructed based on a TCP/IP protocol stack, and is a lightweight type release and subscription information transmission protocol. The method can be expanded in an unreliable network environment, and is suitable for scenes with limited storage space of equipment hardware or limited network bandwidth. In particular, the MQTT5.0 version provides a larger custom extension space at the protocol layer, and the MQTT5.0 version can support richer protocol capabilities based on extension points. Based on this, when the server side generates the first distribution message, the second identifier for tracking is encapsulated in the first distribution message based on the extension point, so that all messages containing the same second identifier can be corresponding together by using the second identifier when the message tracking is performed later, and thus the message tracking is realized. Optionally, the second identifier in this embodiment is data of a key-value type. It may be appreciated that the MQTT of this embodiment is a protocol for delivering a message, and therefore necessarily includes a destination address of message sending, that is, the first identifier, and in general, the first identifier is a client identifier, where the client may be any one or more terminals of a mobile phone, a tablet, a computer, an intelligent camera, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, an aircraft, and the like.
In an alternative embodiment, the server generates a first publishing message, including: the server generates a second identifier based on the first request message; the first request message comprises first basic data and first user data, and the second identifier is added to the first user data in the first request message to obtain a first distribution message. The first basic data at least comprises a fixed head of the MQTT protocol, and the first user data is used for defining user attributes. In general, the MQTT protocol generally includes a fixed header and a payload, where the fixed header is the most basic data in the MQTT protocol, and exists in all MQTT protocols, and represents a packet type and a packet class identifier of a packet, such as connection, publishing, subscribing, source address, destination address, etc., and in some MQTT protocols, if a certain information is wanted to be transferred, the payload may also be used for sending and transmitting. In the extensible MQTT protocol, a variable header may be further included for user-defined extension attribute information, etc. For example, the server needs to send a POI information, that is, the location and name of the point of interest, to the client, which may be a vehicle terminal or a mobile phone, which is equivalent to a load. FIG. 3 is a schematic diagram of a first request message portion data format according to an embodiment of the present application, and in combination with FIG. 3, the request message portion data may be represented by a string in JSON format, where "lat" is a short term for Latitude, and represents Latitude; "lng" is shorthand for Longtitude, representing longitude; "name" is the name of the point of interest, and when the server sends the issue request, a second identifier is generated, where the second identifier is used to represent the tracking identifier, for example, "traceID: 1234567880 ", and then the server adds the second identifier as a key pair to the first User data of the first request, for example," User Properties: traceid=123456789 ", wherein" User Properties "is the first User data, used to define User attributes. In this embodiment, the second identifier is added to the extensible field of the MQTT protocol for defining the user attribute, so as to implement message tracking on multiple messaging messages without changing the MQTT protocol itself.
In an alternative embodiment, for a scenario based on the MQTT protocol, the server may generally include a push server and an MQTT server, so the server generating the first publishing message by the MQTT protocol may include: the push server generates a first publishing message through an MQTT protocol, stores the first publishing message and sends the first publishing message to the MQTT server. In this embodiment, the push server is configured to generate a first publishing message and store the first publishing message after the first publishing message is generated, and it may be understood that the first publishing message stored by the push server includes a second identifier, and the push server stores the first publishing message including the second identifier, so as to implement message tracking by performing association record on a procedure of receiving a message including the same second identifier as the first publishing message.
S202: and the server side sends the first sending message to the client side according to the first identification.
In this embodiment, in the step S201, the server generates the first publishing message carrying the second identifier, and then the server sends the first publishing message to the corresponding client according to the first identifier, that is, the client identifier, and it can be understood that the server complies with the specifications of the MQTT protocol, including the message format, the connection parameter, the QoS class, and the like, when sending the first publishing message.
In an alternative embodiment, the MQTT includes a set of mechanisms for ensuring stable transmission of messages, including message reply, store and retransmit. In particular, MQTT provides three different levels of QoS (Quality of Service ): qoS0, at most once; qoS1, at least once; qoS2, exact once, ensures only once. QoS is a protocol that is achieved between the sender and the recipient of a message: qoS0 represents a message sent by the sender, and the receiver can receive the message at most once, that is, the sender tries to send the message to the receiver, if the sending fails, the message is not sent; qoS1 represents a message sent by a sender, and a receiver can receive the message at least once, that is, the sender sends the message to the receiver, if the sender fails, the retry is continued until the receiver receives the message, but the receiver may receive repeated messages due to retransmission; qoS2 represents a message sent by the sender, and the receiver ensures that the message can be received and only once, that is, the sender sends the message to the receiver, and if the sending fails, the retry is continued until the receiver receives the message, and at the same time, the receiver is guaranteed not to receive repeated messages due to retransmission of the message.
It should be noted that, the message may have multiple transmissions in the process of sending, and it can be understood that the second identifier is carried in each process of sending the message, so that specific situations such as each anomaly, retransmission, timeout and the like can be determined through the second identifier. In this embodiment, the server is the sender and the client is the receiver, but in a specific application scenario, both the server and the client may be the sender and the receiver, that is, the sender and the receiver are opposite to each other with respect to the body of the message to be sent, and do not limit the specific execution body.
In an optional embodiment, the foregoing step S201 describes that the server may include a push server and an MQTT server, where the push server sends the first publishing message to the MQTT server, and based on this, step S202 may include: the MQTT server receives a first distribution message; the MQTT server sends a first sending message to the client according to the first identification. In this embodiment, after receiving the first publishing message, the MQTT server forwards the first message multiple times and multiple terminals according to the content of the first publishing message, without passing through the push server, so as to implement quick and safe distribution of the message.
S203: the server side carries out association analysis on the first release message and the second release message according to the second identifier to obtain a message tracking result; the second release message is generated by the client through the MQTT protocol according to the first release message and is sent to the server, and the second release message at least comprises a second identifier.
In this embodiment, after the server sends the first publishing message to the client, the client responds according to the first publishing message, and generates a second publishing message through the MQTT protocol and sends the second publishing message to the server. Specifically, the client receives a first publishing message, analyzes the first publishing message to obtain first basic data and first user data, wherein the first user data comprises a second identifier, stores the second identifier in the client, executes corresponding operation according to the first basic data and generates second response data, and then generates a second publishing message by using the second identifier and the second response message and sends the second publishing message to the client.
In step S201, assuming that the client is a vehicle terminal, the vehicle terminal receives the information that the server transmits a POI to the vehicle terminal, and analyzes the POI information and the second identifier "traceID" in the first user data: 1234567890", and save the second identification, the vehicle terminal displays the location and name of the point of interest on the vehicle terminal according to the information of the POI, and generates response data indicating that the information of the POI has been successfully received and processed. Fig. 4 is a schematic diagram of a data format of a response data portion according to an embodiment of the present application, and in conjunction with fig. 4, the response data portion may be represented by a string in JSON format, where "status" represents a status, and may generally include "success" or "failure", etc., and "message" represents a message, for example, a POI message has been received, etc. When the client sends the response message, the client will store the second identifier "traceID" previously: 1234567880 "is added as a key value pair to the second User data of the response message, such as" User Properties: traceid=123456789 ", and finally generates a second published message, and the client sends the second published message to the server. In this embodiment, the extension mechanism of the user attribute is utilized since the MQTT protocol itself is not changed. The modification or customization of the MQTT protocol is avoided, the characteristics of simplicity and easiness in implementation, qoS support, wen Xiao and the like of the MQTT protocol are maintained, and a large number of mature software libraries and hardware modules in the market are compatible.
Because the second release message returned to the server by the client carries the second identifier, the server can carry out association analysis on the first release message and the second release message through the second identifier carried in the first release message and the second release message after receiving the corresponding second release message, and a message tracking result is obtained.
In an optional embodiment, the step S203 of the server performing association analysis on the first published message and the second published message according to the second identifier to obtain a message tracking result may include: the server receives a second release message sent by the client; the server analyzes the second release message to obtain a second identifier; and the server side carries out association analysis on the second release message and the first release message according to a second identifier to obtain a message tracking result. In this embodiment, when the client sends the second published message to the server, the server receives the second published message sent by the client, and then analyzes the second published message sent by the client, and since the second published message includes the second identifier, the second identifier in the second published message can be obtained by analyzing the second published message, and further, the second published message is associated with the first published message according to the second identifier obtained by analyzing the second published message, and then the association analysis is performed, so as to obtain the message tracking result. The second identifier is encapsulated in the second user data in the second published message, so that the server side analyzes the second published message to obtain the second identifier, specifically: the server analyzes the second release message to obtain second basic data and second user data; and the server determines a second identifier according to the second user data.
In an optional embodiment, when the server determines, according to the second identifier, the first published message and the second published message that are associated with each other, the server may make a message association record with the first published message and the second published message according to the second identifier, and further obtain a message tracking result by analyzing the message association record. Therefore, the step S203 may include: the server side correlates the first release message with the second release message according to the second identifier to obtain a message correlation record; and the server performs association analysis according to the message association record to obtain a message tracking result. The server side is connected to send an example of POI information to the client side, and after receiving a second release message of the client side, the server side can record a Request, wherein POI information with traceID =1234567880 send to car A; response success message with traceID =1234567880 received from car A ", associating the first publishing message (request message) and the second publishing message (Response message) carrying the second identifier of" traceid=1234567880 "at the same time and recording corresponding information, thereby obtaining a message association record, and then obtaining a message tracking record by analyzing the message association record, which may include (1) that the message source is a server, and the message target is vehicle a; (2) The message content is information of the POI, including a position and a name; (3) The message status is successful, indicating that vehicle a has received and processed information for the POI; (4) Message delay, which indicates the time from the sending of the server to the receiving of the vehicle A; (5) Abnormal data, i.e. whether the message has an abnormality or error, such as packet loss, retransmission, timeout, etc. In the embodiment, through analysis of the message association record, full-link tracking and analysis of the multi-issue message are finally realized, and simultaneous or time-delay analysis of multiple groups of multi-issue data can be realized through the message association record, so that reasonable allocation of server resources is realized, and the efficiency of problem feedback is improved.
In an optional embodiment, the method further includes visually displaying the message tracking result, so that a user can locate and solve a problem, evaluate and optimize business logic, collect and utilize data, and improve user experience.
In the above embodiment, by adding the tracking identifier for tracking information, that is, the second identifier, to the current information, the server may perform association analysis on the first published message and the second published message through the second identifier, so as to achieve the effect of tracking multiple published messages. Therefore, the message tracking of multiple messages can be realized, the problems in the message transmission process can be conveniently positioned and solved, and the evaluation and optimization of service logic are facilitated.
The above provides some specific implementation manners of the method according to the embodiments of the present application, and based on this, the present application further provides a corresponding device. The apparatus provided by the embodiment of the present application will be described in terms of functional modularization.
Fig. 5 is a schematic structural diagram of a message tracking device based on MQTT protocol according to an embodiment of the present application. In connection with the schematic structure of the apparatus 500 shown in fig. 5, the apparatus 500 includes a generating module 501, a transmitting module 502, and an associating module 503.
The generating module 501 is configured to generate a first publishing message by using an MQTT protocol by a server side; the first distribution message at least comprises a first identifier and a second identifier; the first identifier is a client identifier, and the second identifier is a tracking identifier;
a sending module 502, configured to send the first sending message to a client according to the first identifier by the server;
the association module 503 is configured to perform association analysis on the first published message and the second published message according to the second identifier by using the server side, so as to obtain a message tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier.
The generating module 501 specifically includes:
the generating unit is used for generating a second identifier based on the first request message by the server; the first request message includes first base data and first user data;
a first obtaining unit, configured to add the second identifier to the first user data in the first request message by using the server side to obtain the first distribution message; the first basic data at least comprises a fixed head of an MQTT protocol; the first user data is used to define user attributes.
The association module 503 specifically includes:
the receiving unit is used for receiving the second release message sent by the client side by the server side;
the analyzing unit is used for analyzing the second release message by the server to obtain the second identifier;
and the association analysis unit is used for carrying out association analysis on the second release message and the first release message by the server according to the second identifier to obtain a message tracking result.
The analysis unit is specifically configured to:
the server analyzes the second release message to obtain second basic data and second user data;
and the server determines the second identifier according to the second user data.
The association module 503 specifically includes:
the association unit is used for associating the first release message with the second release message according to the second identifier by the server side to obtain a message association record;
and the analysis unit is used for carrying out association analysis on the server according to the message association record to obtain a message tracking result.
The embodiment of the application also provides corresponding equipment and a computer storage medium, which are used for realizing the scheme provided by the embodiment of the application.
The device comprises a memory and a processor, wherein the memory is used for storing instructions or codes, and the processor is used for executing the instructions or codes so as to enable the device to execute the message tracking method based on the MQTT protocol according to any embodiment of the application.
The computer storage medium stores codes, and when the codes are executed, the equipment for executing the codes realizes the message tracking method based on the MQTT protocol according to any embodiment of the application.
The "first" and "second" in the names of "first", "second" (where present) and the like in the embodiments of the present application are used for name identification only, and do not represent the first and second in sequence.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus general hardware platforms. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the method according to the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
The foregoing description of the exemplary embodiments of the application is merely illustrative of the application and is not intended to limit the scope of the application.

Claims (10)

1. The message tracking method based on the MQTT protocol is characterized by comprising the following steps of:
the server generates a first distribution message through an MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier; the first identifier is a client identifier, and the second identifier is a tracking identifier;
the server side sends the first sending message to a client side according to the first identifier;
the server side carries out association analysis on the first release message and the second release message according to the second identifier to obtain a message tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier.
2. The method of claim 1, wherein the server generates a first distribution message, comprising:
the server generates a second identifier based on the first request message; the first request message includes first base data and first user data;
the server adds the second identifier to the first user data in the first request message to obtain the first distribution message; the first basic data at least comprises a fixed head of an MQTT protocol; the first user data is used to define user attributes.
3. The method of claim 1, wherein the server performs association analysis on the first published message and the second published message according to the second identifier to obtain a message tracking result, and the method comprises:
the server receives a second release message sent by the client;
the server analyzes the second release message to obtain the second identifier;
and the server side carries out association analysis on the second release message and the first release message according to the second identifier to obtain a message tracking result.
4. The method of claim 3, wherein the server parsing the second published message to obtain the second identifier includes:
the server analyzes the second release message to obtain second basic data and second user data;
and the server determines the second identifier according to the second user data.
5. The method of claim 1, wherein the server comprises a push server and an MQTT server;
the server generating the first distribution message through the MQTT protocol comprises:
the push server generates a first distribution message through an MQTT protocol, stores the first distribution message and sends the first distribution message to an MQTT server;
the server sending the first sending message to the client according to the first identifier includes:
the MQTT server receives the first distribution message;
and the MQTT server sends the first sending message to the client according to the first identifier.
6. The method of claim 1, wherein the server performs association analysis on the first published message and the second published message according to the second identifier, and obtaining a message tracking result includes:
the server side associates the first release message with the second release message according to the second identifier to obtain a message association record;
and the server performs association analysis according to the message association record to obtain a message tracking result.
7. The method of claim 1, wherein the message tracking results include one or more of message source, message destination, message content, message status, message latency, and exception data.
8. A message tracking device based on MQTT protocol, comprising:
the generating module is used for generating a first distribution message by the server through the MQTT protocol; the first distribution message at least comprises a first identifier and a second identifier; the first identifier is a client identifier, and the second identifier is a tracking identifier;
the sending module is used for sending the first sending message to the client according to the first identifier by the server;
the association module is used for carrying out association analysis on the first published message and the second published message according to the second identifier by the server side to obtain a message tracking result; the second release message is generated by the client according to the first release message through an MQTT protocol and is sent to the server, and the second release message at least comprises a second identifier.
9. An electronic device, the device comprising: a processor, memory, system bus;
the processor and the memory are connected through the system bus;
the memory is for storing one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the MQTT protocol-based message tracking method of any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that instructions are stored in the computer readable storage medium, which instructions, when run on a terminal device, cause the terminal device to perform the MQTT protocol-based message tracking method of any one of claims 1 to 7.
CN202311085051.4A 2023-08-24 2023-08-24 Message tracking method and device based on MQTT protocol and related products Pending CN117201591A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311085051.4A CN117201591A (en) 2023-08-24 2023-08-24 Message tracking method and device based on MQTT protocol and related products

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311085051.4A CN117201591A (en) 2023-08-24 2023-08-24 Message tracking method and device based on MQTT protocol and related products

Publications (1)

Publication Number Publication Date
CN117201591A true CN117201591A (en) 2023-12-08

Family

ID=88982751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311085051.4A Pending CN117201591A (en) 2023-08-24 2023-08-24 Message tracking method and device based on MQTT protocol and related products

Country Status (1)

Country Link
CN (1) CN117201591A (en)

Similar Documents

Publication Publication Date Title
Glaroudis et al. Survey, comparison and research challenges of IoT application protocols for smart farming
CA2604898C (en) System and method of message traffic optimization
Musolesi et al. Emma: Epidemic messaging middleware for ad hoc networks
CN108200165B (en) Request Transmission system, method, apparatus and storage medium
CN105791315B (en) A kind of udp protocol acceleration method and system
WO2019029320A1 (en) Configuration management method, apparatus and device
CN111835837B (en) Message pushing method and system with multi-terminal adaptation
US20060039401A1 (en) System and method for communicating asynchronously with synchronous web services using a mediator service
WO2018214865A1 (en) Processing method for message acknowledgement, related apparatus, storage medium and processor
CN108769017B (en) Data communication method and device
CN109639782A (en) Message sends platform, method
Tortonesi et al. Enabling the deployment of COTS applications in tactical edge networks
WO2023221452A1 (en) Packet processing system and method, device, and storage medium
CN109614253A (en) A kind of method and device for realizing remote procedure call
CN111917770A (en) Device communication method, device and storage medium
Musolesi et al. Adapting asynchronous messaging middleware to ad hoc networking
CN113810349B (en) Data transmission method, device, computer equipment and storage medium
CN116800787A (en) Vehicle-mounted communication method and system based on Ethernet communication protocol
CN101420392B (en) Method and customer terminal for instant communication customer terminal displaying pop-up window
CN110557321A (en) Information transmission method, network equipment and terminal
CN113259418A (en) Method, apparatus and computer-readable storage medium for transmitting data
CN117201591A (en) Message tracking method and device based on MQTT protocol and related products
CN107483628A (en) Unidirectional proxy method and system based on DPDK
Palmese et al. Coap vs. mqtt-sn: Comparison and performance evaluation in publish-subscribe environments
Ghaderi et al. Multimedia messaging service: System description and performance analysis

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