A method of load balancing based on mqtt protocol multi-broker

A load balancing algorithm and load balancing technology, applied in the field of communication, can solve problems such as downtime, connection impact, and device failure to connect, and achieve the effects of flexible methods, controllable number of device connections, and flexible expansion

Active Publication Date: 2021-11-30
深圳市信润富联数字科技有限公司
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This solution has the following problems: First, the same domain name or IP is used for the general certificate burning, which will cause a large number of subsequent devices to be connected to the same Broker server, and there may be downtime problems; Second, even if a different domain name or IP is used, it will cause a device to connect to a fixed Broker server. If the Broker server is down, the device will not be able to connect to the Broker server, and the device needs to be upgraded to connect The new Broker address, on the one hand, affects the connection of the device. The device needs to perform a lot of operations such as upgrading, and the device cannot be restored to the normal state in time. On the other hand, it is related to the domain name or IP burned by the device and the number of devices. , the number of Broker connections is affected by the device certificate and the number of devices, which may cause the number of connections to a certain Broker server to be uncontrollable, making it difficult to control the number of devices connected to the Broker server
Therefore, in view of the above technical design defects, it is necessary to provide a method based on MQTT protocol multi-Broker to achieve load balancing, to solve the problem that the expansion of the number of devices does not affect the peak of the number of Broker server connections, and to ensure that the burning of device certificates is not limited The device is connected to a fixed Broker server, so as to solve the problem that the device cannot be connected due to the downtime of a certain Broker service

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method of load balancing based on mqtt protocol multi-broker
  • A method of load balancing based on mqtt protocol multi-broker
  • A method of load balancing based on mqtt protocol multi-broker

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0039] refer to Figure 1 to Figure 3 As shown, the present invention provides a kind of method based on MQTT protocol multi-Broker to realize load balancing, comprising the following steps:

[0040] S1. The device obtains the configuration information of the gateway service by reading the certificate information of the device itself, and initiates an http or https request to the gateway service according to the obtained configuration information. The request carries the configuration information of the Broker server that the device connected to last time. To obtain the IP / address and port of the Broker server required to establish the MQTT client, and to recalculate the number of device connections to the Broker server; specifically, the specific implementation of step S1 is: when the device is powered on and connected to WiFi, the device It ...

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

PUM

No PUM Login to view more

Abstract

The invention discloses a method for realizing load balancing based on the MQTT protocol with multiple Brokers, comprising the steps of: a device obtains the information of the gateway service and sends a request to the gateway service; forwards the request to the business service through the gateway service; the business service obtains the information list of all Brokers and sends Assemble it into a key, and determine the parameter value forwarded by the gateway service; the business service obtains the number of device connections corresponding to each Broker; the business service obtains the Broker information according to the load balancing algorithm; returns the Broker information to the device; the device sends a connect request to the Broker ; Assemble Broker's information into a key; redis performs an auto-increment operation; Broker assembles the packet information and returns it to the device and maintains a heartbeat with the device. The present invention can dynamically switch the Broker connected to the device without upgrading the device, and the number of device connections is controllable.

Description

technical field [0001] The invention relates to the technical field of communication, in particular to a method for realizing load balancing based on MQTT protocol with multiple Brokers. Background technique [0002] The MQTT protocol is used in smart devices, so that after the device establishes a connection with the Broker server, it can maintain a long connection (that is, the heartbeat detection mechanism). At present, most solutions are to generate certificate information (also called a certificate file, which contains the domain name or IP address of the Broker server) for the device, and burn the certificate information into the device. At this time, the address of the Broker server will be After burning into the device, the device obtains the address of the Broker server through the burned domain name or IP, so that the device establishes a connection with the Broker server through the MQTT protocol. This solution has the following problems: First, the same domain n...

Claims

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

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): H04L29/08
CPCH04L67/141H04L67/1001
Inventor 覃江威杜冬冬罗启明熊皓杨志宇吴育校成建洪陈功陈军冯建设
Owner 深圳市信润富联数字科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products