CN113472843B - Greedy algorithm-based MQTT protocol QoS mechanism selection method - Google Patents
Greedy algorithm-based MQTT protocol QoS mechanism selection method Download PDFInfo
- Publication number
- CN113472843B CN113472843B CN202110568297.1A CN202110568297A CN113472843B CN 113472843 B CN113472843 B CN 113472843B CN 202110568297 A CN202110568297 A CN 202110568297A CN 113472843 B CN113472843 B CN 113472843B
- Authority
- CN
- China
- Prior art keywords
- data packet
- packet
- transmission
- small
- energy consumption
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/11—Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/61—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Abstract
A greedy algorithm-based MQTT protocol QoS mechanism selection method is characterized in that greedy algorithm is utilized to explore average packet loss rate and energy consumption of three mechanisms in different channel states, an MAB (Multiple-arm bandwidth) model is built, rocker arms of a gambling machine are abstracted into three quality of service mechanisms, a reward value is distributed to each mechanism, and each mechanism is selected for transmission in a first round to obtain a reward initial value; and selecting a mechanism with the largest rewarding value for transmission, or exploring each mechanism with a certain probability. Each round of decision is based on the updated result of the previous round of data packet transmission, and the prize value is updated, and so on. The sensor equipment in the power distribution network environment can dynamically select a proper QoS mechanism to realize the transmission of collected data to the server so as to meet the requirements on energy consumption and packet loss rate, improve the reliability of data transmission and reduce the transmission energy consumption.
Description
Technical Field
The invention relates to the technical field of the Internet of things, in particular to a greedy algorithm-based MQTT protocol QoS mechanism selection method.
Background
In recent years, with rapid development of the mobile internet and the internet of things, there is a demand for accessing mass terminal devices into a network in an actual application environment, and the internet of things devices must be connected to the internet, so that the devices can cooperate with each other and cooperate with a back-end service. Whereas under large-scale communication demands, the conventional request/answer model is no longer applicable, the MQTT protocol based on the publish/subscribe model has developed. MQTT is a lightweight cross-platform messaging protocol, report Wen Qingbian, with low demands on network and computing resources. The design principle is to minimize the network bandwidth and equipment resource requirements, ensure reliability and a certain degree of delivery guarantee, and is an ideal choice for equipment with requirements on bandwidth and endurance in the Internet of things.
The MQTT protocol has a mechanism for guaranteeing stable transmission of messages, including steps of message response, storage, retransmission, etc., and provides three different quality of service (Quality of Service, qoS) mechanisms, defined as QoS0, qoS1, and QoS2, respectively, with different reliability guarantees. The message release under the QoS0 mechanism is completely dependent on the underlying TCP/IP network, the publisher can release the message only once, no response confirmation is needed for the application message of the level, and no retransmission mechanism is needed, so that the message may be lost. The QoS1 mechanism can ensure that a message arrives, and if the sender does not receive an acknowledgement message back within a specified time, the previously sent message is repeated. Under this mechanism, the receiving end may repeatedly receive the message, and needs to de-repeat itself. The QoS2 mechanism can ensure that the message arrives only once through two sets of request/response flows, i.e. the loss and repetition of the message are not allowed. Under the environment of the distribution internet of things, mass transfer quantity on sensor collected data can influence the processing of information by a terminal server. How to reduce the packet loss rate of data as much as possible while reducing the energy consumption of data transmission has become a problem to be solved in sensor data transmission in the environment of the power distribution internet of things.
Therefore, a dynamic quality of service (QoS) mechanism selection method is needed to balance the reliability and power consumption performance of protocol data transmission.
Disclosure of Invention
In order to overcome the defects of the technology, the invention provides a QoS mechanism selection method for dynamically adjusting three QoS mechanisms according to channel characteristics so as to reduce the packet loss rate of data as much as possible while meeting the energy consumption requirement.
The technical scheme adopted for overcoming the technical problems is as follows:
a greedy algorithm-based MQTT protocol QoS mechanism selection method comprises the following steps:
a) Defining an MQTT protocol data packet as a big data packet, and collecting task data of I big data packets on an intelligent terminalIndicating that the energy consumption of the ith big data packet under the m transmission mechanism is +.>m is QoS0 mechanism when 0 is fetched, m is QoS1 mechanism when 1 is fetched, m is QoS2 mechanism when 2 is fetched, and the packet loss rate of the ith big data packet under m transmission mechanism is +.>
b) Dividing each big data packet into J small data packets for transmission, wherein the J small data packets are expressed as a setExpressed by the formula->Calculating channel gain g of jth small data packet in ith big data packet during nth transmission under QoS1 and QoS2 mechanisms i,j,n In which H i,j,n For the channel frequency response at the nth retransmission of the jth small packet in the ith large packet, N 0 Is the noise power;
c) Judging whether the j-th small data packet in the i-th large data packet is lost, calculating the total number of lost packets in the i-th large data packet under the QoS0 mechanism, and passing through the formulap calculating transmission energy consumption of j-th small data packet in i-th big data packet under QoS0 mechanism>G in i,j,0 The channel gain of the j-th small data packet in the i-th large data packet under the QoS0 mechanism is represented by p, the transmission power is represented by S, the data quantity of the small data packet is represented by S, and the channel bandwidth is represented by B;
d) By the formulaCalculating total energy consumption of the ith big data packet +.>Respectively judging whether the nth transmission of the PUBLISH data packet of the jth small data packet in the ith large data packet is successful and whether the nth return of the PUBACK data packet of the jth small data packet in the ith large data packet is successful or not;
e) Calculation to obtain transmission energy consumption under QoS1 mechanismWeight loss removal energy consumption->Total energy consumption consumed by QoS1 mechanism
f) Transmission energy consumption under QoS2 mechanism obtained by calculationAnd total energy consumption by QoS2 mechanism +.>
g) By the formulaCalculate the return value->V is a non-negative parameter, by the formulaCalculate->Mean> When the ith big packet is selected, the number of times m transmission mechanism is selected, +.> Selecting an indicator variable of m transmission mechanism for the ith big data packet by the formula +.>Calculating to obtain psi i According to psi i And selecting a QoS mechanism of the MQTT protocol for data transmission, wherein mu is a random number, mu is more than 0 and less than 1, and epsilon is an exploration weight.
Further, in step c) the formula is passedCalculating to obtain an indication variable +.>When->The j small data packet in the i big data packet is lost when +.>When the j small data packet in the i big data packet is not lost, G th Is the signal to noise ratio threshold.
Further, in step c) the formula is passedCalculating the packet loss rate in the ith big data packet under the QoS0 mechanism, and the +.>The total packet loss number in the ith big data packet is +.>Under QoS1 mechanism and QoS2 mechanism, the packet loss rate of the ith big data packet is +.>Further, the method comprises the steps ofd) Is passed through the formulaGet the indicating variable +.>When->When n transmission of PUBLISH packet of j small packet in i big packet fails, when +.>When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful, the data packet is transmitted according to the formulaGet the indicating variable +.>G in i,j,n,back Is the channel gain value, p, when the PUBACK data packet is returned back Is the return power of the PUBACK data packet, whenWhen the nth return of the PUBACK data packet of the jth small data packet in the ith big data packet failsAnd the nth pass back of the PUBACK data packet of the jth small data packet in the ith big data packet is successful.
Further, in step e) the formula is passedCalculating to obtain transmission energy consumption under QoS1 mechanism>In N i,j Is the ithThe total transmission times of the j-th small data packet in the large data packet S back For the size of PUBACK packet, < >>For the channel gain when the j small data packet in the i big data packet is successfully transmitted,the channel gain when the j small data packet in the i big data packet is successfully returned is calculated by the formulaCalculating to obtain the weight-removing energy consumption->In E c For the deduplication energy consumption of any one small data packet, the weight is increased by the formula +.>Calculating the total energy consumption consumed by QoS1 mechanism>Further, step f) is performed by the formula +.>Calculation of
The energy consumption of the first transmission of the j small data packet in the i big data packet under the QoS2 mechanismIn->N-th transmission indicating variable of PUBLISH data packet of j-th small data packet in i-th big data packet under QoS2 mechanism, < +.>Is the ith bigThe nth return indicating variable of the PUBREC data packet of the jth small data packet in the data packets, S REC For the data volume of the PUBLISH packet, and (2)>When->When n transmission of the PUBLISH packet of the j th small packet in the i th large packet under QoS2 mechanism fails, when +.>The nth transmission of the PUBLISH packet of the j-th small packet in the i-th large packet under the QoS2 mechanism is successful,when->When the nth return of the PUBREC packet of the jth small packet in the ith big packet fails, when +.>When the nth pass of the PUBREC data packet of the jth small data packet in the ith big data packet is successful, the data packet passes through the public
Calculating the second transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanismIn the middle ofThe n-th transmission indicating variable for the PUBREL packet of the j-th small packet in the i-th large packet, is +.>An indicator variable is returned for the nth time of the PUBCOMP data packet of the jth small data packet in the ith big data packet, S REL Is the data quantity of PUBREL data packet, S COMP Data amount for PUBCOMP data packet, < ->When->When the nth transmission of the PUBREL packet of the jth small packet in the ith large packet failsWhen the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful,when->When the nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet fails, when +.>The nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet is successful, and the formula is passed throughCalculating total energy consumption of ith big data packet +.>The beneficial effects of the invention are as follows: the method comprises the steps of exploring average packet loss rate and energy consumption of three mechanisms under different channel states by using a greedy algorithm, building a MAB (Multiple-arm band) model, abstracting a rocker arm of the gambling machine into three quality-of-service mechanisms, distributing a reward value to each mechanism, and respectively selecting and transmitting each mechanism in a first round to obtain a reward initial value; and selecting a mechanism with the largest rewarding value for transmission, or exploring each mechanism with a certain probability. Each round of decision is based on the updated result of the previous round of data packet transmission, and the prize value is updated, and so on. The calculation value formula is related to the packet loss rate and the energy consumption, and the smaller the packet loss rate is, the smaller the energy consumption is, the larger the rewards are, so that the aim of realizing the low packet loss rate through the smaller energy consumption is achieved, and the current optimal transmission mechanism is dynamically selected. The sensor equipment in the power distribution network environment can dynamically select a proper QoS mechanism to realize the transmission of collected data to the server so as to meet the requirements on energy consumption and packet loss rate, improve the reliability of data transmission and reduce the transmission energy consumption.
Drawings
Fig. 1 is a block diagram of a power distribution internet of things of the present invention;
FIG. 2 is a diagram of QoS0, qoS1, qoS2 mechanisms;
FIG. 3 is a graph showing the weighted sum of energy consumption and packet loss rate according to the number of mode selections;
fig. 4 is a graph showing the change of the energy consumption and the packet loss rate with the weight.
Detailed Description
The invention is further described with reference to fig. 1 to 4.
The application scene of the greedy algorithm-based dynamic MQTT protocol QoS mechanism selection method in the power distribution Internet of things is shown in the accompanying figure 1. And the MQTT protocol is adopted to interact between the power distribution Internet of things edge computing terminal and a server on the Internet of things platform side. In the information interaction process, the MQTT protocol divides the participants into three identities, namely: publishers, brokers, and subscribers. Both the publisher and subscriber of the message are clients and the proxy for the message is the server. The MQTT protocol adopts a publishing/subscribing mechanism to complete message interaction, the mechanism can provide one-to-many message distribution, an edge computing terminal of an internet of things platform side, which deploys an MQTT proxy in a cloud master station, publishes service contents to the MQTT proxy, and the master station application selects subscribing services from the MQTT proxy and pushes subscribing results to the edge computing terminal. The MQTT protocol of the Internet of things is introduced into the power industry, so that various distribution and transformation equipment can be supported to be conveniently and elastically connected into the Internet of things for distribution, one-to-many message release is realized, the complexity of interaction of application layer components is reduced, and the power consumption is reduced.
The MQTT protocol has three levels of quality of service (QoS) transport mechanisms, as shown in fig. 2. Namely QoS0, qoS1 and QoS2 mechanisms. The sending end only can issue a message once under the QoS0 mechanism, the receiving end can not answer the message, the sending end can not store and resend the message, namely, the sending end does not have a data retransmission mechanism and a response confirmation mechanism, and the data sending end does not care whether the receiving end loses packets or not, so that the sending end has lower energy consumption and higher packet loss rate; the QoS1 mechanism can ensure that the message is successfully transmitted at least once, and has a data retransmission and response confirmation mechanism, if the sender does not receive the returned control message within the designated time, the message transmitted before can be repeatedly transmitted. Under the mechanism, the receiving end may repeatedly receive the message, and needs to de-duplicate itself, and meanwhile, the transmission delay and the node energy consumption are inevitably increased. The QoS2 mechanism can ensure that the message arrives once through two sets of request/response flows, and the loss and repetition of the message are not allowed, but the flow is complex, so that higher node energy consumption exists. Therefore, how to select the transmission mechanism of the protocol according to the requirements of the scene is of great importance.
However, the current transmission scheme selection method faces two challenges. Firstly, how to dynamically switch the transmission mechanism under the condition of uncertain channel information, and secondly, how to balance the energy consumption and the packet loss rate according to the differentiated requirements of the service of the power distribution Internet of things so as to optimize the overall transmission performance. The greedy algorithm is an effective way to solve the decision selection problem. The invention provides a greedy algorithm-based MQTT protocol QoS mechanism dynamic selection method for optimizing the weighted sum of the transmission energy consumption and the packet loss rate of protocol data packets, and realizes a dynamic MQTT protocol QoS mechanism selection strategy by observing channel gain change information and interacting with the environment.
A greedy algorithm-based MQTT protocol QoS mechanism selection method comprises the following steps:
a) Defining an MQTT protocol data packet as a big data packet, and collecting task data of I big data packets on an intelligent terminalIndicating that the energy consumption of the ith big data packet under the m transmission mechanism is +.>m is QoS0 mechanism when 0 is fetched, m is QoS1 mechanism when 1 is fetched, m is QoS2 mechanism when 2 is fetched, and the packet loss rate of the ith big data packet under m transmission mechanism is +.>
b) Dividing each big data packet into J small data packets for transmission, wherein the J small data packets are expressed as a setIn order to simplify the model, the channel states in the data packet transmission process are different under different distribution Internet of things application scenes, and the formula is adopted ∈ ->Calculating channel gain g of jth small data packet in ith big data packet during nth transmission under QoS1 and QoS2 mechanisms i,j,n In which H i,j,n For the channel frequency response at the nth retransmission of the jth small packet in the ith large packet, N 0 Is the noise power.
c) Judging whether the j-th small data packet in the i-th large data packet is lost, calculating the total number of lost packets in the i-th large data packet under the QoS0 mechanism, and passing through the formulaCalculating transmission energy consumption of j small data packet in i big data packet under QoS0 mechanism>G in i,j,0 The channel gain of the j-th small data packet in the i-th large data packet under the QoS0 mechanism is represented by p, p is the transmission power, S is the data volume of the small data packet, and B is the channel bandwidth. />
d) By the formulaCalculating total energy consumption of the ith big data packet +.>Respectively judging whether the nth transmission of the PUBLISH data packet of the jth small data packet in the ith large data packet is successful and whether the nth return of the PUBACK data packet of the jth small data packet in the ith large data packet is successful or not;
e) Calculation to obtain transmission energy consumption under QoS1 mechanismWeight loss removal energy consumption->Total energy consumption consumed by QoS1 mechanism
f) Transmission energy consumption under QoS2 mechanism obtained by calculationAnd total energy consumption by QoS2 mechanism +.>
g) By the formulaCalculate the return value->V is a non-negative parameter, namely, once the weighted sum of the energy consumption and the packet loss rate is too high, the action rewards are smaller, based on the greedy algorithm thought, the invention provides a QoS mechanism dynamic selection algorithm of the MQTT protocol, all indication variables are initialized to be zero firstly, and the device traverses and selects three QoS mechanisms for data transmission. Specifically by the formula->Calculate->Mean of (2)By means of mean->Update-> When the ith big packet is selected, the number of times m transmission mechanism is selected, +.> Selecting an indication variable of an m transmission mechanism for an ith big data packet through a formulaCalculating to obtain psi i According to psi i Selecting QoS mechanism of MQTT protocol for data transmission, realizing weighted sum of packet loss rate and energy consumptionMu is a random number, 0 < mu < 1, epsilon is an exploration weight.
The method comprises the steps of exploring average packet loss rate and energy consumption of three mechanisms under different channel states by using a greedy algorithm, building a MAB (Multiple-arm band) model, abstracting a rocker arm of the gambling machine into three quality-of-service mechanisms, distributing a reward value to each mechanism, and respectively selecting and transmitting each mechanism in a first round to obtain a reward initial value; and selecting a mechanism with the largest rewarding value for transmission, or exploring each mechanism with a certain probability. Each round of decision is based on the updated result of the previous round of data packet transmission, and the prize value is updated, and so on. The calculation value formula is related to the packet loss rate and the energy consumption, and the smaller the packet loss rate is, the smaller the energy consumption is, the larger the rewards are, so that the aim of realizing the low packet loss rate through the smaller energy consumption is achieved, and the current optimal transmission mechanism is dynamically selected. The sensor equipment in the power distribution network environment can dynamically select a proper QoS mechanism to realize the transmission of collected data to the server so as to meet the requirements on energy consumption and packet loss rate, improve the reliability of data transmission and reduce the transmission energy consumption.
Fig. 3 shows the system energy consumption and packet loss rate weighted sum with the mode selection frequency under the proposed algorithm and three QoS mechanisms. With the continuous increase of data transmission quantity, the system can generate the phenomena of packet loss, retransmission and the like, and because in the environment of the power distribution internet of things, the terminal application can not work normally under a large number of repeated messages, the terminal under the QoS1 mechanism needs to consume a large amount of energy to remove the repeated data. As repeated data is accumulated, its weighted sum of energy consumption and packet loss rate exceeds the QoS2 mechanism. Simulation results show that compared with QoS0, qoS1 and QoS2 data transmission mechanisms in the MQTT protocol, the provided dynamic QoS mechanism selection algorithm is optimal in terms of weighted sum of energy consumption and packet loss rate, and the performance is improved by 3.28%, 17.09% and 23.70% respectively.
The relation between the energy consumption and the packet loss rate along with the change of the weight is shown in fig. 4, and as the weight V increases, the proposed algorithm focuses more on minimizing the packet loss rate, and the packet loss rate is obviously reduced. Conversely, as the weight V decreases, the system is more concerned with minimizing energy consumption. The result shows that the proposed algorithm can dynamically balance the packet loss rate and the energy consumption, and keep better performance, namely, the energy consumption and the packet loss rate are balanced by dynamically switching the transmission mechanism of the MQTT, so that the overall transmission performance is optimal.
Example 1:
in step c) by the formulaCalculating to obtain an indication variable +.>When->The j small data packet in the i big data packet is lost when +.>When the j small data packet in the i big data packet is not lost, G th Is the signal to noise ratio threshold.
Example 2:
in step c) by the formulaCalculating the packet loss rate in the ith big data packet under the QoS0 mechanism, and the +.>The total packet loss number in the ith big data packet is +.>Under QoS1 mechanism and QoS2 mechanism, the packet loss rate of the ith big data packet is +.>
Example 3:
in step d) by the formulaGet the indicating variable +.>When->When n transmission of PUBLISH packet of j small packet in i big packet fails, when +.>When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful, the data packet is transmitted according to the formulaGet the indicating variable +.>G in i,j,n,back Is the channel gain value, p, when the PUBACK data packet is returned back Is the return power of the PUBACK data packet, whenWhen the nth return of the PUBACK data packet of the jth small data packet in the ith big data packet failsAnd the nth pass back of the PUBACK data packet of the jth small data packet in the ith big data packet is successful.
Example 4:
in step e) by the formulaCalculating to obtain transmission energy consumption under QoS1 mechanism>In N i,j S is the total transmission times of the j small data packet in the i big data packet back For the size of PUBACK packet, < >>Is the channel gain when the j small data packet in the i big data packet is successfully transmitted,/for the j small data packet>For the channel gain when the j small data packet in the i big data packet is successfully returned, the channel gain is expressed by the formula +.>Calculating to obtain the weight-removing energy consumption->In E c For the deduplication energy consumption of any one small data packet, the weight is increased by the formula +.>Calculating the total energy consumption consumed by QoS1 mechanism>
Example 5:
in step f) by the formulaCalculating the first transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanism>In->N-th transmission indicating variable of PUBLISH data packet of j-th small data packet in i-th big data packet under QoS2 mechanism, < +.>For the j-th small in the i-th big data packetThe nth return indicating variable of the PUBREC data packet of the data packet, S REC For the data volume of the PUBLISH packet, and (2)>When->When n transmission of the PUBLISH packet of the j th small packet in the i th large packet under QoS2 mechanism fails, when +.>PUBLISH packet nth transmission success of jth small packet in ith big packet under QoS2 mechanism, +.>When->When the nth return of the PUBREC packet of the jth small packet in the ith big packet fails, when +.>When the nth pass of the PUBREC data packet of the jth small data packet in the ith big data packet is successful, the data packet passes through the public
Calculating the second transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanismIn the middle ofThe n-th transmission of the PUBREL packet for the j-th small packet in the i-th large packet indicates a variable,an indicator variable is returned for the nth time of the PUBCOMP data packet of the jth small data packet in the ith big data packet, S REL Is the data quantity of PUBREL data packet, S COMP Data amount for PUBCOMP data packet, < ->When->When the nth transmission of the PUBREL packet of the jth small packet in the ith large packet failsWhen the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful,when->When the nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet fails, when +.>The nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet is successful, and the formula is passed throughCalculating total energy consumption of ith big data packet +.>/>
Claims (3)
1. A greedy algorithm-based MQTT protocol QoS mechanism selection method is characterized by comprising the following steps:
a) Defining an MQTT protocol data packet as a big data packet, and collecting task data of I big data packets on an intelligent terminalIndicating that the energy consumption of the ith big data packet under the m transmission mechanism is +.>m is QoS0 mechanism when 0 is fetched, m is QoS1 mechanism when 1 is fetched, m is QoS2 mechanism when 2 is fetched, and the packet loss rate of the ith big data packet under m transmission mechanism is +.>
b) Dividing each big data packet into J small data packets for transmission, wherein the J small data packets are expressed as a setExpressed by the formula->Calculating channel gain g of jth small data packet in ith big data packet during nth transmission under QoS1 and QoS2 mechanisms i,j,n In which H i,j,n For the channel frequency response at the nth retransmission of the jth small packet in the ith large packet, N 0 Is the noise power;
c) Judging whether the j-th small data packet in the i-th large data packet is lost, calculating the total number of lost packets in the i-th large data packet under the QoS0 mechanism, and passing through the formulaCalculating transmission energy consumption of j small data packet in i big data packet under QoS0 mechanism>G in i,j,0 The channel gain of the j-th small data packet in the i-th large data packet under the QoS0 mechanism is represented by p, the transmission power is represented by S, the data quantity of the small data packet is represented by S, and the channel bandwidth is represented by B;
d) By the formulaCalculating total energy consumption of the ith big data packet +.>Respectively judging whether the nth transmission of the PUBLISH data packet of the jth small data packet in the ith large data packet is successful and whether the nth return of the PUBACK data packet of the jth small data packet in the ith large data packet is successful or not;
e) Calculation to obtain transmission energy consumption under QoS1 mechanismWeight loss removal energy consumption->And total energy consumption by QoS1 mechanism +.>
f) Transmission energy consumption under QoS2 mechanism obtained by calculationAnd total energy consumption by QoS2 mechanism +.>
g) By the formulaCalculate the return value->V is a non-negative parameter, by the formulaCalculate->Mean> When the ith big packet is selected, the number of times m transmission mechanism is selected, +.> Selecting an indicator variable of m transmission mechanism for the ith big data packet by the formula +.>Calculating to obtain psi i According to psi i Selecting a QoS mechanism of an MQTT protocol for data transmission, wherein mu is a random number, mu is more than 0 and less than 1, and epsilon is an exploration weight; />
In step e) by the formulaCalculating to obtain transmission energy consumption under QoS1 mechanism>In N i,j S is the total transmission times of the j small data packet in the i big data packet back For the size of PUBACK packet, < >>Is the channel gain when the j small data packet in the i big data packet is successfully transmitted,/for the j small data packet>For the channel gain when the j small data packet in the i big data packet is successfully returned, the channel gain is expressed by the formula +.>Calculating to obtain the weight-removing energy consumption->In E c For the deduplication energy consumption of any one small data packet, the weight is increased by the formula +.>Calculating the total energy consumption consumed by QoS1 mechanism>In step d) by the formulaGet the indicating variable +.>When->When n transmission of PUBLISH packet of j small packet in i big packet fails, when +.>When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful, the data packet is transmitted according to the formulaGet the indicating variable +.>G in i,j,n,back Is the channel gain value, p, when the PUBACK data packet is returned back Is the return power of the PUBACK data packet, whenWhen the nth return of the PUBACK data packet of the jth small data packet in the ith big data packet failsThe nth pass back of the PUBACK data packet of the jth small data packet in the ith big data packet is successful; />
In step f) by the formulaCalculating the first transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanism>In->N-th transmission indicating variable of PUBLISH data packet of j-th small data packet in i-th big data packet under QoS2 mechanism, < +.>An indication variable is returned for the nth time of the PUBREC data packet of the jth small data packet in the ith big data packet, S REC For the data volume of the PUBLISH packet,/>when->When n transmission of the PUBLISH packet of the j th small packet in the i th large packet under QoS2 mechanism fails, when +.>The nth transmission of the PUBLISH packet of the j-th small packet in the i-th large packet under the QoS2 mechanism is successful,when->When the nth return of the PUBREC packet of the jth small packet in the ith big packet fails, when +.>When the nth pass back of the PUBREC data packet of the jth small data packet in the ith big data packet is successful, the formula is passed throughCalculating the second transmission energy consumption +.f of the j-th small data packet in the i-th big data packet under QoS2 mechanism>In->The n-th transmission indicating variable for the PUBREL packet of the j-th small packet in the i-th large packet, is +.>An indicator variable is returned for the nth time of the PUBCOMP data packet of the jth small data packet in the ith big data packet, S REL Is the data quantity of PUBREL data packet, S COMP Data amount for PUBCOMP data packet, < ->When->When the nth transmission of the PUBREL packet of the jth small packet in the ith large packet fails, when +.>When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful,when->When the nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet fails, when +.>The nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet is successful, and the formula is passed throughCalculating total energy consumption of ith big data packet +.>
2. The greedy algorithm-based MQTT protocol QoS mechanism selection method of claim 1, wherein: in step c) by the formulaCalculating to obtain an indication variable +.>When->The j small data packet in the i big data packet is lost when +.>When the j small data packet in the i big data packet is not lost, G th Is the signal to noise ratio threshold.
3. The greedy algorithm-based MQTT protocol QoS mechanism selection method of claim 2, wherein: in step c) by the formulaCalculating the packet loss rate in the ith big data packet under the QoS0 mechanism, and the +.>The total packet loss number in the ith big data packet is +.>Under QoS1 mechanism and QoS2 mechanism, the packet loss rate of the ith big data packet/>
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110568297.1A CN113472843B (en) | 2021-05-24 | 2021-05-24 | Greedy algorithm-based MQTT protocol QoS mechanism selection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110568297.1A CN113472843B (en) | 2021-05-24 | 2021-05-24 | Greedy algorithm-based MQTT protocol QoS mechanism selection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113472843A CN113472843A (en) | 2021-10-01 |
CN113472843B true CN113472843B (en) | 2023-05-26 |
Family
ID=77871386
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110568297.1A Active CN113472843B (en) | 2021-05-24 | 2021-05-24 | Greedy algorithm-based MQTT protocol QoS mechanism selection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113472843B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114125745A (en) * | 2021-11-19 | 2022-03-01 | 山东华科信息技术有限公司 | MQTT protocol power control and QoS mechanism selection method |
CN114125746B (en) * | 2021-11-19 | 2022-08-16 | 山东华科信息技术有限公司 | Dynamic CoAP mode selection method and device based on UCB |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103179675B (en) * | 2013-01-08 | 2016-05-04 | 中国人民解放军理工大学通信工程学院 | Online sequential perception based on ε-greediness and chance cut-in method |
CN113132490A (en) * | 2021-04-26 | 2021-07-16 | 华北电力大学 | MQTT protocol QoS mechanism selection scheme based on reinforcement learning |
CN114125745A (en) * | 2021-11-19 | 2022-03-01 | 山东华科信息技术有限公司 | MQTT protocol power control and QoS mechanism selection method |
-
2021
- 2021-05-24 CN CN202110568297.1A patent/CN113472843B/en active Active
Non-Patent Citations (2)
Title |
---|
Hao Zhang等.Delay-reliability-aware protocol adaption and quality of service guarantee for message queuing telemetry transport-empowered electric Internet of things.https://journals.sagepub.com/doi/full/10.1177/15501329221097815.2023,全文. * |
Shinho Lee等.Correlation Analysis of MQTT Loss and Delay According to QoS Level.2013 International Conference on Information Networking (ICOIN).2013,全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN113472843A (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113472843B (en) | Greedy algorithm-based MQTT protocol QoS mechanism selection method | |
CN101296152B (en) | Data scheduling method and system of equity linked network | |
Chen et al. | Artificial intelligence aided joint bit rate selection and radio resource allocation for adaptive video streaming over F-RANs | |
Fortuna et al. | QoE in pull based P2P-TV systems: Overlay topology design tradeoffs | |
WO2006074832A1 (en) | On-demand group communication services with quality of service (qos) guarantees | |
CN104092625B (en) | A kind of self adaptation being used in DCN asks dispatching method in batches | |
CN112954385A (en) | Self-adaptive shunt decision method based on control theory and data driving | |
Furqan et al. | A collaborative hotspot caching design for 5G cellular network | |
CN113132490A (en) | MQTT protocol QoS mechanism selection scheme based on reinforcement learning | |
Chen et al. | Learning-based proactive resource allocation for delay-sensitive packet transmission | |
Carta et al. | Efficient uplink bandwidth utilization in p2p-tv streaming systems | |
Kim et al. | Multipath-based HTTP adaptive streaming scheme for the 5G network | |
Na et al. | Research on aggregation and propagation of self-similar traffic in satellite network | |
Zhang et al. | MEC‐enabled video streaming in device‐to‐device networks | |
CN115914112A (en) | Multi-path scheduling algorithm and system based on PDAA3C | |
CN114828081A (en) | Cooperative hybrid congestion control method based on path recovery | |
CN114125745A (en) | MQTT protocol power control and QoS mechanism selection method | |
Giambene et al. | Traffic management in HSDPA via GEO satellite | |
Wang et al. | Necessary and sufficient conditions for optimal flow control in multirate multicast networks | |
Hou et al. | Cognitive radio spectrum allocation strategy based on improved genetic algorithm | |
Nichols | Improving Network Simulation with Feedback | |
Wang et al. | End-to-end stochastic qos performance under multi-layered satellite network | |
Shrivastava et al. | A novel caching framework for mobile social networks in 5g and beyond | |
CN101924793A (en) | P2P streaming media-based secondary coding play method and system | |
Wang et al. | Grouping and time-series notifying of periodic data in a real-time streaming system for smart toy claw machine |
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 |