WO2023005809A1 - Message queuing telemetry transport network access method, and controller and gateway - Google Patents

Message queuing telemetry transport network access method, and controller and gateway Download PDF

Info

Publication number
WO2023005809A1
WO2023005809A1 PCT/CN2022/107189 CN2022107189W WO2023005809A1 WO 2023005809 A1 WO2023005809 A1 WO 2023005809A1 CN 2022107189 W CN2022107189 W CN 2022107189W WO 2023005809 A1 WO2023005809 A1 WO 2023005809A1
Authority
WO
WIPO (PCT)
Prior art keywords
proxy server
gateway
mqtt
controller
transmission delay
Prior art date
Application number
PCT/CN2022/107189
Other languages
French (fr)
Chinese (zh)
Inventor
聂坤
Original Assignee
西门子(中国)有限公司
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 西门子(中国)有限公司 filed Critical 西门子(中国)有限公司
Publication of WO2023005809A1 publication Critical patent/WO2023005809A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/121Shortest path evaluation by minimising delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • 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/56Provisioning of proxy services
    • 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

Abstract

Disclosed in the embodiments of the present invention are a message queuing telemetry transport network access method, and a controller and a gateway. The method comprises: a controller in an MQTT network sending a QoS request carrying an identity (ID) to a first gateway to which a first client accesses, wherein the QoS request is used for the first gateway to broadcast a PING request to all broker servers in the MQTT network, to respectively calculate a transmission delay between the first gateway and each broker server according to a receiving timestamp of a PING response returned by each broker server and a sending timestamp of the PING request, and to send the transmission delay between the first gateway and each broker server to the controller; and the controller using a first broker server, which corresponds to the minimum transmission delay, as an access broker server of the first gateway, and returning the address of the first broker server to the first gateway by carrying the address in a broker server access message, wherein the broker server access message is used for the first gateway to establish a connection with the first broker server. By means of the embodiments of the present invention, the QoS of an MQTT network is improved.

Description

