CN113472843B - Greedy algorithm-based MQTT protocol QoS mechanism selection method - Google Patents

Greedy algorithm-based MQTT protocol QoS mechanism selection method Download PDF

Info

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
Application number
CN202110568297.1A
Other languages
Chinese (zh)
Other versions
CN113472843A (en
Inventor
刘明林
由新红
李帅
房牧
张鹏平
刘合金
苏国强
王峰
黄敏
于海东
李立生
张世栋
李建修
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Shandong Electric Power 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 State Grid Corp of China SGCC, Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202110568297.1A priority Critical patent/CN113472843B/en
Publication of CN113472843A publication Critical patent/CN113472843A/en
Application granted granted Critical
Publication of CN113472843B publication Critical patent/CN113472843B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/11Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling 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/61Scheduling 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
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing 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

Greedy algorithm-based MQTT protocol QoS mechanism selection method
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 terminal
Figure GDA0004096040980000021
Indicating that the energy consumption of the ith big data packet under the m transmission mechanism is +.>
Figure GDA0004096040980000022
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 +.>
Figure GDA0004096040980000023
b) Dividing each big data packet into J small data packets for transmission, wherein the J small data packets are expressed as a set
Figure GDA0004096040980000024
Expressed by the formula->
Figure GDA0004096040980000025
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 formula
Figure GDA0004096040980000026
p calculating transmission energy consumption of j-th small data packet in i-th big data packet under QoS0 mechanism>
Figure GDA0004096040980000027
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 formula
Figure GDA0004096040980000028
Calculating total energy consumption of the ith big data packet +.>
Figure GDA0004096040980000029
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 mechanism
Figure GDA00040960409800000210
Weight loss removal energy consumption->
Figure GDA00040960409800000211
Total energy consumption consumed by QoS1 mechanism
Figure GDA0004096040980000031
f) Transmission energy consumption under QoS2 mechanism obtained by calculation
Figure GDA0004096040980000032
And total energy consumption by QoS2 mechanism +.>
Figure GDA0004096040980000033
g) By the formula
Figure GDA0004096040980000034
Calculate the return value->
Figure GDA0004096040980000035
V is a non-negative parameter, by the formula
Figure GDA0004096040980000036
Calculate->
Figure GDA0004096040980000037
Mean>
Figure GDA0004096040980000038
Figure GDA0004096040980000039
When the ith big packet is selected, the number of times m transmission mechanism is selected, +.>
Figure GDA00040960409800000310
Figure GDA00040960409800000311
Selecting an indicator variable of m transmission mechanism for the ith big data packet by the formula +.>
Figure GDA00040960409800000312
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 passed
Figure GDA00040960409800000313
Calculating to obtain an indication variable +.>
Figure GDA00040960409800000314
When->
Figure GDA00040960409800000315
The j small data packet in the i big data packet is lost when +.>
Figure GDA00040960409800000316
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 passed
Figure GDA00040960409800000317
Calculating the packet loss rate in the ith big data packet under the QoS0 mechanism, and the +.>
Figure GDA00040960409800000318
The total packet loss number in the ith big data packet is +.>
Figure GDA00040960409800000319
Under QoS1 mechanism and QoS2 mechanism, the packet loss rate of the ith big data packet is +.>
Figure GDA00040960409800000320
Further, the method comprises the steps ofd) Is passed through the formula
Figure GDA00040960409800000321
Get the indicating variable +.>
Figure GDA00040960409800000322
When->
Figure GDA00040960409800000323
When n transmission of PUBLISH packet of j small packet in i big packet fails, when +.>
Figure GDA00040960409800000324
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 formula
Figure GDA0004096040980000041
Get the indicating variable +.>
Figure GDA0004096040980000042
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, when
Figure GDA0004096040980000043
When the nth return of the PUBACK data packet of the jth small data packet in the ith big data packet fails
Figure GDA0004096040980000044
And 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 passed
Figure GDA0004096040980000045
Calculating to obtain transmission energy consumption under QoS1 mechanism>
Figure GDA0004096040980000046
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, < >>
Figure GDA0004096040980000047
For the channel gain when the j small data packet in the i big data packet is successfully transmitted,
Figure GDA00040960409800000412
the channel gain when the j small data packet in the i big data packet is successfully returned is calculated by the formula
Figure GDA0004096040980000048
Calculating to obtain the weight-removing energy consumption->
Figure GDA0004096040980000049
In E c For the deduplication energy consumption of any one small data packet, the weight is increased by the formula +.>
Figure GDA00040960409800000410
Calculating the total energy consumption consumed by QoS1 mechanism>
Figure GDA00040960409800000411
Further, step f) is performed by the formula +.>
Figure GDA0004096040980000051
Calculation of
The energy consumption of the first transmission of the j small data packet in the i big data packet under the QoS2 mechanism
Figure GDA0004096040980000053
In->
Figure GDA0004096040980000054
N-th transmission indicating variable of PUBLISH data packet of j-th small data packet in i-th big data packet under QoS2 mechanism, < +.>
Figure GDA0004096040980000055
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)>
Figure GDA0004096040980000056
When->
Figure GDA0004096040980000057
When n transmission of the PUBLISH packet of the j th small packet in the i th large packet under QoS2 mechanism fails, when +.>
Figure GDA0004096040980000058
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,
Figure GDA0004096040980000059
when->
Figure GDA00040960409800000510
When the nth return of the PUBREC packet of the jth small packet in the ith big packet fails, when +.>
Figure GDA00040960409800000511
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
Figure GDA0004096040980000061
A kind of electronic device with high-pressure air-conditioning system
Figure GDA0004096040980000062
Meter with a meter body
Figure GDA0004096040980000063
Calculating the second transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanism
Figure GDA0004096040980000064
In the middle of
Figure GDA0004096040980000065
The n-th transmission indicating variable for the PUBREL packet of the j-th small packet in the i-th large packet, is +.>
Figure GDA0004096040980000066
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, < ->
Figure GDA0004096040980000067
When->
Figure GDA0004096040980000068
When the nth transmission of the PUBREL packet of the jth small packet in the ith large packet fails
Figure GDA0004096040980000069
When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful,
Figure GDA00040960409800000610
when->
Figure GDA00040960409800000611
When the nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet fails, when +.>
Figure GDA00040960409800000612
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 through
Figure GDA00040960409800000613
Calculating total energy consumption of ith big data packet +.>
Figure GDA00040960409800000614
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 terminal
Figure GDA0004096040980000081
Indicating that the energy consumption of the ith big data packet under the m transmission mechanism is +.>
Figure GDA0004096040980000082
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 +.>
Figure GDA0004096040980000083
b) Dividing each big data packet into J small data packets for transmission, wherein the J small data packets are expressed as a set
Figure GDA0004096040980000084
In 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 ∈ ->
Figure GDA0004096040980000085
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 formula
Figure GDA0004096040980000086
Calculating transmission energy consumption of j small data packet in i big data packet under QoS0 mechanism>
Figure GDA0004096040980000087
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 formula
Figure GDA0004096040980000091
Calculating total energy consumption of the ith big data packet +.>
Figure GDA0004096040980000092
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 mechanism
Figure GDA0004096040980000093
Weight loss removal energy consumption->
Figure GDA0004096040980000094
Total energy consumption consumed by QoS1 mechanism
Figure GDA0004096040980000095
f) Transmission energy consumption under QoS2 mechanism obtained by calculation
Figure GDA0004096040980000096
And total energy consumption by QoS2 mechanism +.>
Figure GDA0004096040980000097
g) By the formula
Figure GDA0004096040980000098
Calculate the return value->
Figure GDA0004096040980000099
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->
Figure GDA00040960409800000910
Calculate->
Figure GDA00040960409800000911
Mean of (2)
Figure GDA00040960409800000912
By means of mean->
Figure GDA00040960409800000913
Update->
Figure GDA00040960409800000914
Figure GDA00040960409800000915
When the ith big packet is selected, the number of times m transmission mechanism is selected, +.>
Figure GDA00040960409800000916
Figure GDA00040960409800000917
Selecting an indication variable of an m transmission mechanism for an ith big data packet through a formula
Figure GDA00040960409800000918
Calculating 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 formula
Figure GDA0004096040980000101
Calculating to obtain an indication variable +.>
Figure GDA0004096040980000102
When->
Figure GDA0004096040980000103
The j small data packet in the i big data packet is lost when +.>
Figure GDA0004096040980000104
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 formula
Figure GDA0004096040980000105
Calculating the packet loss rate in the ith big data packet under the QoS0 mechanism, and the +.>
Figure GDA0004096040980000106
The total packet loss number in the ith big data packet is +.>
Figure GDA0004096040980000111
Under QoS1 mechanism and QoS2 mechanism, the packet loss rate of the ith big data packet is +.>
Figure GDA0004096040980000112
Example 3:
in step d) by the formula
Figure GDA0004096040980000113
Get the indicating variable +.>
Figure GDA0004096040980000114
When->
Figure GDA0004096040980000115
When n transmission of PUBLISH packet of j small packet in i big packet fails, when +.>
Figure GDA0004096040980000116
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 formula
Figure GDA0004096040980000117
Get the indicating variable +.>
Figure GDA0004096040980000118
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, when
Figure GDA0004096040980000119
When the nth return of the PUBACK data packet of the jth small data packet in the ith big data packet fails
Figure GDA00040960409800001110
And 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 formula
Figure GDA00040960409800001111
Calculating to obtain transmission energy consumption under QoS1 mechanism>
Figure GDA00040960409800001112
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, < >>
Figure GDA00040960409800001113
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>
Figure GDA0004096040980000121
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 +.>
Figure GDA0004096040980000122
Calculating to obtain the weight-removing energy consumption->
Figure GDA0004096040980000123
In E c For the deduplication energy consumption of any one small data packet, the weight is increased by the formula +.>
Figure GDA0004096040980000124
Calculating the total energy consumption consumed by QoS1 mechanism>
Figure GDA0004096040980000125
Example 5:
in step f) by the formula
Figure GDA0004096040980000126
Calculating the first transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanism>
Figure GDA0004096040980000127
In->
Figure GDA0004096040980000128
N-th transmission indicating variable of PUBLISH data packet of j-th small data packet in i-th big data packet under QoS2 mechanism, < +.>
Figure GDA0004096040980000129
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)>
Figure GDA00040960409800001210
When->
Figure GDA00040960409800001211
When n transmission of the PUBLISH packet of the j th small packet in the i th large packet under QoS2 mechanism fails, when +.>
Figure GDA00040960409800001212
PUBLISH packet nth transmission success of jth small packet in ith big packet under QoS2 mechanism, +.>
Figure GDA00040960409800001213
When->
Figure GDA00040960409800001214
When the nth return of the PUBREC packet of the jth small packet in the ith big packet fails, when +.>
Figure GDA0004096040980000131
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
Figure GDA0004096040980000132
A kind of electronic device with high-pressure air-conditioning system
Figure GDA0004096040980000133
Meter with a meter body
Figure GDA0004096040980000134
Calculating the second transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanism
Figure GDA0004096040980000135
In the middle of
Figure GDA0004096040980000136
The n-th transmission of the PUBREL packet for the j-th small packet in the i-th large packet indicates a variable,
Figure GDA0004096040980000137
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, < ->
Figure GDA0004096040980000138
When->
Figure GDA0004096040980000139
When the nth transmission of the PUBREL packet of the jth small packet in the ith large packet fails
Figure GDA00040960409800001310
When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful,
Figure GDA00040960409800001311
when->
Figure GDA00040960409800001312
When the nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet fails, when +.>
Figure GDA00040960409800001313
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 through
Figure GDA00040960409800001314
Calculating total energy consumption of ith big data packet +.>
Figure GDA00040960409800001315
/>

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 terminal
Figure FDA00041160735500000112
Indicating that the energy consumption of the ith big data packet under the m transmission mechanism is +.>
Figure FDA0004116073550000011
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 +.>
Figure FDA0004116073550000012
b) Dividing each big data packet into J small data packets for transmission, wherein the J small data packets are expressed as a set
Figure FDA0004116073550000013
Expressed by the formula->
Figure FDA0004116073550000014
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 formula
Figure FDA0004116073550000015
Calculating transmission energy consumption of j small data packet in i big data packet under QoS0 mechanism>
Figure FDA0004116073550000016
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 formula
Figure FDA0004116073550000017
Calculating total energy consumption of the ith big data packet +.>
Figure FDA0004116073550000018
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 mechanism
Figure FDA0004116073550000019
Weight loss removal energy consumption->
Figure FDA00041160735500000110
And total energy consumption by QoS1 mechanism +.>
Figure FDA00041160735500000111
f) Transmission energy consumption under QoS2 mechanism obtained by calculation
Figure FDA0004116073550000021
And total energy consumption by QoS2 mechanism +.>
Figure FDA0004116073550000022
g) By the formula
Figure FDA0004116073550000023
Calculate the return value->
Figure FDA0004116073550000024
V is a non-negative parameter, by the formula
Figure FDA0004116073550000025
Calculate->
Figure FDA0004116073550000026
Mean>
Figure FDA0004116073550000027
Figure FDA0004116073550000028
When the ith big packet is selected, the number of times m transmission mechanism is selected, +.>
Figure FDA0004116073550000029
Figure FDA00041160735500000210
Selecting an indicator variable of m transmission mechanism for the ith big data packet by the formula +.>
Figure FDA00041160735500000211
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 formula
Figure FDA00041160735500000212
Calculating to obtain transmission energy consumption under QoS1 mechanism>
Figure FDA00041160735500000213
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, < >>
Figure FDA00041160735500000214
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>
Figure FDA00041160735500000215
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 +.>
Figure FDA00041160735500000216
Calculating to obtain the weight-removing energy consumption->
Figure FDA00041160735500000217
In E c For the deduplication energy consumption of any one small data packet, the weight is increased by the formula +.>
Figure FDA00041160735500000218
Calculating the total energy consumption consumed by QoS1 mechanism>
Figure FDA00041160735500000219
In step d) by the formula
Figure FDA0004116073550000031
Get the indicating variable +.>
Figure FDA0004116073550000032
When->
Figure FDA0004116073550000033
When n transmission of PUBLISH packet of j small packet in i big packet fails, when +.>
Figure FDA0004116073550000034
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 formula
Figure FDA0004116073550000035
Get the indicating variable +.>
Figure FDA0004116073550000036
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, when
Figure FDA0004116073550000037
When the nth return of the PUBACK data packet of the jth small data packet in the ith big data packet fails
Figure FDA0004116073550000038
The 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 formula
Figure FDA0004116073550000039
Calculating the first transmission energy consumption of the j small data packet in the i big data packet under the QoS2 mechanism>
Figure FDA00041160735500000310
In->
Figure FDA00041160735500000311
N-th transmission indicating variable of PUBLISH data packet of j-th small data packet in i-th big data packet under QoS2 mechanism, < +.>
Figure FDA00041160735500000312
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,/>
Figure FDA00041160735500000313
when->
Figure FDA0004116073550000041
When n transmission of the PUBLISH packet of the j th small packet in the i th large packet under QoS2 mechanism fails, when +.>
Figure FDA0004116073550000042
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,
Figure FDA0004116073550000043
when->
Figure FDA0004116073550000044
When the nth return of the PUBREC packet of the jth small packet in the ith big packet fails, when +.>
Figure FDA0004116073550000045
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 through
Figure FDA0004116073550000046
Calculating the second transmission energy consumption +.f of the j-th small data packet in the i-th big data packet under QoS2 mechanism>
Figure FDA0004116073550000047
In->
Figure FDA0004116073550000048
The n-th transmission indicating variable for the PUBREL packet of the j-th small packet in the i-th large packet, is +.>
Figure FDA0004116073550000049
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, < ->
Figure FDA00041160735500000410
When->
Figure FDA00041160735500000411
When the nth transmission of the PUBREL packet of the jth small packet in the ith large packet fails, when +.>
Figure FDA00041160735500000412
When the nth transmission of the PUBLISH data packet of the jth small data packet in the ith big data packet is successful,
Figure FDA00041160735500000413
when->
Figure FDA00041160735500000414
When the nth return of the PUBCOMP data packet of the jth small data packet in the ith big data packet fails, when +.>
Figure FDA0004116073550000051
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 through
Figure FDA0004116073550000052
Calculating total energy consumption of ith big data packet +.>
Figure FDA0004116073550000053
2. The greedy algorithm-based MQTT protocol QoS mechanism selection method of claim 1, wherein: in step c) by the formula
Figure FDA0004116073550000054
Calculating to obtain an indication variable +.>
Figure FDA0004116073550000055
When->
Figure FDA0004116073550000056
The j small data packet in the i big data packet is lost when +.>
Figure FDA0004116073550000057
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 formula
Figure FDA0004116073550000058
Calculating the packet loss rate in the ith big data packet under the QoS0 mechanism, and the +.>
Figure FDA0004116073550000059
The total packet loss number in the ith big data packet is +.>
Figure FDA00041160735500000510
Under QoS1 mechanism and QoS2 mechanism, the packet loss rate of the ith big data packet
Figure FDA00041160735500000511
/>
CN202110568297.1A 2021-05-24 2021-05-24 Greedy algorithm-based MQTT protocol QoS mechanism selection method Active CN113472843B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
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