Internet of Things Device Platform Based on Public Cloud and Its Deployment Method
By introducing technologies such as elastic load balancing ELB, multi-network cloud host and Calico network plug-in to the Internet of Things platform, the problem of insufficient access to terminal devices and self-healing capabilities in the K8S architecture is solved, efficient terminal access and fault self-healing, and system availability and scalability are improved.
Patent Information
- Application Number
- CN202211738654.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the K8S-based Internet of Things platform, the number of terminal devices is limited, network communication is inconvenient, and lacks self-healing capabilities, which cannot meet the needs of large connections.
It adopts a combination of elastic load balancing ELB, multi-network cloud host, bare metal physical machine, K8S container management platform, HAProxy and Agent, combined with the Calico network plug-in and BGP protocol, realizes automatic discovery and network interoperability of service containers, supports the hot load configuration of HAProxy, and optimizes network communication.
It realizes efficient access to terminal devices, supports millions of devices to be online at the same time, has the ability to heal failures, improves the high availability and scalability of the system, and reduces communication delay and resource overhead.
Smart Images

Figure CN116132267B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an Internet of Things device platform based on a public cloud and a deployment method thereof. Background Art
[0002] As cloud architecture is prioritized and architecture built with cloud-native technologies and management methods becomes popular in application development models, the combination of K8S+microservices has become the preferred architecture choice for more and more companies. In the IoT platform architecture, the large number of pan-terminal devices requires the platform to be able to support a large number of online connections, use the cloud to carry the platform, and ultimately provide device access services for pan-terminals.
[0003] In order to ensure service reliability, access services are usually deployed directly on the host or run on the host in Docker mode using a virtual IP to provide direct connection services, or ELB or HAProxy is hung on the front end of the access service to provide services to the outside. These deployment methods have the following disadvantages: they are not connected to other services in the K8S-based architecture, and additional methods are required to open the network; the front-end load cannot meet the connection requirements due to the limited network card port; the service does not have self-healing capabilities, etc. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an Internet of Things device platform based on a public cloud and a deployment method thereof, aiming to increase the number of terminal accesses.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: an Internet of Things device platform based on a public cloud, comprising:
[0006] Elastic Load Balancing ELB, cloud host, bare metal physical machine, K8S container management platform, HAProxy and Agent;
[0007] Elastic Load Balancing (ELB) is used to automatically distribute access traffic to cloud hosts;
[0008] The cloud host, as the host node of the K8S cluster, has multiple network cards and is used to deploy HAProxy and Agent;
[0009] Bare metal physical machines, as host nodes of K8S clusters, are combined with HAProxy cloud hosts to form K8S clusters and carry access service containers.
[0010] K8S container management platform, used to orchestrate service containers and achieve network interconnection between service containers;
[0011] HAProxy and Agent are used to achieve HAProxy configuration reloading for the business load of the access service and the automatic discovery of the access service container IP.
[0012] Furthermore, the network plugin used on the K8S container management platform is the Calico component.
[0013] Furthermore, the Internet of Things device platform based on public cloud includes the access service EMQX. The access service EMQX is deployed in the form of PODs on bare metal physical machines, and the container IP addresses are announced to all hosts in the cluster through the BGP protocol of the Calico component, so as to realize the access between other cluster hosts and the access service container IP.
[0014] Furthermore, the Agent is configured to monitor the EMQX container. After the container IP changes, it immediately causes HAProxy to hot-load the new configuration file.
[0015] Furthermore, one or more listeners are configured on the elastic load balancer ELB. The listeners use the configured protocol and port to check the connection requests from clients, and forward the requests to a backend cloud host according to the predefined allocation policy and forwarding policy.
[0016] Furthermore, multiple network cards are configured in the configuration file of HAProxy for load traffic.
[0017] Furthermore, there are 10 network cards configured in the configuration file of HAProxy.
[0018] The present invention also provides a deployment method for an Internet of Things device platform based on public cloud, including:
[0019] Apply for 2 cloud hosts and 1 bare metal physical machine on the public cloud, 1 elastic load balancer ELB and bind an elastic public network IP, and add 10 network cards to each of the 2 cloud hosts;
[0020] Mix and network the 2 cloud hosts and 1 bare metal physical machine, and deploy K8S-related components and Calico network components;
[0021] Using K8S node management, configure the EMQX label on the nodes of the bare metal physical machine, and configure the label name into the YAML deployment file of EMQX. When K8S schedules, it will use the label selector to select the physical machine nodes to run the EMQX container;
[0022] Deploy HAProxy and Agent to the 2 cloud hosts;
[0023] Configure Elastic Load Balancing (ELB), add listeners and backend host groups to achieve layer-4 load balancing from ELB to two HAProxy cloud hosts. Both backend hosts receive traffic simultaneously to ensure high availability of the service.
[0024] Furthermore, when deploying HAProxy and Agent to two cloud hosts, except for the eth0 network card, access to the EMQX container IP is achieved for other eth1 - eth9 network cards by adding host policy routing. Ten network cards are used in the HAProxy configuration file to load balance traffic.
[0025] Furthermore, configure Agent to monitor the EMQX container. After the container IP changes, immediately make HAProxy hot - load the new configuration file.
[0026] The beneficial effects of the present invention are as follows: Using K8S to deploy the access service can flexibly scale in and out instances according to CPU and MEM, with self - healing for faults. It can solve the problem of millions of devices being online simultaneously with a small number of hosts, and at the same time, it has the ability to ensure high availability of the system such as self - healing for access service faults and elimination of single - point faults. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the mechanisms shown in these drawings.
[0028] Figure 1 It is the framework diagram of the Internet of Things device platform based on public cloud for the embodiments of the present invention;
[0029] Figure 2 It is the flowchart of the deployment method of the Internet of Things device platform based on public cloud for the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0031] It should be noted that the descriptions involving "first", "second", etc. in the present invention are only for descriptive purposes, and cannot be construed as indicating or implying their relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. Additionally, the technical solutions between various embodiments can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0032] Please refer to Figure 1 , the first embodiment of the present invention is: An Internet of Things device platform based on a public cloud, including:
[0033] Elastic Load Balancing ELB, cloud hosts, bare metal physical machines, K8S container management platform, HAProxy, and Agent;
[0034] The Elastic Load Balancing ELB is used to automatically distribute access traffic to cloud hosts;
[0035] The cloud hosts, as the host nodes of the K8S cluster, have multiple network cards and are used to deploy HAProxy and Agent;
[0036] The bare metal physical machines, as the host nodes of the K8S cluster, and the HAProxy cloud hosts are mixed to form a K8S cluster to carry the operation of access service containers;
[0037] The K8S container management platform is used to orchestrate service containers and achieve network interconnection between service containers;
[0038] HAProxy and Agent are used to realize HAProxy configuration reloading through the business load of access services and automatic discovery of the IP addresses of access service containers.
[0039] Furthermore, the network plugin used on the K8S container management platform is the Calico component.
[0040] Two-layer network communication needs to rely on the broadcast message mechanism, and the overhead of broadcast messages grows exponentially with the number of hosts. The three-layer routing method used by Calico completely suppresses two-layer broadcasts and reduces resource overhead. In addition, the two-layer network uses Vlan isolation technology, which inherently has a limit of 4096 specifications. Even if Vxlan can be used to solve the problem, Vxlan brings the problem of tunnel overhead. Calico does not use vlan or vxlan technology, making the resource utilization rate higher. Calico also has natural scalability and can handle larger amounts of data.
[0041] Furthermore, the Internet of Things device platform based on public cloud includes the access service EMQX. The access service EMQX is deployed on the bare metal physical machine in the form of POD. Through the BGP protocol of the Calico component, the container IP address is announced to all hosts in the cluster, so as to realize the access between other cluster hosts and the access service container IP. As the infrastructure software necessary for Internet of Things application development and Internet of Things platform construction, EMQX mainly realizes the interconnection of Internet of Things devices and the connection of devices to the cloud at the edge and in the cloud, and provides core capabilities such as Internet of Things device access, protocol processing, message routing, data storage, and stream data processing.
[0042] Furthermore, the Agent is configured to monitor the EMQX container. After the container IP changes, the HAProxy is immediately hot-loaded with a new configuration file.
[0043] Furthermore, one or more listeners are configured on the elastic load balancer ELB. The listeners use the configured protocol and port to check the connection requests from the clients, and forward the requests to a backend cloud host according to the predefined allocation policy and forwarding policy.
[0044] Furthermore, multiple network cards are configured in the configuration file of HAProxy for load traffic.
[0045] Furthermore, there are 10 network cards configured in the configuration file of HAProxy.
[0046] The technical effects of the embodiment are as follows:
[0047] Deploying the access service using K8S can flexibly scale in and out instances according to CPU and MEM, and has capabilities such as self-healing in case of failures. Adopting the Calico network solution can achieve direct connection routing communication, reduce the IP packet unpacking and repacking of communication messages between containers, and reduce the loss of communication time. Moreover, compared with the cloud host being limited by the number of connections, a larger number of connections can be obtained. By configuring multiple network cards and network policy routing on the cloud host, the number of long connections from a single cloud host HAProxy to the access service can be expanded. Usually, 10 network cards are configured on the cloud host, and the long connection number can reach more than 500,000 levels, enabling 1 cloud host to achieve the capabilities of 10 cloud hosts, reducing the number of hosts and saving costs.
[0048] Please refer to Figure 2 , another embodiment of the present invention is: A method for deploying an Internet of Things device platform based on public cloud, including:
[0049] S10. Apply for 2 cloud hosts, 1 bare metal physical machine, and 1 elastic load balancer ELB and bind an elastic public network IP on the public cloud. Add 10 network cards to each of the 2 cloud hosts;
[0050] S20. Hybrid network two cloud hosts and one bare-metal physical machine, and deploy relevant K8S components and Calico network components;
[0051] S30. Use K8S node management to configure EMQX labels on the nodes of the bare-metal physical machine, and configure the label names into the EMQX YAML deployment file. When K8S schedules, the label selector will be used to select the physical machine nodes to run the EMQX container;
[0052] S40. Deploy HAProxy and Agent to two cloud hosts;
[0053] S50. Configure Elastic Load Balancing ELB, add listeners and backend host groups to achieve layer-4 load balancing from ELB to two HAProxy cloud hosts. The two backend hosts receive services simultaneously to ensure the high availability of the service.
[0054] Further, when deploying HAProxy and Agent to two cloud hosts, except for the eth0 network card, access to the EMQX container IP is achieved for other eth1-eth9 network cards by adding host policy routes, and 10 network cards are used in the HAProxy configuration file to load balance traffic.
[0055] Further, configure Agent to monitor the EMQX container. After the container IP changes, immediately make HAProxy hot-load the new configuration file.
[0056] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. All equivalent structural or equivalent process transformations made using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, are similarly included in the patent protection scope of the present invention.
Claims
1. An Internet of Things device platform based on a public cloud, characterized in that Including: Elastic Load Balancing (ELB), cloud hosts, bare metal physical machines, K8S container management platform, HAProxy, and Agent; The Elastic Load Balancing (ELB) is used to automatically distribute access traffic to cloud hosts; The cloud hosts, as the host nodes of the K8S cluster, have multiple network cards and are used to deploy HAProxy and Agent. There are 10 network cards configured in the configuration file of HAProxy for load traffic; The bare metal physical machines, as the host nodes of the K8S cluster, are mixed with HAProxy cloud hosts to form a K8S cluster and carry the operation of access service containers; The K8S container management platform is used to orchestrate service containers and achieve network interconnection between service containers; HAProxy and Agent are used to realize HAProxy configuration reloading through the business load of the access service and the automatic discovery of the IP of the access service container; The network plugin used on the K8S container management platform is the Calico component; The Internet of Things device platform based on the public cloud includes the access service EMQX. The access service EMQX is deployed in the form of PODs on bare metal physical machines, and the container IP addresses are announced to all hosts in the cluster through the BGP protocol of the Calico component, so as to realize the access between other cluster hosts and the IP of the access service container.
2. The Internet of Things device platform based on public cloud as claimed in claim 1, characterized in that: The Agent is configured to monitor the EMQX container. After the container IP changes, it immediately makes HAProxy hot-load the new configuration file.
3. The Internet of Things device platform based on public cloud according to claim 1, characterized in that: One or more listeners are configured on the Elastic Load Balancing (ELB). The listeners use the configured protocol and port to check the connection requests from clients and forward the requests to a backend cloud host according to the predefined allocation policy and forwarding policy.
4. A deployment method for an Internet of Things device platform based on the public cloud, including: Apply for 2 cloud hosts, 1 bare metal physical machine, and 1 Elastic Load Balancing (ELB) on the public cloud and bind an elastic public network IP. Add 10 network cards to each of the 2 cloud hosts; Mix and network the 2 cloud hosts and 1 bare metal physical machine, and deploy K8S-related components and Calico network components; Using K8S node management, configure the EMQX label on the node of the bare metal physical machine and configure the label name into the YAML deployment file of EMQX. When K8S schedules, it will use the label selector to select the physical machine node to run the EMQX container; Deploy HAProxy and Agent to the 2 cloud hosts. Except for the eth0 network card, other eth1-eth9 network cards realize access to the IP of the EMQX container through the method of adding host policy routes. 10 network cards are used in the HAProxy configuration file to load traffic; Configure the Elastic Load Balancing (ELB), add listeners and backend host groups, and realize the 4-layer load of the ELB to the 2 HAProxy cloud hosts. The two backend hosts receive services simultaneously to ensure the high availability of the service.
5. The method for deploying an Internet of Things device platform based on a public cloud according to claim 4, characterized in that: Configure the Agent to monitor the EMQX container. After the container IP changes, it immediately makes HAProxy hot-load the new configuration file.