消息队列遥测传输网络接入方法、控制器及网关Message queue telemetry transmission network access method, controller and gateway 技术领域technical field
本发明涉及数据通讯技术领域,特别是MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)网络接入方法、控制器、网关及可读存储介质、电子设备和计算机程序产品。The present invention relates to the technical field of data communication, especially MQTT (Message Queuing Telemetry Transport, message queue telemetry transmission) network access method, controller, gateway and readable storage medium, electronic equipment and computer program products.
背景技术Background technique
MQTT是一种基于发布/订阅模式的“轻量级”通讯协议,该协议构建于TCP/IP协议上。MQTT最大优点在于,可以以极少的代码和有限的带宽,为连接远程设备提供实时可靠的消息服务。作为一种低开销、低带宽占用的即时通讯协议,使其在物联网、小型设备、移动应用等方面有较广泛的应用。MQTT is a "lightweight" communication protocol based on the publish/subscribe model, which is built on the TCP/IP protocol. The biggest advantage of MQTT is that it can provide real-time and reliable message services for connected remote devices with very little code and limited bandwidth. As a low-overhead, low-bandwidth instant messaging protocol, it has a wide range of applications in the Internet of Things, small devices, and mobile applications.
MQTT是一个基于客户端-服务器的消息发布/订阅传输协议。实现MQTT协议需要客户端和服务器端通讯完成,在通讯过程中,MQTT协议中有三种身份:发布者(Publisher)、代理(Broker)、订阅者(Subscriber)。其中,消息的发布者和订阅者都是客户端,代理是服务器,消息发布者可以同时是订阅者。MQTT传输的消息分为:主题(Topic)和负载(payload)两部分。Topic可以理解为消息的类型,订阅者订阅(Subscribe)后,就会收到该主题的消息内容(payload)。MQTT会构建底层网络传输,它将建立客户端到服务器的连接,提供两者之间的一个有序的、无损的、基于字节流的双向传输。当数据通过MQTT网络发送时,MQTT会把与之相关的服务质量(QoS)和主题(Topic)相关联。MQTT is a client-server based message publish/subscribe transport protocol. The realization of the MQTT protocol requires the completion of communication between the client and the server. During the communication process, there are three identities in the MQTT protocol: Publisher, Broker, and Subscriber. Among them, the publisher and subscriber of the message are clients, the agent is the server, and the publisher of the message can be a subscriber at the same time. The message transmitted by MQTT is divided into two parts: topic (Topic) and load (payload). Topic can be understood as the type of message. After subscribing, the subscriber will receive the message content (payload) of the topic. MQTT will build the underlying network transmission, which will establish a connection from the client to the server and provide an ordered, lossless, byte-stream-based bidirectional transmission between the two. When data is sent through the MQTT network, MQTT will associate the related quality of service (QoS) with the topic (Topic).
物联网和边缘计算带来了一系列挑战。网络拓扑结构具有高度的动态性,且容易受到大量的干扰。客户端移动性和动态资源可用性是边缘计算体系结构面临的突出挑战。The Internet of Things and edge computing present its own set of challenges. Network topologies are highly dynamic and susceptible to numerous disturbances. Client mobility and dynamic resource availability are prominent challenges for edge computing architectures.
发明内容Contents of the invention
有鉴于此,本发明实施例一方面提出了MQTT网络接入方法,另一方面提出了MQTT控制器、网关及可读存储介质、电子设备及计算机程序产品,以提高MQTT网络的QOS。In view of this, the embodiment of the present invention proposes an MQTT network access method on the one hand, and proposes an MQTT controller, a gateway and a readable storage medium, electronic equipment and computer program products on the other hand, so as to improve the QOS of the MQTT network.
第一方面,提供一种消息队列遥测传输MQTT网络接入方法,包括:In the first aspect, an MQTT network access method for message queue telemetry transmission is provided, including:
MQTT网络中的控制器向第一客户端接入的第一网关发送携带身份标识ID的服务质量QOS请求,所述QOS请求用于:第一网关向MQTT网络中的所有代理服务器广播携 带所述身份ID的PING请求,并根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟,并将第一网关与各代理服务器之间的传输延迟发送给控制器;The controller in the MQTT network sends a quality of service QOS request carrying the identity ID to the first gateway accessed by the first client, and the QOS request is used for: the first gateway broadcasts to all proxy servers in the MQTT network carrying the the PING request of the identity ID, and according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, respectively calculate the transmission delay between the first gateway and each proxy server, and sending the transmission delay between the first gateway and each proxy server to the controller;
控制器接收第一网关发来的第一网关与各代理服务器之间的传输延迟,在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟;The controller receives the transmission delay between the first gateway and each proxy server sent by the first gateway, and selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server;
控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关,所述代理服务器接入消息用于:第一网关与第一代理服务器建立连接。The controller uses the first proxy server corresponding to the minimum transmission delay as the access proxy server of the first gateway, carries the address of the first proxy server in the proxy server access message and returns it to the first gateway, and the proxy server access The message is used for: the first gateway establishes a connection with the first proxy server.
第二方面,提供一种消息队列遥测传输MQTT网络接入方法,包括:In the second aspect, a message queue telemetry transmission MQTT network access method is provided, including:
MQTT网络中的第一客户端接入的第一网关接收控制器发来的携带身份标识ID的服务质量QOS请求;The first gateway accessed by the first client in the MQTT network receives the quality of service QOS request carrying the identity ID sent by the controller;
第一网关向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求;The first gateway broadcasts the PING request carrying the ID to all proxy servers in the MQTT network;
第一网关根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟;The first gateway calculates the transmission delay between the first gateway and each proxy server respectively according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request;
第一网关将第一网关与各代理服务器之间的传输延迟发送给控制器,所述第一网关与各代理服务器之间的传输延迟用于:控制器在所述第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟,并将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关;The first gateway sends the transmission delay between the first gateway and each proxy server to the controller, and the transmission delay between the first gateway and each proxy server is used for: the controller communicates between the first gateway and each proxy server Select the smallest transmission delay among the transmission delays between them, and use the first proxy server corresponding to the smallest transmission delay as the access proxy server of the first gateway, and return the address of the first proxy server in the proxy server access message to the first gateway;
第一网关接收控制器发来的携带第一代理服务器的地址的代理服务器接入消息,与第一代理服务器建立连接。The first gateway receives the proxy server access message carrying the address of the first proxy server sent by the controller, and establishes a connection with the first proxy server.
第三方面,提供一种消息队列遥测传输MQTT控制器,包括用于执行第一方面提供方法的模块;In a third aspect, an MQTT controller for message queue telemetry transmission is provided, including a module for executing the method provided in the first aspect;
第四方面,提供一种消息队列遥测传输MQTT网关,包括用于执行第二方面提供方法的模块;In a fourth aspect, a message queue telemetry transmission MQTT gateway is provided, including a module for performing the method provided in the second aspect;
第五方面,提供一种消息队列遥测传输MQTT网络接入系统,包括第三方面提供的MQTT控制器和第四方面提供的MQTT网关;The fifth aspect provides a message queue telemetry transmission MQTT network access system, including the MQTT controller provided by the third aspect and the MQTT gateway provided by the fourth aspect;
第六方面,提供一种非瞬时计算机可读存储介质,所述非瞬时计算机可读存储介质存储指令,所述指令在由处理器执行时使得所述处理器执行如第一方面或第二方面所述的 消息队列遥测传输MQTT网络接入方法的步骤。In a sixth aspect, there is provided a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores instructions, and when executed by a processor, the instructions cause the processor to perform the process described in the first aspect or the second aspect. The steps of the message queue telemetry transmission MQTT network access method.
第七方面,提供一种电子设备,包括:存储器和处理器,所述存储器存储指令,所述指令在由处理器执行时使得所述处理器执行如第一方面或第二方面所述的消息队列遥测传输MQTT网络接入方法的步骤。In a seventh aspect, an electronic device is provided, including: a memory and a processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the message described in the first aspect or the second aspect The steps of the queue telemetry transmission MQTT network access method.
第八方面,提供一种计算机程序产品,包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如第一方面或第二方面所述的消息队列遥测传输MQTT网络接入方法的步骤。In the eighth aspect, a computer program product is provided, including computer programs or instructions. When the computer program or instructions are executed by a processor, the steps of the message queue telemetry transmission MQTT network access method as described in the first aspect or the second aspect are implemented. .
上述实施例中,控制器通过QOS请求触发第一网关测量第一网关与各代理服务器之间的传输延迟,并在其中选择最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,从而使得:网关能够与传输延迟最小的代理服务器建立连接,从而保证了后续的消息发布和订阅的速度,提高了MQTT网络的QOS。In the above embodiment, the controller triggers the first gateway to measure the transmission delay between the first gateway and each proxy server through the QOS request, and selects the first proxy server corresponding to the minimum transmission delay as the access proxy of the first gateway Server, so that: the gateway can establish a connection with the proxy server with the smallest transmission delay, thereby ensuring the speed of subsequent message publishing and subscription, and improving the QOS of the MQTT network.
可选地,控制器将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关之后,进一步包括:Optionally, after the controller carries the address of the first proxy server in the proxy server access message and returns it to the first gateway, the controller further includes:
控制器接收第一代理服务器转发来的第一客户端针对第一主题的订阅请求;The controller receives the first client's subscription request for the first topic forwarded by the first proxy server;
控制器建立桥接表项,该桥接表项包含:The controller establishes a bridging entry, and the bridging entry includes:
用于指示第一代理服务器为目标代理服务器的信息,information indicating that the first proxy server is the target proxy server,
用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器都为桥接代理服务器的信息,以及,Information for indicating that all proxy servers except the first proxy server in the MQTT network are bridge proxy servers, and,
用于指示第一主题为共享主题的信息;information indicating that the first subject is a shared subject;
控制器将所述桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器,所述桥接表项用于:The controller sends the bridging entry to all other proxy servers except the first proxy server in the MQTT network, and the bridging entry is used for:
当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发所述第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将所述第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself bridging table entry, and forward the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
上述实施例中,控制器通过建立桥接表项,在不同代理服务器之间建立了桥接,从而使得一个代理服务器接收到一客户端发来的第一主题消息时,能够根据桥接表项得知 哪些代理服务器接入了订阅第一主题的客户端,从而将第一主题消息转发给这些代理服务器,由这些代理服务器将第一主题消息转发给订阅第一主题的客户端。可选地,控制器接收第二代理服务器发来的接入请求,建立桥接表项,该桥接表项包含:In the above embodiment, the controller establishes bridges between different proxy servers by establishing bridging entries, so that when a proxy server receives the first topic message sent by a client, it can know which The proxy server accesses the clients subscribing to the first topic, so as to forward the first topic message to these proxy servers, and these proxy servers forward the first topic message to the clients subscribing to the first topic. Optionally, the controller receives the access request sent by the second proxy server, and establishes a bridging entry, where the bridging entry includes:
用于指示第二代理服务器为目标代理服务器的信息,information indicating that the second proxy server is the target proxy server,
用于指示MQTT网络中除第二代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及,Information for indicating that all proxy servers in the MQTT network except the second proxy server are bridge proxy servers, and,
用于指示所有主题为共享主题的信息;information indicating that all topics are shared topics;
控制器将该桥接表项发送给MQTT网络中除第二代理服务器外的其他所有代理服务器。The controller sends the bridging entry to all proxy servers in the MQTT network except the second proxy server.
上述实施例中,当第二代理服务器新接入MQTT网络时,若有客户端新迁入第二代理服务器,能够保证该客户端订阅的主题消息都会接收到。In the above embodiment, when the second proxy server newly accesses the MQTT network, if a client newly migrates to the second proxy server, it can be ensured that all topic messages subscribed by the client will be received.
可选地,所述控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求,包括:Optionally, the controller sends a QOS request carrying an ID to the first gateway accessed by the first client, including:
控制器每隔预设第二时间间隔,分别为MQTT网络中的每个客户端的网关生成一个身份ID,并向每个客户端的网关分别发送携带为该网关生成的身份ID的QOS请求消息,所述每个客户端包含第一MQTT客户端。The controller generates an identity ID for the gateway of each client in the MQTT network at every preset second time interval, and sends a QOS request message carrying the identity ID generated for the gateway to the gateway of each client, so Each client described above comprises a first MQTT client.
上述实施例中,控制器周期性地通知每个客户端的网关测量其与各个代理服务器之间的传输延迟,并为各个网关选择最小的传输延迟对应的代理服务器作为最新的代理服务器,然后通知各个网关与该最新的代理服务器建立连接,从而,各个网关就从当前代理服务器迁移到了最新的代理服务器上了,从而保证了网关总是能与传输延迟最小的代理服务器建立连接,从而保证了消息发布和订阅的速度总是最高,提高了MQTT网络的QOS。In the above embodiment, the controller periodically notifies the gateway of each client to measure the transmission delay between it and each proxy server, and selects the proxy server corresponding to the minimum transmission delay for each gateway as the latest proxy server, and then notifies each client The gateway establishes a connection with the latest proxy server, so that each gateway is migrated from the current proxy server to the latest proxy server, thereby ensuring that the gateway can always establish a connection with the proxy server with the smallest transmission delay, thereby ensuring message publishing And the speed of subscription is always the highest, improving the QOS of the MQTT network.
可选地,所述控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求之前,进一步包括:Optionally, before the controller sends the QOS request carrying the identity ID to the first gateway accessed by the first client, the controller further includes:
控制器接收第一网关发来的代理服务器分配请求,为第一网关分配身份ID;所述代理服务器分配请求为:第一网关接收到第一客户端发来的接入请求后发出的。The controller receives the proxy server assignment request sent by the first gateway, and assigns an ID to the first gateway; the proxy server assignment request is sent by the first gateway after receiving the access request sent by the first client.
上述实施例在客户端初始接入MQTT网络时,就为客户端的网关选择传输延迟最小的代理服务器进行接入,从而保证MQTT网络的QOS始终最优。In the above embodiments, when the client initially accesses the MQTT network, the gateway of the client selects the proxy server with the smallest transmission delay for access, thereby ensuring that the QOS of the MQTT network is always optimal.
可选地,所述控制器在第一网关与各代理服务器之间的传输延迟中选择最小的传输 延迟之后、所述控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器之前,进一步包括:Optionally, after the controller selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server, the controller uses the first proxy server corresponding to the minimum transmission delay as the first gateway Before entering the proxy server, further include:
控制器查询第一网关与第一网关当前接入的第三代理服务器之间的传输延迟,判断查询到的传输延迟与所述最小的传输延迟之间的差值是否在预设范围内,若是,则确定第一网关无需切换接入代理服务器,否则,执行所述将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器的动作。The controller queries the transmission delay between the first gateway and the third proxy server currently accessed by the first gateway, and determines whether the difference between the queried transmission delay and the minimum transmission delay is within a preset range, and if so , it is determined that the first gateway does not need to switch the access proxy server; otherwise, perform the action of using the first proxy server corresponding to the smallest transmission delay as the access proxy server of the first gateway.
上述实施例,避免了网关频繁地进行代理服务器的迁移,在资源消耗和网络QOS之间取得了均衡。The above-mentioned embodiment avoids frequent migration of the proxy server by the gateway, and achieves a balance between resource consumption and network QOS.
可选地,所述第一网关向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求,包括:Optionally, the first gateway broadcasts the PING request carrying the identity ID to all proxy servers in the MQTT network, including:
第一网关每隔预设第一时间间隔向MQTT网络中的所有代理服务器广播一次携带所述身份ID的PING请求,直至广播次数达到预设次数;The first gateway broadcasts a PING request carrying the identity ID to all proxy servers in the MQTT network every preset first time interval until the number of broadcasts reaches the preset number of times;
且,所述第一网关分别计算第一网关与各代理服务器之间的传输延迟包括:And, the first gateway separately calculating the transmission delay between the first gateway and each proxy server includes:
第一网关根据每次发送的PING请求的发送时间戳和各代理服务器每次返回的PING响应的时间戳,分别计算第一网关与各代理服务器之间的平均传输延迟。The first gateway respectively calculates the average transmission delay between the first gateway and each proxy server according to the sending timestamp of each sent PING request and the timestamp of each returned PING response by each proxy server.
上述实施例,第一网关通过多次广播携带所述身份ID的PING请求,并根据每次发送的PING请求的发送时间戳和各代理服务器每次返回的PING响应的时间戳,分别计算第一网关与各代理服务器之间的平均传输延迟,从而提高了计算得到的第一网关与各代理服务器之间的平均传输延迟的可靠性,进而保证了MQTT网络的QOS。In the above embodiment, the first gateway broadcasts the PING request carrying the ID multiple times, and calculates the first PING request according to the sending timestamp of the PING request sent each time and the timestamp of the PING response returned by each proxy server. The average transmission delay between the gateway and each proxy server improves the reliability of the calculated average transmission delay between the first gateway and each proxy server, thereby ensuring the QOS of the MQTT network.
附图说明Description of drawings
下面将通过参照附图详细描述本发明的优选实施例,使本领域的普通技术人员更清楚本发明的上述及其它特征和优点,附图中:Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, so that those of ordinary skill in the art will be more aware of the above-mentioned and other features and advantages of the present invention. In the accompanying drawings:
图1为本发明中MQTT网络的架构示意图;Fig. 1 is the structural representation of MQTT network among the present invention;
图2为本发明第一实施例提供的MQTT网络接入方法流程图;Fig. 2 is the flowchart of the MQTT network access method provided by the first embodiment of the present invention;
图3为本发明第二实施例提供的MQTT网络接入方法流程图;FIG. 3 is a flow chart of the MQTT network access method provided by the second embodiment of the present invention;
图4为本发明第三实施例提供的MQTT网络接入方法流程图;FIG. 4 is a flow chart of the MQTT network access method provided by the third embodiment of the present invention;
图5为本发明第四实施例提供的MQTT网络接入方法流程图;FIG. 5 is a flow chart of the MQTT network access method provided by the fourth embodiment of the present invention;
图6为本发明实施例提供的MQTT控制器的结构示意图;FIG. 6 is a schematic structural diagram of an MQTT controller provided by an embodiment of the present invention;
图7为本发明实施例提供的MQTT网关的结构示意图;FIG. 7 is a schematic structural diagram of an MQTT gateway provided by an embodiment of the present invention;
图8为本发明实施例提供的电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
其中,附图标记如下:Wherein, the reference signs are as follows:
标号label 含义meaning
1111 客户端 client
1212 网关 gateway
1313 代理服务器 proxy server
1414 控制器 controller
201~203201~203 步骤 step
301~306301~306 步骤 step
401~405401~405 步骤 step
501~506501~506 步骤 step
6060 MQTT控制器 MQTT controller
6161 QOS检测触发模块QOS detection trigger module
6262 代理服务器选择模块Proxy server selection module
6363 桥接表项维护模块Bridge entry maintenance module
7070 MQTT网关 MQTT gateway
7171 QOS消息收发模块 QOS messaging module
7272 传输延迟计算模块Transmission Delay Calculation Module
8181 处理器 processor
8282 存储器 memory
8383 电源power supply
8484 输入输出单元I/O unit
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,以下举实施例对本发明进一步详细说明。In order to make the purpose, technical solution and advantages of the present invention clearer, the following examples are given to further describe the present invention in detail.
现有的MQTT网络中,当客户端与一个代理服务器建立连接后,之后客户端将始终 通过该代理服务器进行消息的发布和订阅。发明人经过对MQTT网络的监测发现:由于种种原因如:网络传输拥堵、代理服务器自身负载加重等,代理服务器与客户端之间的传输延迟会发生变化,此时若仍然保持客户端与代理服务器之间的固定连接不变,则会导致MQTT网络的消息发布和订阅效率下降。因此,发明人提出了本发明实施例,以在传输延迟发生变化时,提高MQTT网络的QOS。In the existing MQTT network, after the client establishes a connection with a proxy server, the client will always publish and subscribe messages through the proxy server. The inventor found through the monitoring of the MQTT network: due to various reasons such as: network transmission congestion, the load of the proxy server itself increases, etc., the transmission delay between the proxy server and the client will change. If the fixed connection between them remains unchanged, the efficiency of message publishing and subscription in the MQTT network will decrease. Therefore, the inventor proposes an embodiment of the present invention to improve the QOS of the MQTT network when the transmission delay changes.
图1为本发明中MQTT网络的架构示意图,MQTT网络主要包括四个组成部分:Fig. 1 is the architectural diagram of MQTT network among the present invention, and MQTT network mainly comprises four components:
一、客户端11:可以作为消息的发布者或/和订阅者;1. Client 11: can be a publisher or/and subscriber of a message;
二、网关12:与客户端11一一绑定,一个客户端11唯一地绑定到一个网关12;用于将一个客户端11动态连接到一个代理服务器13;2. Gateway 12: one-to-one binding with clients 11, one client 11 is uniquely bound to one gateway 12; used to dynamically connect a client 11 to a proxy server 13;
三、代理服务器13:用于作为发布者和订阅者之间的桥梁,将发布者发来的主题消息发布给订阅者;3. Proxy server 13: used as a bridge between the publisher and the subscriber, and publishes the topic message sent by the publisher to the subscriber;
四、控制器14:用于维护和管理客户端11、网关12、代理服务器13的连接状态和连接关系。4. Controller 14: for maintaining and managing the connection status and connection relationship of the client 11, the gateway 12, and the proxy server 13.
图2为本发明第一实施例提供的MQTT网络接入方法流程图,其具体步骤如下:Fig. 2 is the flow chart of the MQTT network access method provided by the first embodiment of the present invention, and its specific steps are as follows:
步骤201:MQTT网络中的控制器向第一客户端接入的第一网关发送携带身份ID(标识)的QOS请求,该QOS请求用于:第一网关向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求,并根据各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟,并将第一网关与各代理服务器之间的传输延迟发送给控制器。Step 201: The controller in the MQTT network sends a QOS request carrying an identity ID (identification) to the first gateway accessed by the first client, and the QOS request is used for: the first gateway broadcasts the carrying ID to all proxy servers in the MQTT network. The PING request of the identity ID, and according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, respectively calculate the transmission delay between the first gateway and each proxy server, and The transmission delay between the first gateway and each proxy server is sent to the controller.
步骤202:控制器接收第一网关发来的第一网关与各代理服务器之间的传输延迟,在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟。Step 202: The controller receives the transmission delay between the first gateway and each proxy server sent by the first gateway, and selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server.
步骤203:控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关,该代理服务器接入消息用于:第一网关与第一代理服务器建立连接。Step 203: The controller uses the first proxy server corresponding to the minimum transmission delay as the access proxy server of the first gateway, carries the address of the first proxy server in the proxy server access message and returns it to the first gateway, and the proxy server The access message is used for: the first gateway establishes a connection with the first proxy server.
上述实施例的有益技术效果如下:The beneficial technical effect of above-mentioned embodiment is as follows:
一、控制器通过QOS请求触发第一网关测量第一网关与各代理服务器之间的传输延迟,并在其中选择最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务 器,从而使得:网关能够与传输延迟最小的代理服务器建立连接,从而保证了后续的消息发布和订阅的速度,提高了MQTT网络的QOS。1. The controller triggers the first gateway to measure the transmission delay between the first gateway and each proxy server through the QOS request, and selects the first proxy server corresponding to the minimum transmission delay as the access proxy server of the first gateway, thereby This enables the gateway to establish a connection with the proxy server with the smallest transmission delay, thereby ensuring the speed of subsequent message publishing and subscription, and improving the QOS of the MQTT network.
图3为本发明第二实施例提供的MQTT网络接入方法流程图,其具体步骤如下:Fig. 3 is the flow chart of the MQTT network access method provided by the second embodiment of the present invention, and its specific steps are as follows:
步骤301:MQTT网络中的控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求,该QOS请求用于:第一网关向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求,并根据各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟,并将第一网关与各代理服务器之间的传输延迟发送给控制器。Step 301: The controller in the MQTT network sends a QOS request carrying the identity ID to the first gateway accessed by the first client, and the QOS request is used for: the first gateway broadcasts the identity ID to all proxy servers in the MQTT network PING request, and according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, respectively calculate the transmission delay between the first gateway and each proxy server, and calculate the first The transmission delay between the gateway and each proxy server is sent to the controller.
步骤302:控制器接收第一网关发来的第一网关与各代理服务器之间的传输延迟,在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟。Step 302: The controller receives the transmission delay between the first gateway and each proxy server sent by the first gateway, and selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server.
步骤303:控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关,该代理服务器接入消息用于:第一网关与第一代理服务器建立连接。Step 303: The controller uses the first proxy server corresponding to the smallest transmission delay as the access proxy server of the first gateway, carries the address of the first proxy server in the proxy server access message and returns it to the first gateway, and the proxy server The access message is used for: the first gateway establishes a connection with the first proxy server.
步骤304:控制器接收第一代理服务器转发来的第一客户端针对第一主题的订阅请求。Step 304: The controller receives the first client's subscription request for the first topic forwarded by the first proxy server.
步骤305:控制器建立桥接表项,该桥接表项包含:用于指示第一代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示第一主题为共享主题的信息。Step 305: The controller establishes a bridging entry, the bridging entry includes: information indicating that the first proxy server is the target proxy server, and is used to indicate that all other proxy servers in the MQTT network except the first proxy server are bridging proxies The information of the server, and the information used to indicate that the first topic is a shared topic.
步骤306:控制器将该桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器,该桥接表项用于:当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发该第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将该第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。Step 306: The controller sends the bridging entry to all other proxy servers except the first proxy server in the MQTT network, and the bridging entry is used for: when any other proxy server in the MQTT network except the first proxy server When receiving the first topic message from any MQTT client connected to the proxy server, search for the MQTT client that has subscribed to the first topic in the subscription table of each MQTT client connected to the proxy server maintained by itself , forwarding the first topic message to each of the found MQTT clients, and at the same time, searching for a bridging entry whose shared topic is the first topic in the bridge entries maintained by itself, and forwarding the first topic message to each of the found The target proxy server in the bridging entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
上述实施例与第一实施例相比,进一步具有如下有益技术效果:Compared with the first embodiment, the above embodiment further has the following beneficial technical effects:
二、控制器通过建立桥接表项,在不同代理服务器之间建立了桥接,从而使得一个代理服务器接收到一客户端发来的第一主题消息时,能够根据桥接表项得知哪些代理服 务器接入了订阅第一主题的客户端,从而将第一主题消息转发给这些代理服务器,由这些代理服务器将第一主题消息转发给订阅第一主题的客户端。2. The controller establishes a bridge between different proxy servers by establishing a bridging table entry, so that when a proxy server receives the first topic message sent by a client, it can know which proxy servers to accept according to the bridging table entry. Clients subscribed to the first topic are entered, so that the first topic message is forwarded to these proxy servers, and these proxy servers forward the first topic message to the clients subscribing to the first topic.
在实际应用中,当有一个代理服务器新接入MQTT网络时,为了避免有客户端新迁入该代理服务器,从而向该客户端漏发其订阅的主题消息的情形的发生,本发明实施例给出如下解决方案:In practical applications, when a proxy server is newly connected to the MQTT network, in order to avoid the situation that a client newly migrates into the proxy server, thereby missing the topic message subscribed to the client, the embodiment of the present invention Given the following solution:
一可选实施例中,控制器接收第二代理服务器发来的接入请求,建立桥接表项,该桥接表项包含:用于指示第二代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第二代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示所有主题为共享主题的信息,将该桥接表项发送给MQTT网络中除第二代理服务器外的其他所有代理服务器。In an optional embodiment, the controller receives the access request sent by the second proxy server, and establishes a bridging entry, where the bridging entry includes: information for indicating that the second proxy server is the target proxy server, and for indicating that the MQTT Information that all proxy servers in the network except the second proxy server are bridge proxy servers, and information indicating that all topics are shared topics, and send the bridging entry to other proxy servers in the MQTT network except the second proxy server All proxy servers.
通过该实施例,当MQTT网络中除第二代理服务器外的其他任一代理服务器接收到本代理服务器下挂的客户端发来的任一主题的消息时,根据自身维护的桥接表项,都会查找到该主题的目标代理服务器有第二代理服务器,从而将该主题消息发送给第二代理服务器,第二代理服务器再将该主题消息发送给自身下挂的订阅了该主题的客户端,从而在有客户端新迁入第二代理服务器时,能够保证该客户端能够接收到其订阅的所有主题的消息。Through this embodiment, when any other proxy server in the MQTT network except the second proxy server receives a message of any topic sent by the client connected to the proxy server, according to the bridging entry maintained by itself, it will The target proxy server that finds this topic has a second proxy server, thereby sending the topic message to the second proxy server, and the second proxy server sends the topic message to the client that has subscribed to the topic under itself, thereby When a client newly migrates to the second proxy server, it can be guaranteed that the client can receive messages of all topics it subscribes to.
为了使得在网络状况发生变化时,能够及时更新客户端的网关与代理服务器之间的连接关系,使得客户端的网关总是能够连接到与其之间的传输延迟最小的代理服务器,本发明实施例给出如下解决方案:In order to update the connection relationship between the gateway of the client and the proxy server in time when the network conditions change, so that the gateway of the client can always be connected to the proxy server with the smallest transmission delay between them, the embodiment of the present invention provides The solution is as follows:
步骤201中,控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求,包括:控制器每隔预设第二时间间隔,分别为MQTT网络中的每个客户端的网关生成一个身份的ID,并向每个客户端的网关分别发送携带为该网关生成的身份ID的QOS请求消息,其中,每个客户端包含第一MQTT客户端。In step 201, the controller sends a QOS request carrying an ID to the first gateway accessed by the first client, including: the controller generates a QOS request for each client gateway in the MQTT network at a preset second time interval. ID of an identity, and send a QOS request message carrying the identity ID generated for the gateway to the gateway of each client, wherein each client includes the first MQTT client.
上述实施例中,控制器周期性地通知每个客户端的网关测量其与各个代理服务器之间的传输延迟,并为各个网关选择最小的传输延迟对应的代理服务器作为最新的代理服务器,然后通知各个网关与该最新的代理服务器建立连接,从而,各个网关就从当前代理服务器迁移到了最新的代理服务器上了,从而保证了网关总是能与传输延迟最小的代理服务器建立连接,从而保证了消息发布和订阅的速度总是最高,提高了MQTT网络的 QOS。In the above embodiment, the controller periodically notifies the gateway of each client to measure the transmission delay between it and each proxy server, and selects the proxy server corresponding to the minimum transmission delay for each gateway as the latest proxy server, and then notifies each client The gateway establishes a connection with the latest proxy server, so that each gateway is migrated from the current proxy server to the latest proxy server, thereby ensuring that the gateway can always establish a connection with the proxy server with the smallest transmission delay, thereby ensuring message publishing And the speed of subscription is always the highest, improving the QOS of the MQTT network.
另外,为了保证MQTT网络的QOS始终最优,在客户端初始接入MQTT网络时,就为客户端的网关选择传输延迟最小的代理服务器进行接入,本发明实施例给出的具体实现如下:In addition, in order to ensure that the QOS of the MQTT network is always optimal, when the client initially accesses the MQTT network, the proxy server with the smallest transmission delay is selected for the gateway of the client to access. The specific implementation given by the embodiment of the present invention is as follows:
步骤201中,控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求之前,进一步包括:控制器接收第一网关发来的代理服务器分配请求,为第一网关分配身份ID;该代理服务器分配请求为:第一网关接收到第一客户端发来的接入请求后发出的。In step 201, before the controller sends the QOS request carrying the identity ID to the first gateway accessed by the first client, the controller further includes: the controller receives the proxy server assignment request sent by the first gateway, and assigns the identity ID to the first gateway ; The proxy server allocation request is sent by the first gateway after receiving the access request from the first client.
考虑到:频繁地进行代理服务器的迁移,也会消耗网关和代理服务器的资源,为了在资源消耗和网络QOS之间取得均衡,本发明实施例给出如下具体实现:Considering that frequent proxy server migration will also consume the resources of the gateway and proxy server, in order to achieve a balance between resource consumption and network QOS, the embodiment of the present invention provides the following specific implementation:
一可选实施例中,步骤202之后、步骤203之前,进一步包括:控制器查询第一网关与第一网关当前接入的第三代理服务器之间的传输延迟,判断查询到的传输延迟与该最小的传输延迟之间的差值是否在预设范围内,若是,则确定第一网关无需切换接入代理服务器,否则,执行该将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器的动作。In an optional embodiment, after step 202 and before step 203, it further includes: the controller inquires about the transmission delay between the first gateway and the third proxy server currently connected to the first gateway, and determines whether the queried transmission delay is consistent with the Whether the difference between the minimum transmission delays is within the preset range, if so, then determine that the first gateway does not need to switch the access proxy server, otherwise, perform the process of using the first proxy server corresponding to the minimum transmission delay as the first gateway Access to the action of the proxy server.
图4为本发明第三实施例提供的MQTT网络接入方法流程图,其具体步骤如下:Fig. 4 is the flow chart of the MQTT network access method provided by the third embodiment of the present invention, and its specific steps are as follows:
步骤401:MQTT网络中的第一客户端接入的第一网关接收控制器发来的携带身份ID的QOS请求。Step 401: The first gateway accessed by the first client in the MQTT network receives the QOS request carrying the ID from the controller.
步骤402:第一网关向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求。Step 402: The first gateway broadcasts a PING request carrying the ID to all proxy servers in the MQTT network.
步骤403:第一网关根据各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟。Step 403: The first gateway respectively calculates the transmission delay between the first gateway and each proxy server according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request.
步骤404:第一网关将第一网关与各代理服务器之间的传输延迟发送给控制器,以使得:控制器在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟,并将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关。Step 404: The first gateway sends the transmission delay between the first gateway and each proxy server to the controller, so that: the controller selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server, and The first proxy server corresponding to the smallest transmission delay is used as the access proxy server of the first gateway, and the address of the first proxy server is carried in the proxy server access message and returned to the first gateway.
步骤405:第一网关接收控制器发来的携带第一代理服务器的地址的代理服务器接 入消息,与第一代理服务器建立连接。Step 405: The first gateway receives the proxy server access message carrying the address of the first proxy server sent by the controller, and establishes a connection with the first proxy server.
图5为本发明第四实施例提供的MQTT网络接入方法流程图,其具体步骤如下:FIG. 5 is a flow chart of the MQTT network access method provided by the fourth embodiment of the present invention, and its specific steps are as follows:
步骤501:MQTT网络中的第一客户端接入的第一网关接收控制器发来的携带身份ID的QOS请求。Step 501: The first gateway accessed by the first client in the MQTT network receives the QOS request carrying the ID from the controller.
在实际应用中,在两种情况下,MQTT网络中的第一客户端接入的第一网关会接收到控制器发来的携带身份ID的QOS请求:In practical applications, in two cases, the first gateway accessed by the first client in the MQTT network will receive the QOS request carrying the ID from the controller:
一、第一网关接收第一客户端发来的接入请求,向控制器发送代理服务器分配请求,控制器接收到该代理服务器分配请求,为第一网关生成身份的ID,向第一网关发送携带身份ID的QOS请求;1. The first gateway receives the access request from the first client, and sends a proxy server allocation request to the controller. The controller receives the proxy server allocation request, generates an ID for the first gateway, and sends it to the first gateway. QOS request with identity ID;
二、控制器周期性地为MQTT网络中的每个网关分别生成一个唯一的身份ID,将为每个网关生成的身份ID携带在发送给对应网关的QOS请求中,将各QOS请求发送出去。2. The controller periodically generates a unique ID for each gateway in the MQTT network, carries the ID generated for each gateway in the QOS request sent to the corresponding gateway, and sends each QOS request.
步骤502:第一网关向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求。Step 502: The first gateway broadcasts a PING request carrying the ID to all proxy servers in the MQTT network.
步骤503:第一网关根据各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟。Step 503: The first gateway respectively calculates the transmission delay between the first gateway and each proxy server according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request.
步骤504:第一网关将第一网关与各代理服务器之间的传输延迟发送给控制器,以使得:控制器在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟,并将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关。Step 504: The first gateway sends the transmission delay between the first gateway and each proxy server to the controller, so that: the controller selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server, and The first proxy server corresponding to the smallest transmission delay is used as the access proxy server of the first gateway, and the address of the first proxy server is carried in the proxy server access message and returned to the first gateway.
在实际应用中,为了提高传输延迟的准确性,第一网关可以每隔预设第一时间间隔向MQTT网络中的所有代理服务器广播一次携带身份ID的PING请求,直至广播次数达到预设次数;且,第一网关根据每次发送的PING请求的发送时间戳和各代理服务器每次返回的PING响应的时间戳,分别计算第一网关与各代理服务器之间的平均传输延迟。In practical applications, in order to improve the accuracy of the transmission delay, the first gateway may broadcast a PING request carrying an ID to all proxy servers in the MQTT network every preset first time interval until the number of broadcasts reaches the preset number of times; Moreover, the first gateway respectively calculates the average transmission delay between the first gateway and each proxy server according to the sending timestamp of the PING request sent each time and the timestamp of the PING response returned by each proxy server.
步骤505:第一网关接收控制器发来的携带第一代理服务器的地址的代理服务器接入消息,与第一代理服务器建立连接。Step 505: The first gateway receives the proxy server access message carrying the address of the first proxy server sent by the controller, and establishes a connection with the first proxy server.
步骤506:第一网关接收第一客户端发来的针对第一主题的订阅请求,将该订阅请求经由第一代理服务器转发给该MQTT控制器;该订阅请求用于:Step 506: The first gateway receives the subscription request for the first topic sent by the first client, and forwards the subscription request to the MQTT controller via the first proxy server; the subscription request is used for:
MQTT控制器根据该订阅请求,建立桥接表项,该桥接表项包含:用于指示第一代 理服务器为目标代理服务器的信息,用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示第一主题为共享主题的信息;且,MQTT控制器将该桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器;且,The MQTT controller establishes a bridging entry according to the subscription request, and the bridging entry includes: information for indicating that the first proxy server is the target proxy server, and for indicating all other proxy servers in the MQTT network except the first proxy server It is the information of the bridge proxy server, and the information used to indicate that the first topic is a shared topic; and, the MQTT controller sends the bridging entry to all other proxy servers in the MQTT network except the first proxy server; and,
当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发该第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将该第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself The bridging table entry forwards the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
图6为本发明实施例提供的MQTT控制器60的结构示意图,该控制器主要包括:FIG. 6 is a schematic structural diagram of an MQTT controller 60 provided by an embodiment of the present invention. The controller mainly includes:
QOS检测触发模块61,用于向第一客户端接入的第一网关发送携带身份ID的QOS请求,该QOS请求用于:第一网关向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求,并根据各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟,并将第一网关与各代理服务器之间的传输延迟发送给控制器。The QOS detection trigger module 61 is configured to send a QOS request carrying an ID to the first gateway accessed by the first client, and the QOS request is used for: the first gateway broadcasts a QOS request carrying the ID to all proxy servers in the MQTT network. PING request, and according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, respectively calculate the transmission delay between the first gateway and each proxy server, and send the first gateway Transmission delays to and from each proxy server are sent to the controller.
代理服务器选择模块62,用于接收第一网关发来的第一网关与各代理服务器之间的传输延迟,在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟;将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关,该代理服务器接入消息用于:第一网关与第一代理服务器建立连接。Proxy server selection module 62 is used to receive the transmission delay between the first gateway and each proxy server sent by the first gateway, and select the minimum transmission delay in the transmission delay between the first gateway and each proxy server; The first proxy server corresponding to the transmission delay is used as the access proxy server of the first gateway, and returns the address of the first proxy server in the proxy server access message to the first gateway. The proxy server access message is used for: A gateway establishes a connection with the first proxy server.
一可选实施例中,控制器60进一步包括:桥接表项维护模块63,用于:接收第一代理服务器转发来的第一客户端针对第一主题的订阅请求;建立桥接表项,该桥接表项包含:用于指示第一代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示第一主题为共享主题的信息;将该桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器,该桥接表项用于:In an optional embodiment, the controller 60 further includes: a bridging entry maintenance module 63, configured to: receive the subscription request of the first client for the first topic forwarded by the first proxy server; establish a bridging entry, the bridging The entry includes: information for indicating that the first proxy server is the target proxy server, information for indicating that all other proxy servers in the MQTT network except the first proxy server are bridge proxy servers, and information for indicating that the first topic is Share topic information; send the bridging entry to all other proxy servers in the MQTT network except the first proxy server, and the bridging entry is used for:
当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务 器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发该第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将该第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself The bridging table entry forwards the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
一可选实施例中,桥接表项维护模块63进一步用于:接收第二代理服务器发来的接入请求,建立桥接表项,该桥接表项包含:用于指示第二代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第二代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示所有主题为共享主题的信息,将该桥接表项发送给MQTT网络中除第二代理服务器外的其他所有代理服务器。In an optional embodiment, the bridging entry maintenance module 63 is further configured to: receive an access request sent by the second proxy server, and establish a bridging entry, where the bridging entry includes: used to indicate that the second proxy server is the target proxy The information of the server is used to indicate that all other proxy servers in the MQTT network except the second proxy server are bridge proxy servers, and the information used to indicate that all topics are shared topics, and the bridge entry is sent to the MQTT network. All proxy servers except the second proxy server.
一可选实施例中,QOS检测触发模块61具体用于:每隔预设第二时间间隔,分别为MQTT网络中的每个客户端的网关生成一个身份ID,并向每个客户端的网关分别发送携带为该网关生成的身份ID的QOS请求消息,该每个客户端包含第一MQTT客户端。In an optional embodiment, the QOS detection trigger module 61 is specifically configured to: generate an identity ID for each client's gateway in the MQTT network at every preset second time interval, and send an identity ID to each client's gateway respectively The QOS request message carrying the identity ID generated for the gateway, each client includes the first MQTT client.
一可选实施例中,QOS检测触发模块61向第一客户端接入的第一网关发送携带身份ID的QOS请求之前,进一步用于,接收第一网关发来的代理服务器分配请求,为第一网关分配身份ID;该代理服务器分配请求为:第一网关接收到第一客户端发来的接入请求后发出的。In an optional embodiment, before the QOS detection triggering module 61 sends the QOS request carrying the identity ID to the first gateway accessed by the first client, it is further used to receive the proxy server assignment request sent by the first gateway, and provide A gateway assigns an ID; the request for assigning the proxy server is sent by the first gateway after receiving the access request from the first client.
一可选实施例中,代理服务器选择模块62在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟之后、该控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器之前,进一步用于:查询第一网关与第一网关当前接入的第三代理服务器之间的传输延迟,判断查询到的传输延迟与该最小的传输延迟之间的差值是否在预设范围内,若是,则确定第一网关无需切换接入代理服务器,否则,执行将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器的动作。In an optional embodiment, after the proxy server selection module 62 selects the minimum transmission delay among the transmission delays between the first gateway and each proxy server, the controller uses the first proxy server corresponding to the minimum transmission delay as the first proxy server. Before the access proxy server of the gateway, it is further used to: query the transmission delay between the first gateway and the third proxy server currently accessed by the first gateway, and determine the difference between the query transmission delay and the minimum transmission delay Whether the value is within the preset range, if so, determine that the first gateway does not need to switch the access proxy server, otherwise, perform the action of using the first proxy server corresponding to the minimum transmission delay as the access proxy server of the first gateway.
图7为本发明实施例提供的MQTT网关70的结构示意图,该网关包括:FIG. 7 is a schematic structural diagram of an MQTT gateway 70 provided by an embodiment of the present invention, and the gateway includes:
消息收发模块71,用于接收控制器发来的携带身份标识ID的服务质量QOS请求,向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求,并接收各代理服务器返回的携带该身份ID的PING响应。The message transceiver module 71 is used to receive the quality of service QOS request carrying the identity ID sent by the controller, broadcast the PING request carrying the identity ID to all proxy servers in the MQTT network, and receive the PING request carrying the identity returned by each proxy server. PING response for ID.
传输延迟计算模块72,用于根据消息收发模块71接收到的各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算该网关与各代理服务器之间的传输延迟,将该网关与各代理服务器之间的传输延迟发送给控制器,以使得:控制器在该网关与各代理服务器之间的传输延迟中选择最小的传输延迟,并将最小的传输延迟对应的第一代理服务器作为该网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给该网关,该代理服务器接入消息用于:该网关与第一代理服务器建立连接。The transmission delay calculation module 72 is used to calculate the distance between the gateway and each proxy server according to the receiving time stamp of the PING response carrying the identity ID returned by the message sending and receiving module 71 and the sending time stamp of the PING request. The transmission delay between the gateway and each proxy server is sent to the controller, so that: the controller selects the minimum transmission delay among the transmission delays between the gateway and each proxy server, and sends the minimum The first proxy server corresponding to the transmission delay acts as the access proxy server of the gateway, and returns the address of the first proxy server in the proxy server access message to the gateway, and the proxy server access message is used for: the gateway and the second proxy server A proxy server establishes the connection.
一可选实施例中,消息收发模块71进一步用于:接收第一客户端发来的针对第一主题的订阅请求,将该订阅请求经由第一代理服务器转发给该MQTT控制器;该订阅请求用于:In an optional embodiment, the messaging module 71 is further configured to: receive a subscription request for the first topic sent by the first client, and forward the subscription request to the MQTT controller via the first proxy server; the subscription request Used for:
该MQTT控制器接收该订阅请求,建立桥接表项,该桥接表项包含:用于指示第一代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示第一主题为共享主题的信息;且,该MQTT控制器将该桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器;且,The MQTT controller receives the subscription request, and establishes a bridging entry, which includes: information indicating that the first proxy server is the target proxy server, and used to indicate all other agents in the MQTT network except the first proxy server The information that the server is a bridging proxy server, and information indicating that the first topic is a shared topic; and, the MQTT controller sends the bridging entry to all other proxy servers in the MQTT network except the first proxy server; and ,
当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发该第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将该第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself The bridging table entry forwards the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
一可选实施例中,消息收发模块71接收控制器发来的携带身份ID的QOS请求之前,进一步包括:接收第一客户端发来的接入请求,向控制器发送代理服务器分配请求。In an optional embodiment, before the message transceiving module 71 receives the QOS request carrying the ID sent by the controller, it further includes: receiving an access request sent by the first client, and sending a proxy server allocation request to the controller.
一可选实施例中,消息收发模块71向MQTT网络中的所有代理服务器广播携带该 身份ID的PING请求,包括:每隔预设第一时间间隔向MQTT网络中的所有代理服务器广播一次携带该身份ID的PING请求,直至广播次数达到预设次数;In an optional embodiment, the message transceiver module 71 broadcasts the PING request carrying the identity ID to all proxy servers in the MQTT network, including: broadcasting the PING request carrying the ID to all proxy servers in the MQTT network every preset first time interval. PING request of the identity ID until the number of broadcasts reaches the preset number;
且,传输延迟计算模块72分别计算该网关与各代理服务器之间的传输延迟包括:根据每次发送的PING请求的发送时间戳和各代理服务器每次返回的PING响应的时间戳,分别计算该网关与各代理服务器之间的平均传输延迟。And, the transmission delay calculation module 72 respectively calculates the transmission delay between the gateway and each proxy server includes: according to the sending timestamp of the PING request sent each time and the timestamp of the PING response returned by each proxy server, respectively calculate the The average transfer delay between the gateway and each proxy server.
本发明实施例还公开了一种MQTT网络接入系统,该系统包括:一控制器、两个以上代理服务器、以及至少一个网关,且每个网关分别与至少一个客户端绑定,其中:The embodiment of the present invention also discloses an MQTT network access system, the system includes: a controller, more than two proxy servers, and at least one gateway, and each gateway is respectively bound to at least one client, wherein:
控制器,用于向至少一个网关发送携带身份ID的QOS请求;当接收到一网关发来的该网关与各代理服务器之间的传输延迟,在该网关与各代理服务器之间的传输延迟中选择最小的传输延迟,将最小的传输延迟对应的代理服务器作为该网关的接入代理服务器,将该接入代理服务器的地址携带在代理服务器接入消息中返回给该网关。The controller is configured to send a QOS request carrying an ID to at least one gateway; when receiving a transmission delay between the gateway and each proxy server sent by a gateway, the transmission delay between the gateway and each proxy server The smallest transmission delay is selected, and the proxy server corresponding to the smallest transmission delay is used as the access proxy server of the gateway, and the address of the access proxy server is carried in the proxy server access message and returned to the gateway.
网关,用于接收到控制器发来的QOS请求,向MQTT网络中的所有代理服务器广播携带该身份ID的PING请求,并根据各代理服务器返回的携带该身份ID的PING响应的接收时间戳和该PING请求的发送时间戳,分别计算本网关与各代理服务器之间的传输延迟,并将本网关与各代理服务器之间的传输延迟发送给控制器,接收控制器发来的代理服务器接入消息,根据该消息中的接入代理服务器的地址,与对应代理服务器建立连接。The gateway is used to receive the QOS request sent by the controller, broadcast the PING request carrying the identity ID to all proxy servers in the MQTT network, and according to the receiving timestamp and the PING response carrying the identity ID returned by each proxy server The transmission time stamp of the PING request, respectively calculate the transmission delay between the gateway and each proxy server, and send the transmission delay between the gateway and each proxy server to the controller, and receive the proxy server access information sent by the controller message, and establish a connection with the corresponding proxy server according to the address of the access proxy server in the message.
代理服务器,用于接收一网关发来的携带该身份ID的PING请求,向该网关返回携带该身份ID的PING响应。The proxy server is configured to receive a PING request carrying the identity ID sent by a gateway, and return a PING response carrying the identity ID to the gateway.
一可选实施例中,控制器进一步用于:接收第一代理服务器转发来的第一客户端针对第一主题的订阅请求;建立桥接表项,该桥接表项包含:用于指示第一代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示第一主题为共享主题的信息;将该桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器,该桥接表项用于:In an optional embodiment, the controller is further configured to: receive the first client's subscription request for the first topic forwarded by the first proxy server; establish a bridging entry, and the bridging entry includes: used to indicate the first proxy The information that the server is the target proxy server is used to indicate that all other proxy servers in the MQTT network except the first proxy server are bridge proxy servers, and the information used to indicate that the first topic is a shared topic; the bridge entry Sent to all other proxy servers except the first proxy server in the MQTT network, the bridging entry is used for:
当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发该第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题 的桥接表项,将该第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself The bridging table entry forwards the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
一可选实施例中,控制器进一步用于:接收第二代理服务器发来的接入请求,建立桥接表项,该桥接表项包含:用于指示第二代理服务器为目标代理服务器的信息,用于指示MQTT网络中除第二代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及用于指示所有主题为共享主题的信息;将该桥接表项发送给MQTT网络中除第二代理服务器外的其他所有代理服务器。In an optional embodiment, the controller is further configured to: receive an access request sent by the second proxy server, and establish a bridging entry, where the bridging entry includes: information indicating that the second proxy server is the target proxy server, Information used to indicate that all proxy servers except the second proxy server in the MQTT network are bridge proxy servers, and information used to indicate that all topics are shared topics; send the bridging entry to the MQTT network except the second proxy All other proxy servers other than the server.
一可选实施例中,控制器向至少一个网关发送携带身份ID的QOS请求,包括:控制器每隔预设第二时间间隔,分别为MQTT网络中的每个客户端的网关生成一个唯一的身份ID,并向每个客户端的网关分别发送携带为该网关生成的身份ID的QOS请求消息。In an optional embodiment, the controller sends a QOS request carrying an identity ID to at least one gateway, including: the controller generates a unique identity for the gateway of each client in the MQTT network every preset second time interval ID, and send a QOS request message carrying the ID generated for the gateway to the gateway of each client.
本发明实施例还提供一种计算机程序产品,包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如本发明任一实施例所述的MQTT网络接入方法的步骤。An embodiment of the present invention also provides a computer program product, including a computer program or an instruction. When the computer program or instruction is executed by a processor, the steps of the MQTT network access method described in any embodiment of the present invention are implemented.
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储指令,所述指令在由处理器执行时可执行如上所述MQTT网络接入方法中的步骤。实际应用中,所述的计算机可读介质可以是上述实施例各设备/装置/系统所包含的,也可以是单独存在,而未装配入该设备/装置/系统中。其中,在计算机可读存储介质中存储指令,其存储的指令在由处理器执行时可执行如上MQTT网络接入方法中的步骤。An embodiment of the present invention also provides a computer-readable storage medium, where the computer-readable storage medium stores instructions, and when the instructions are executed by a processor, the steps in the above-mentioned MQTT network access method can be executed. In practical applications, the computer-readable medium may be included in each device/device/system of the above-mentioned embodiments, or may exist independently without being assembled into the device/device/system. Wherein, instructions are stored in the computer-readable storage medium, and the stored instructions can execute the steps in the above MQTT network access method when executed by the processor.
根据本发明公开的实施例,计算机可读存储介质可以是非易失性的计算机可读存储介质,例如可以包括但不限于:便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件,或者上述的任意合适的组合,但不用于限制本发明保护的范围。在本发明公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。According to the disclosed embodiments of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as may include but not limited to: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM) ), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above, but not used to limit the present invention scope of protection. In the disclosed embodiments of the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
如图8所示,本发明实施例还提供一种电子设备。如图8所示,其示出了本发明实施例所涉及的电子设备的结构示意图,具体来讲:As shown in FIG. 8 , an embodiment of the present invention also provides an electronic device. As shown in Figure 8, it shows a schematic structural diagram of the electronic device involved in the embodiment of the present invention, specifically:
该电子设备可以包括一个或一个以上处理核心的处理器81、一个或一个以上计算机可读存储介质的存储器82以及存储在存储器上并可在处理器上运行的计算机程序。在执行所述存储器82的程序时,可以实现上述MQTT网络接入方法。The electronic device may include a processor 81 of one or more processing cores, a memory 82 of one or more computer-readable storage media, and a computer program stored on the memory and executable on the processor. When the program in the memory 82 is executed, the above-mentioned MQTT network access method can be realized.
具体的,实际应用中,该电子设备还可以包括电源83、输入输出单元84等部件。本领域技术人员可以理解,图8中示出的电子设备的结构并不构成对该电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:Specifically, in practical applications, the electronic device may further include components such as a power supply 83 and an input and output unit 84 . Those skilled in the art can understand that the structure of the electronic device shown in FIG. 8 does not constitute a limitation to the electronic device, and may include more or less components than those shown in the illustration, or combine certain components, or different components. layout. in:
处理器81是该电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器82内的软件程序和/或模块,以及调用存储在存储器82内的数据,执行服务器的各种功能和处理数据,从而对该电子设备进行整体监控。The processor 81 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device, by running or executing software programs and/or modules stored in the memory 82, and calling the Data, perform various functions of the server and process data, so as to monitor the electronic equipment as a whole.
存储器82可用于存储软件程序以及模块,即上述计算机可读存储介质。处理器81通过运行存储在存储器82的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器82可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据服务器的使用所创建的数据等。此外,存储器82可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器82还可以包括存储器控制器,以提供处理器81对存储器82的访问。The memory 82 can be used to store software programs and modules, that is, the above-mentioned computer-readable storage medium. The processor 81 executes various functional applications and data processing by executing software programs and modules stored in the memory 82 . The memory 82 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function, etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 82 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 82 may also include a memory controller to provide the processor 81 with access to the memory 82 .
该电子设备还包括给各个部件供电的电源83,可以通过电源管理系统与处理器81逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源83还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The electronic device also includes a power supply 83 for supplying power to various components, which can be logically connected to the processor 81 through the power management system, so that functions such as charging, discharging, and power consumption management can be realized through the power management system. The power supply 83 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
该电子设备还可包括输入输出单元84,该输入单元输出84可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。该输入单元输出84还可以用于显示由用户输入的信息或提供给用户的信息以及各种图像用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。The electronic device may also include an input/output unit 84, the input unit output 84 may be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. The input unit output 84 can also be used to display information input by the user or provided to the user, as well as various graphical user interfaces. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof.
本发明附图中的流程图和框图,示出了按照本发明公开的各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的 每个方框可以代表一个模块、程序段、或者代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应该注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同附图中所标准的顺序发生。例如,两个连接地表示的方框实际上可以基本并行地执行,它们有时也可以按照相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或者流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the drawings of the present invention show the architecture, functions and operations of possible implementations of systems, methods and computer program products according to various embodiments disclosed in the present invention. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the different figures. For example, two blocks shown connected in series may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.
本领域技术人员可以理解,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合,即使这样的组合或结合没有明确记载于本发明中。特别地,在不脱离本发明精神和教导的情况下,本发明的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合,所有这些组合和/或结合均落入本发明公开的范围。Those skilled in the art can understand that various combinations and/or combinations can be made in the various embodiments of the present disclosure and/or the features recorded in the claims, even if such combinations or combinations are not explicitly recorded in the present invention. In particular, without departing from the spirit and teaching of the present invention, various combinations and/or combinations can be made in the various embodiments of the present invention and/or the features recorded in the claims, and all these combinations and/or combinations fall into The scope of the disclosure of the present invention.

Claims (16)

  1. 一种消息队列遥测传输MQTT网络接入方法,其特征在于,该方法包括:A message queue telemetry transmission MQTT network access method, characterized in that the method comprises:
    MQTT网络中的控制器向第一客户端接入的第一网关发送携带身份标识ID的服务质量QOS请求,所述QOS请求用于:第一网关向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求,并根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟,并将第一网关与各代理服务器之间的传输延迟发送给控制器;The controller in the MQTT network sends a quality of service QOS request carrying the identity ID to the first gateway accessed by the first client, and the QOS request is used for: the first gateway broadcasts to all proxy servers in the MQTT network carrying the the PING request of the identity ID, and according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, respectively calculate the transmission delay between the first gateway and each proxy server, and sending the transmission delay between the first gateway and each proxy server to the controller;
    控制器接收第一网关发来的第一网关与各代理服务器之间的传输延迟,在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟;The controller receives the transmission delay between the first gateway and each proxy server sent by the first gateway, and selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server;
    控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关,所述代理服务器接入消息用于:第一网关与第一代理服务器建立连接。The controller uses the first proxy server corresponding to the minimum transmission delay as the access proxy server of the first gateway, carries the address of the first proxy server in the proxy server access message and returns it to the first gateway, and the proxy server access The message is used for: the first gateway establishes a connection with the first proxy server.
  2. 根据权利要求1所述的方法,其特征在于,所述控制器将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关之后,进一步包括:The method according to claim 1, wherein after the controller carries the address of the first proxy server in the proxy server access message and returns it to the first gateway, further comprising:
    控制器接收第一代理服务器转发来的第一客户端针对第一主题的订阅请求;The controller receives the first client's subscription request for the first topic forwarded by the first proxy server;
    控制器建立桥接表项,该桥接表项包含:The controller establishes a bridging entry, and the bridging entry includes:
    用于指示第一代理服务器为目标代理服务器的信息,information indicating that the first proxy server is the target proxy server,
    用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器都为桥接代理服务器的信息,以及,Information for indicating that all proxy servers except the first proxy server in the MQTT network are bridge proxy servers, and,
    用于指示第一主题为共享主题的信息;information indicating that the first topic is a shared topic;
    控制器将所述桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器,所述桥接表项用于:The controller sends the bridging entry to all other proxy servers except the first proxy server in the MQTT network, and the bridging entry is used for:
    当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发所述第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将所述第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself bridging table entry, and forward the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
  3. 根据权利要求1所述的方法,其特征在于,所述方法进一步包括:The method according to claim 1, characterized in that the method further comprises:
    控制器接收第二代理服务器发来的接入请求,建立桥接表项,该桥接表项包含:The controller receives the access request sent by the second proxy server, and establishes a bridging entry, where the bridging entry includes:
    用于指示第二代理服务器为目标代理服务器的信息,information indicating that the second proxy server is the target proxy server,
    用于指示MQTT网络中除第二代理服务器外的其他所有代理服务器为桥接代理服务器的信息,以及,Information for indicating that all proxy servers in the MQTT network except the second proxy server are bridge proxy servers, and,
    用于指示所有主题为共享主题的信息;information indicating that all topics are shared topics;
    控制器将该桥接表项发送给MQTT网络中除第二代理服务器外的其他所有代理服务器。The controller sends the bridging entry to all proxy servers in the MQTT network except the second proxy server.
  4. 根据权利要求1所述的方法,其特征在于,所述控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求,包括:The method according to claim 1, wherein the controller sends a QOS request carrying an ID to the first gateway accessed by the first client, including:
    控制器每隔预设第二时间间隔,分别为MQTT网络中的每个客户端的网关生成一个身份ID,并向每个客户端的网关分别发送携带为该网关生成的身份ID的QOS请求消息,所述每个客户端包含第一MQTT客户端。The controller generates an identity ID for the gateway of each client in the MQTT network at every preset second time interval, and sends a QOS request message carrying the identity ID generated for the gateway to the gateway of each client, so Each client described above comprises a first MQTT client.
  5. 根据权利要求1所述的方法,其特征在于,所述控制器向第一客户端接入的第一网关发送携带身份ID的QOS请求之前,进一步包括:The method according to claim 1, wherein before the controller sends the QOS request carrying the identity ID to the first gateway accessed by the first client, further comprising:
    控制器接收第一网关发来的代理服务器分配请求,为第一网关分配身份ID;所述代理服务器分配请求为:第一网关接收到第一客户端发来的接入请求后发出的。The controller receives the proxy server assignment request sent by the first gateway, and assigns an ID to the first gateway; the proxy server assignment request is sent by the first gateway after receiving the access request sent by the first client.
  6. 根据权利要求1所述的方法,其特征在于,所述控制器在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟之后、所述控制器将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器之前,进一步包括:The method according to claim 1, wherein after the controller selects the smallest transmission delay among the transmission delays between the first gateway and each proxy server, the controller sets the minimum transmission delay corresponding to the first Before a proxy server acts as the access proxy server of the first gateway, it further includes:
    控制器查询第一网关与第一网关当前接入的第三代理服务器之间的传输延迟,判断查询到的传输延迟与所述最小的传输延迟之间的差值是否在预设范围内,若是,则确定第一网关无需切换接入代理服务器,否则,执行所述将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器的动作。The controller queries the transmission delay between the first gateway and the third proxy server currently accessed by the first gateway, and determines whether the difference between the queried transmission delay and the minimum transmission delay is within a preset range, and if so , it is determined that the first gateway does not need to switch the access proxy server; otherwise, perform the action of using the first proxy server corresponding to the smallest transmission delay as the access proxy server of the first gateway.
  7. 一种消息队列遥测传输MQTT网络接入方法,其特征在于,该方法包括:A message queue telemetry transmission MQTT network access method, characterized in that the method comprises:
    MQTT网络中的第一客户端接入的第一网关接收控制器发来的携带身份标识ID的服务质量QOS请求;The first gateway accessed by the first client in the MQTT network receives the quality of service QOS request carrying the identity ID sent by the controller;
    第一网关向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求;The first gateway broadcasts the PING request carrying the ID to all proxy servers in the MQTT network;
    第一网关根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟;The first gateway calculates the transmission delay between the first gateway and each proxy server respectively according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request;
    第一网关将第一网关与各代理服务器之间的传输延迟发送给控制器,所述第一网关 与各代理服务器之间的传输延迟用于:控制器在所述第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟,并将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关;The first gateway sends the transmission delay between the first gateway and each proxy server to the controller, and the transmission delay between the first gateway and each proxy server is used for: the controller communicates between the first gateway and each proxy server Select the smallest transmission delay among the transmission delays between them, and use the first proxy server corresponding to the smallest transmission delay as the access proxy server of the first gateway, and return the address of the first proxy server in the proxy server access message to the first gateway;
    第一网关接收控制器发来的携带第一代理服务器的地址的代理服务器接入消息,与第一代理服务器建立连接。The first gateway receives the proxy server access message carrying the address of the first proxy server sent by the controller, and establishes a connection with the first proxy server.
  8. 根据权利要求7所述的方法,其特征在于,所述第一网关与第一代理服务器建立连接之后,进一步包括:The method according to claim 7, wherein after the first gateway establishes a connection with the first proxy server, further comprising:
    第一网关接收第一客户端发来的针对第一主题的订阅请求,将该订阅请求经由第一代理服务器转发给所述MQTT控制器;所述订阅请求用于:The first gateway receives the subscription request for the first topic sent by the first client, and forwards the subscription request to the MQTT controller via the first proxy server; the subscription request is used for:
    所述MQTT控制器根据所述订阅请求,建立桥接表项,该桥接表项包含:The MQTT controller establishes a bridging entry according to the subscription request, and the bridging entry includes:
    用于指示第一代理服务器为目标代理服务器的信息,information indicating that the first proxy server is the target proxy server,
    用于指示MQTT网络中除第一代理服务器外的其他所有代理服务器都为桥接代理服务器的信息,以及,Information for indicating that all proxy servers except the first proxy server in the MQTT network are bridge proxy servers, and,
    用于指示第一主题为共享主题的信息;且,information indicating that the first topic is a shared topic; and,
    所述MQTT控制器将所述桥接表项发送给MQTT网络中除第一代理服务器外的其他所有代理服务器;且,The MQTT controller sends the bridging entry to all other proxy servers in the MQTT network except the first proxy server; and,
    当MQTT网络中除第一代理服务器外的其他任一代理服务器接收到接入本代理服务器的任一MQTT客户端发来的第一主题消息时,在自身维护的接入本代理服务器的各MQTT客户端的订阅表中,查找订阅了第一主题的MQTT客户端,向查找到的各MQTT客户端转发所述第一主题消息,同时,在自身维护的桥接表项中查找共享主题为第一主题的桥接表项,将所述第一主题消息转发给查找到的各桥接表项中的目标代理服务器,以便由目标代理服务器将第一主题消息发送给订阅了第一主题的MQTT客户端。When any other proxy server in the MQTT network except the first proxy server receives the first topic message sent by any MQTT client connected to the proxy server, each MQTT server connected to the proxy server maintained by itself will In the client's subscription table, find the MQTT client that has subscribed to the first topic, forward the first topic message to each found MQTT client, and at the same time, find the shared topic as the first topic in the bridging entry maintained by itself bridging table entry, and forward the first topic message to the target proxy server in each found bridging table entry, so that the target proxy server sends the first topic message to the MQTT client that has subscribed to the first topic.
  9. 根据权利要求7所述的方法,其特征在于,所述第一网关接收控制器发来的携带身份ID的QOS请求之前,进一步包括:The method according to claim 7, wherein before the first gateway receives the QOS request carrying the identity ID sent by the controller, it further includes:
    第一网关接收第一客户端发来的接入请求,向控制器发送代理服务器分配请求。The first gateway receives the access request sent by the first client, and sends a proxy server assignment request to the controller.
  10. 根据权利要求7所述的方法,其特征在于,所述第一网关向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求,包括:The method according to claim 7, wherein the first gateway broadcasts the PING request carrying the identity ID to all proxy servers in the MQTT network, including:
    第一网关每隔预设第一时间间隔向MQTT网络中的所有代理服务器广播一次携带所 述身份ID的PING请求,直至广播次数达到预设次数;The first gateway broadcasts a PING request carrying the identity ID to all proxy servers in the MQTT network every preset first time interval until the number of broadcasts reaches the preset number of times;
    且,所述第一网关分别计算第一网关与各代理服务器之间的传输延迟包括:And, the first gateway separately calculating the transmission delay between the first gateway and each proxy server includes:
    第一网关根据每次发送的PING请求的发送时间戳和各代理服务器每次返回的PING响应的时间戳,分别计算第一网关与各代理服务器之间的平均传输延迟。The first gateway respectively calculates the average transmission delay between the first gateway and each proxy server according to the sending timestamp of each sent PING request and the timestamp of each returned PING response by each proxy server.
  11. 一种消息队列遥测传输MQTT控制器,其特征在于,该控制器包括:A message queue telemetry transmission MQTT controller is characterized in that the controller includes:
    QOS检测触发模块,用于向第一客户端接入的第一网关发送携带身份标识ID的服务质量QOS请求,所述QOS请求用于:第一网关向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求,并根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算第一网关与各代理服务器之间的传输延迟,并将第一网关与各代理服务器之间的传输延迟发送给控制器;The QOS detection triggering module is configured to send a quality of service QOS request carrying the identity ID to the first gateway accessed by the first client, and the QOS request is used for: the first gateway broadcasts the carrying information to all proxy servers in the MQTT network. The PING request of the identity ID, and according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, respectively calculate the transmission delay between the first gateway and each proxy server , and send the transmission delay between the first gateway and each proxy server to the controller;
    代理服务器选择模块,用于接收第一网关发来的第一网关与各代理服务器之间的传输延迟,在第一网关与各代理服务器之间的传输延迟中选择最小的传输延迟;将最小的传输延迟对应的第一代理服务器作为第一网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给第一网关,所述代理服务器接入消息用于:第一网关与第一代理服务器建立连接。The proxy server selection module is used to receive the transmission delay between the first gateway and each proxy server sent by the first gateway, and select the minimum transmission delay among the transmission delays between the first gateway and each proxy server; The first proxy server corresponding to the transmission delay acts as the access proxy server of the first gateway, and returns the address of the first proxy server in the proxy server access message to the first gateway, and the proxy server access message is used for: A gateway establishes a connection with the first proxy server.
  12. 一种消息队列遥测传输MQTT网关,其特征在于,该网关包括:A message queue telemetry transmission MQTT gateway is characterized in that the gateway includes:
    消息收发模块,用于接收控制器发来的携带身份标识ID的服务质量QOS请求,向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求,并接收各代理服务器返回的携带所述身份ID的PING响应;The message transceiver module is used to receive the quality of service QOS request carrying the identity ID sent by the controller, broadcast the PING request carrying the identity ID to all proxy servers in the MQTT network, and receive the PING request carrying the identity ID returned by each proxy server. PING response of identity ID;
    传输延迟计算模块,用于根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算所述网关与各代理服务器之间的传输延迟,将所述网关与各代理服务器之间的传输延迟发送给控制器,所述网关与各代理服务器之间的传输延迟用于:控制器在所述网关与各代理服务器之间的传输延迟中选择最小的传输延迟,并将最小的传输延迟对应的第一代理服务器作为所述网关的接入代理服务器,将第一代理服务器的地址携带在代理服务器接入消息中返回给所述网关,所述代理服务器接入消息用于:所述网关与第一代理服务器建立连接。The transmission delay calculation module is used to calculate the transmission delay between the gateway and each proxy server respectively according to the receiving timestamp of the PING response carrying the identity ID returned by each proxy server and the sending timestamp of the PING request, Sending the transmission delay between the gateway and each proxy server to the controller, where the transmission delay between the gateway and each proxy server is used for: the controller selects from among the transmission delays between the gateway and each proxy server The minimum transmission delay, and the first proxy server corresponding to the minimum transmission delay is used as the access proxy server of the gateway, and the address of the first proxy server is carried in the proxy server access message and returned to the gateway, the The proxy server access message is used for: the gateway establishes a connection with the first proxy server.
  13. 一种消息队列遥测传输MQTT网络接入系统,其特征在于,该系统包括:一控制器、两个以上代理服务器、以及至少一个网关,且每个网关分别与至少一个客户端绑定,其中:A message queue telemetry transmission MQTT network access system, characterized in that the system includes: a controller, more than two proxy servers, and at least one gateway, and each gateway is bound to at least one client respectively, wherein:
    控制器,用于向至少一个网关发送携带身份标识ID的服务质量QOS请求;当接收 到一网关发来的该网关与各代理服务器之间的传输延迟,在该网关与各代理服务器之间的传输延迟中选择最小的传输延迟,将最小的传输延迟对应的代理服务器作为该网关的接入代理服务器,将该接入代理服务器的地址携带在代理服务器接入消息中返回给该网关;The controller is configured to send a quality of service QOS request carrying an identity ID to at least one gateway; when receiving a transmission delay between the gateway and each proxy server sent by a gateway, the transmission delay between the gateway and each proxy server Select the minimum transmission delay in the transmission delay, use the proxy server corresponding to the minimum transmission delay as the access proxy server of the gateway, carry the address of the access proxy server in the proxy server access message and return to the gateway;
    网关,用于接收到控制器发来的QOS请求,向MQTT网络中的所有代理服务器广播携带所述身份ID的PING请求,并根据各代理服务器返回的携带所述身份ID的PING响应的接收时间戳和所述PING请求的发送时间戳,分别计算本网关与各代理服务器之间的传输延迟,并将本网关与各代理服务器之间的传输延迟发送给控制器,接收控制器发来的代理服务器接入消息,根据该消息中的接入代理服务器的地址,与对应代理服务器建立连接;The gateway is used to receive the QOS request sent by the controller, broadcast the PING request carrying the identity ID to all proxy servers in the MQTT network, and according to the receiving time of the PING response carrying the identity ID returned by each proxy server stamp and the sending timestamp of the PING request, respectively calculate the transmission delay between the gateway and each proxy server, and send the transmission delay between the gateway and each proxy server to the controller, and receive the proxy sent by the controller A server access message, according to the address of the access proxy server in the message, establishes a connection with the corresponding proxy server;
    代理服务器,用于接收一网关发来的携带所述身份ID的PING请求,向该网关返回携带所述身份ID的PING响应。The proxy server is configured to receive a PING request carrying the identity ID sent by a gateway, and return a PING response carrying the identity ID to the gateway.
  14. 一种非瞬时计算机可读存储介质,所述非瞬时计算机可读存储介质存储指令,其特征在于,所述指令在由处理器执行时使得所述处理器执行如权利要求1至10中任一项所述的消息队列遥测传输MQTT网络接入方法的步骤。A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores instructions, characterized in that, when executed by a processor, the instructions cause the processor to perform any one of claims 1 to 10 The steps of the message queue telemetry transmission MQTT network access method described in item.
  15. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器存储有能在所述处理器上运行的计算机程序,所述处理器在执行所述计算机程序时,实现如权利要求1至10中任一项所述的消息队列遥测传输MQTT网络接入方法的步骤。An electronic device, characterized in that it includes: a processor and a memory, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, the computer program according to claim 1 is realized. Steps of the message queue telemetry transmission MQTT network access method described in any one of 10 to 10.
  16. 一种计算机程序产品,包括计算机程序或指令,其特征在于,该计算机程序或指令被处理器执行时实现如权利要求1至10中任一项所述的消息队列遥测传输MQTT网络接入方法的步骤。A computer program product, comprising computer programs or instructions, characterized in that, when the computer program or instructions are executed by a processor, the method for accessing the MQTT network for message queue telemetry transmission according to any one of claims 1 to 10 is implemented step.
PCT/CN2022/107189 2021-07-30 2022-07-21 Message queuing telemetry transport network access method, and controller and gateway WO2023005809A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110872247.2 2021-07-30
CN202110872247.2A CN115695395A (en) 2021-07-30 2021-07-30 Message queue telemetry transmission network access method, controller and gateway

Publications (1)

Publication Number Publication Date
WO2023005809A1 true WO2023005809A1 (en) 2023-02-02

Family

ID=85058098

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/107189 WO2023005809A1 (en) 2021-07-30 2022-07-21 Message queuing telemetry transport network access method, and controller and gateway

Country Status (2)

Country Link
CN (1) CN115695395A (en)
WO (1) WO2023005809A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117579694B (en) * 2024-01-15 2024-04-16 国网浙江省电力有限公司宁波供电公司 Ubiquitous power internet of things-based data sharing management method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080062997A1 (en) * 2006-09-07 2008-03-13 Go2Call.Com, Inc. Intelligent call routing through distributed VoIP networks
CN106230896A (en) * 2016-07-18 2016-12-14 深圳国泰安教育技术股份有限公司 A kind of information push method, Apparatus and system
CN107950005A (en) * 2015-08-04 2018-04-20 康维达无线有限责任公司 Service element Selection of chiller
US20180167476A1 (en) * 2016-12-12 2018-06-14 Sap Se Meta broker for publish-subscribe-based messaging
CN110418305A (en) * 2019-08-01 2019-11-05 上海应用技术大学 A kind of transmission method and its Transmission system of Switch monitor information
CN111770140A (en) * 2020-06-09 2020-10-13 成都中云天下科技有限公司 Communication method, user equipment and proxy server cluster

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080062997A1 (en) * 2006-09-07 2008-03-13 Go2Call.Com, Inc. Intelligent call routing through distributed VoIP networks
CN107950005A (en) * 2015-08-04 2018-04-20 康维达无线有限责任公司 Service element Selection of chiller
CN106230896A (en) * 2016-07-18 2016-12-14 深圳国泰安教育技术股份有限公司 A kind of information push method, Apparatus and system
US20180167476A1 (en) * 2016-12-12 2018-06-14 Sap Se Meta broker for publish-subscribe-based messaging
CN110418305A (en) * 2019-08-01 2019-11-05 上海应用技术大学 A kind of transmission method and its Transmission system of Switch monitor information
CN111770140A (en) * 2020-06-09 2020-10-13 成都中云天下科技有限公司 Communication method, user equipment and proxy server cluster

Also Published As

Publication number Publication date
CN115695395A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
WO2020228469A1 (en) Method, apparatus and system for selecting mobile edge computing node
US10951733B2 (en) Route selection method and system, network acceleration node, and network acceleration system
KR102498752B1 (en) Messaging platform for delivering real-time messages
Rausch et al. Emma: Distributed qos-aware mqtt middleware for edge computing applications
US11316786B2 (en) Systems and methods for directly responding to distributed network traffic
US10367852B2 (en) Multiplexed demand signaled distributed messaging
CN109274730B (en) Internet of things system, MQTT message transmission optimization method and device
EP3296870A1 (en) Cdn-based content management system
US20050188087A1 (en) Parallel processing system
CN111491013A (en) Server scheduling method, device, system, storage medium and computer equipment
Zhang et al. SDN-based load balancing strategy for server cluster
WO2017181587A1 (en) Method and electronic equipment for managing nodes in cdn
CN102480469B (en) Based on the method for the load dispatch of balancing energy and device in a kind of SIP service cluster
JP2022549055A (en) NODE RATE LIMITING METHOD, APPARATUS, ELECTRONIC DEVICE AND STORAGE MEDIUM
WO2023005809A1 (en) Message queuing telemetry transport network access method, and controller and gateway
CN110719273A (en) Method for determining back source node, server and computer readable storage medium
WO2021120633A1 (en) Load balancing method and related device
CN114500405A (en) Resource allocation and acquisition method and device for multi-type service application
CN107667513B (en) System and method for remote network topology discovery
WO2020206783A1 (en) Data transmission scheduling method and system
KR20180095988A (en) System and Method for Determining Fog Server Number and Placement in Local Area Network Environment
JP2013206112A (en) Computer system and sub-system management method
US10951690B2 (en) Near real-time computation of scaling unit's load and availability state
JP2019022078A (en) Virtual server organization method and virtual server organization system
EP4283954A1 (en) Computing power information processing method, first network device, and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22848414

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE