An elastically scalable device access system and working method thereof
By adopting the distributed deployment of microservice architecture and kubernetes clusters on the device access platform, the elastic scaling of the device access system is achieved, the problem of low resource utilization rate and protocol differences in the device access platform is solved, and disaster emergency equipment is improved access capability and system stability.
Patent Information
- Application Number
- CN202111635103.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-12-27
AI Technical Summary
When facing large-scale disaster equipment data access and management control, the existing equipment access platform has complex deployment and operation and maintenance, and the fixed resource allocation cannot meet online load changes, resulting in low resource utilization, slow application deployment, and complex environment. The access protocols of different equipment vary greatly, making it difficult to access the disaster emergency control big data platform.
Design an elastic and scalable device access system, adopting a microservice architecture, including device access unit, data processing unit, monitoring unit, evaluation unit and execution unit, and is deployed in a distributed manner through containerized microservices to support mainstream device protocols. Use kubernetes cluster to achieve automatic expansion and shrink capacity, and adjust the cluster size according to the load evaluation results.
It improves the carrying capacity and service stability of the cluster, reduces resource waste, improves resource utilization and user experience, supports access to tens of millions of equipment, and achieves rapid deployment and elastic expansion.
Smart Images

Figure CN114301917B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a disaster sensing device access platform, and more specifically to an elastically scalable device access system and a working method thereof. Background Art
[0002] The rapid development of urbanization has led to increasingly prominent disaster safety issues. The total number of urban disaster accidents and the degree of damage have increased significantly. Improving urban disaster prevention and control capabilities has become an important mission. The occurrence and development of typical urban disasters such as fires, explosions, waterlogging, hazardous chemical leaks and integrated pipeline accidents have many characteristics such as randomness, suddenness, chain, and coupling. They involve a wide range, are highly destructive, and cause great losses. They require a large number of disaster IoT devices to collect data and then predict and warn through models. Faced with the needs of large-scale disaster equipment data access and management control, the existing equipment access platform has the problems of complex deployment and operation and maintenance, and the fixed allocation of operating resources cannot meet the online load changes. Due to the large number of types and quantities of disaster emergency equipment, different equipment access protocols vary greatly, and even many equipment protocols are private, making it difficult to access the disaster emergency management and control big data platform.
[0003] The architecture of the device access platform is based on the microservice architecture, which decomposes the device access business functions into independent microservices. Each microservice is a simple, lightweight service with a single responsibility that can be independently compiled, deployed and run. By orchestrating these atomic services, a device access application can be quickly built. The current microservice system usually directly packages microservices and runs them on the host or virtual machine node. This method requires various operating environments to be deployed on all hosts or virtual machines, and cannot automatically select operating nodes in the cluster; when the service is overloaded, it is necessary to repeatedly start multiple processes on one or more hosts, and it cannot expand rapidly on demand. There are problems such as low resource utilization, slow application deployment, and complex application deployment environment.
[0004] Therefore, it is necessary to design a new system that can adjust the size of the cluster when the maximum carrying capacity of the existing cluster is exceeded to improve the cluster's carrying capacity and ensure the performance and stability of the access platform service. At the same time, it can minimize the waste of resources when the cluster load is very low. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide an elastically scalable device access system and a working method thereof.
[0006] To achieve the above-mentioned purpose, the present invention adopts the following technical scheme: an elastically scalable device access system, including a microservice architecture, wherein the microservice architecture is provided with a device access unit, a data processing unit, a monitoring unit, an evaluation unit and an execution unit, wherein the microservice architecture is used to encapsulate the device access unit and the data processing unit, and supports the access of mainstream device protocols, and uses containers as carriers to build application images for microservices, and pushes them to image repositories, and performs distributed deployment using a kubernetes cluster to obtain distributed node working nodes and master nodes; the device access unit and the data processing unit are deployed on the distributed node working nodes;
[0007] The device access unit is used for providing device access;
[0008] The data processing unit is used to process the transmission data of the connected device in real time to obtain a processing result;
[0009] The monitoring unit is used to monitor the access index data of the device access unit and the task processing index data of the data processing unit to obtain a monitoring result;
[0010] The evaluation unit is used to perform load evaluation according to the monitoring result to obtain an evaluation result;
[0011] The execution unit is used to calculate the expected number of replicas of the replica set according to the evaluation result, and perform elastic expansion of the pod according to the expected number of replicas of the replica set.
[0012] Its further technical solution is: the device access unit is used for device access, converting the private protocol reported by the device into the MQTT standard protocol according to the protocol parsing configuration, and converting the MQTT standard protocol transmitted to the device into the device private protocol to obtain transmission data.
[0013] Its further technical solution is: the data processing unit includes EMQX middleware and kubernetes container;
[0014] The EMQX middleware is used to buffer the transmission data output by the device access unit;
[0015] The kubernetes container is used to process the transmission data using flink to obtain a processing result.
[0016] Its further technical solution is: the monitoring unit is used to collect relevant indicator data of the device access unit and the single node of the data processing unit and the relevant POD resources to obtain cluster-level monitoring data, hierarchically aggregate the data, store and visualize the data to obtain monitoring results.
[0017] A further technical solution is: the evaluation unit is used to perform load evaluation on the device access unit and the data set access unit according to the monitoring result to obtain an evaluation result.
[0018] Its further technical solution is: the evaluation unit is used to evaluate the number of service instances expanded when the number of concurrent connections of the node corresponding to the device access unit is not less than a preset upper critical value, or the number of task backlogs of the data processing unit is higher than the preset upper threshold; the evaluation result is to shrink the number of service instances when the number of concurrent connections of the node corresponding to the device access unit is lower than the preset lower critical value, or the number of task backlogs of the data processing unit is lower than the preset lower threshold.
[0019] A further technical solution is: the execution unit is used to calculate the expected number of replicas of the replica set according to the evaluation result, calculate the scaling amount according to the expected number of replicas of the replica set, and perform elastic expansion of the pod according to the scaling amount.
[0020] Its further technical solution is: the execution unit is used to calculate the expected number of replicas of the replica set according to the evaluation result, and calculate the scaling amount according to the expected number of replicas of the replica set. When the expected number of replicas of the replica set is greater than the current number of replicas, capacity expansion is performed according to the scaling amount; when the expected number of replicas of the replica set is less than the current number of replicas, capacity reduction is performed according to the scaling amount.
[0021] The present invention also provides a working method of an elastically scalable device access system, comprising:
[0022] The device access unit accesses the device;
[0023] The data processing unit processes the transmission data of the connected device in real time to obtain the processing result;
[0024] The monitoring unit monitors the access index data of the device access unit and the task processing index data of the data processing unit to obtain a monitoring result;
[0025] The evaluation unit performs load evaluation according to the monitoring result to obtain an evaluation result;
[0026] The execution unit calculates the expected number of replicas of the replica set according to the evaluation result, and elastically expands the pod according to the expected number of replicas of the replica set.
[0027] A further technical solution is: the execution unit calculates the expected number of replicas of the replica set according to the evaluation result, and elastically expands the pod according to the expected number of replicas of the replica set, including:
[0028] The execution unit periodically checks the load status of all replicas in the pod replica set according to the evaluation unit, automatically adjusts the number of replicas, calculates the expected number of replicas of the replica set according to the scaling policy, checks the expected number of replicas of the replica set and the current number of replicas, and executes container expansion when the expected number of replicas of the replica set is greater than the current number of replicas; when the expected number of replicas of the replica set is less than the current number of replicas, the container is reduced.
[0029] The beneficial effects of the present invention compared with the prior art are as follows: by providing a device access unit, a data processing unit, a monitoring unit, an evaluation unit and an execution unit on a microservice architecture, and performing distributed deployment with a kubernetes cluster, when the application load is reduced, idle resources are promptly recovered, the application operating cost is reduced and resource utilization is improved; when the maximum carrying capacity of the existing cluster is exceeded, the scaling amount is determined by the evaluation result, and the scale of the cluster is adjusted to improve the carrying capacity of the cluster, thereby ensuring the user experience and the stability of the platform service.
[0030] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0032] Figure 1 A schematic diagram of the architecture of an elastically scalable device access system provided by an embodiment of the present invention;
[0033] Figure 2 A schematic block diagram of an elastically scalable device access system provided by an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of the operation of a monitoring unit provided in an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of the operation of a device access unit and a data processing unit provided in an embodiment of the present invention;
[0036] Figure 5 A schematic diagram of the operation of an elastically scalable device access system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0039] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0040] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0041] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of the architecture of an elastically scalable device access system 100 provided in an embodiment of the present invention; Figure 2 A schematic block diagram of an elastically scalable device access system 100 provided in an embodiment of the present invention. The system encapsulates the underlying device access and data communication transmission processes with a microservice architecture, and supports the access of mainstream device protocols. Then, the container is used as a carrier to quickly build application images for microservices and push them to the image warehouse. Finally, a highly available kubernetes cluster is used to implement distributed deployment, and the monitoring, evaluation and execution units are expanded on the basis of the original kubernetes architecture. When the maximum carrying capacity of the existing cluster is exceeded, the scale of the cluster is adjusted based on the evaluation results of the evaluation module to improve the carrying capacity of the cluster, thereby ensuring the performance and stability of the access platform service, and at the same time, when the cluster load is very low, the waste of resources is minimized.
[0042] The above-mentioned device access system is the hub connecting IoT collection devices and big data centers. It needs to solve the access, deployment and management problems of large-scale IoT devices. At the same time, it needs to have good performance, rapid distribution and deployment, and elastic scaling capabilities so that big data centers and terminal devices can be fully decoupled.
[0043] Figure 2 A schematic block diagram of an elastically scalable device access system 100 provided in an embodiment of the present invention. Figure 2 As shown, an elastically scalable device access system 100 includes a microservice architecture, on which a device access unit 101, a data processing unit 102, a monitoring unit 103, an evaluation unit 104 and an execution unit 105 are provided. The microservice architecture is used to encapsulate the device access unit 101 and the data processing unit 102, and supports the access of mainstream device protocols. The application image is built for the microservice using a container as a carrier, and is pushed to an image repository, and is distributedly deployed using a kubernetes cluster to obtain a distributed node working node and a master node; the device access unit 101 and the data processing unit 102 are deployed on the distributed node working node;
[0044] The device access unit 101 is used for providing device access;
[0045] The data processing unit 102 is used to process the transmission data of the connected device in real time to obtain a processing result; in this embodiment, the processing result refers to the result obtained by using Flink to calculate the transmission data of the device in real time and the corresponding data processing service.
[0046] The monitoring unit 103 is used to monitor the access index data of the device access unit 101 and the task processing index data of the data processing unit 102 to obtain a monitoring result; in this embodiment, the monitoring result refers to the access index data of the device access unit 101 and the task processing index data of the data processing unit 102. .
[0047] The evaluation unit 104 is used to perform load evaluation according to the monitoring result to obtain an evaluation result; in this embodiment, the evaluation result refers to the load conditions of the device access unit and the data processing unit determined according to the monitoring result.
[0048] The execution unit 105 is used to calculate the expected number of replicas of the replica set according to the evaluation result, and perform elastic expansion of the pod according to the expected number of replicas of the replica set. In this embodiment, the expected number of replicas of the replica set refers to the desired number of replica sets of the container.
[0049] In this embodiment, the system has the ability to automatically adjust resource supply based on changes in application load. Using containers as carriers, the microservice architecture quickly builds application images and pushes them to the image repository. When there is a need to deploy this project, directly pull the image to start the container. When the application load is too high, the system automatically increases resource supply to ensure the service quality of the application; when the application load decreases, the system promptly recycles idle resources to reduce application operating costs and improve resource utilization. When facing the situation where the maximum carrying capacity of the existing cluster is exceeded, the cluster's carrying capacity is increased by adjusting the size of the cluster, thereby ensuring the user experience and the stability of the platform service. When faced with tens of millions of devices connected to the city, a single service cannot handle all long connections. Based on the distance between the disaster device and the device access service cluster, the principle of nearby access is adopted to achieve horizontal expansion of cluster capabilities according to the distributed deployment in urban areas.
[0050] In one embodiment, see Figure 2 The above-mentioned device access unit 101 is used for device access, converting the private protocol reported by the device into the MQTT standard protocol according to the protocol parsing configuration, and converting the MQTT standard protocol transmitted to the device into the device private protocol to obtain transmission data.
[0051] Specifically, the device access unit 101 is responsible for device access to the network. By adding protocol parsing configuration services and standard protocol parsing services, it supports the access of more private protocol devices through simple configuration, improves device access efficiency and access capabilities, including protocol parsing configuration services, standard protocol parsing services, device access services and routing forwarding services. Among them, the protocol parsing configuration service realizes the conversion relationship between the private Internet of Things protocol and the standard MQTT protocol through mapping configuration; the device access unit 101 converts the private protocol reported by the device into the MQTT standard protocol according to the protocol parsing configuration and converts the MQTT standard protocol sent by the platform to the device into the device private protocol; the standard protocol parsing service realizes the conversion between the private protocol and the MQTT standard protocol; the routing forwarding service realizes the secure transmission of data to the EMQX middleware.
[0052] In one embodiment, the data processing unit 102 includes EMQX middleware and a kubernetes container;
[0053] The EMQX middleware is used to buffer the transmission data output by the device access unit 101;
[0054] The kubernetes container is used to process the transmission data using flink to obtain a processing result.
[0055] Specifically, the data processing unit 102 solves the performance bottleneck problem caused by large-scale equipment concurrently reporting data, realizes real-time processing of equipment data, introduces EMQX, a message middleware with high throughput, which is used as access layer data buffer, and keeps it separate from the big data center to achieve the purpose of peak shaving and valley filling, and heterogeneous decoupling. At the same time, using the powerful scalability of the kubernetes container, the data processing service customized and developed based on the flink real-time computing system is used as real-time preprocessing of equipment access data, and the processed result data is written to the big data center.
[0056] See also Figure 4 , the device access unit 101 realizes the access of various heterogeneous devices, encapsulates the processes such as the access of the underlying device and data communication transmission, supports the access of mainstream IoT protocols, and selects the lightweight and highly reliable MQTT protocol as the standard communication protocol. The local computing power of disaster equipment is limited, and more networking decisions are required. The characteristics of the equipment determine that there are high requirements for real-time performance. When facing the access of tens of millions of devices, a single service cannot handle all long connections. Therefore, based on the size of the disaster device from the device access service cluster, the principle of nearby access is adopted, and the cluster capacity is expanded horizontally according to the distributed deployment in the urban area, which can effectively solve the problem of concurrent access of tens of millions of devices; the data processing unit 102 mainly solves the performance bottleneck when large-scale devices report data concurrently. It is used as an access layer data buffer through the message middleware, separated from the big data center, and achieves the purpose of peak shaving and valley filling and heterogeneous decoupling. The data processing service pre-processes the accessed device data and writes the processing result data to the big data center for storage.
[0057] In this embodiment, the above-mentioned kubernetes cluster adopts high-availability active / standby deployment for the master node, and expands the three units of monitoring, evaluation and execution based on the original kubernetes architecture. Etcd uses a three-node cluster to ensure high availability, and the device access unit 101 and the data processing unit 102 are deployed on the distributed node working node. When the maximum carrying capacity of the existing cluster is exceeded, the scale of the cluster is adjusted based on the evaluation result of the evaluation unit 104 to improve the cluster's carrying capacity, thereby ensuring the performance and stability of the access platform service; when the cluster load is very low, the cluster scale is reduced to minimize resource waste.
[0058] In one embodiment, see Figure 2 The monitoring unit 103 is used to collect relevant indicator data of the device access unit 101 and the single node of the data processing unit 102 and the relevant POD resources to obtain cluster-level monitoring data, hierarchically aggregate the data, store and visualize the data to obtain monitoring results.
[0059] Specifically, Kubernetes currently supports the HPA controller to obtain metrics from three different APIs, Metrics.k8s.io, Custom..k8s.io, and External..k8s.io. The load information of the node container is mainly collected by the cAdvisor component in the kubelet component. In the kubernetes cluster, each node that starts kubelet uses the metrics interface provided by cAdvisor to obtain the performance indicator data related to all containers of the pod node. cAdvisor can only collect the relevant indicator data of the device access unit and the single node of the data processing unit and the relevant POD resources, and obtain cluster-level monitoring data through the metrics server. The metrics server runs as a pod object and obtains the usage data of various resources in the workload from the cAdvisor built into the kubelet of all nodes in the cluster. The data is then hierarchically aggregated and finally imported into prometheus for storage. Grafana is used for visualization to periodically collect the operation indicator data of the service instance.
[0060] The load of the device access unit 101 is closely related to the number of access devices and the data collection cycle. Therefore, the number of device access and the data collection cycle indicators are supplemented by custom indicators as evaluation extension indicators. The device data collection cycle is a fixed value, and the number of device access is the number of real-time access devices of the device access layer service in different regions. The relevant data is stored in the big data center; the load of the data processing unit 102 is mainly closely related to the size of the data processing capacity. Here, the size of the message middleware backlog queue and the historical average processing capacity indicator of a single node are supplemented as evaluation extension indicators. The size of the message middleware backlog queue is updated to the big data center by periodically reading information when the data processing service consumes queue data. The historical average processing capacity of a single node is measured by a comprehensive measure of historical processing data and load conditions, and the relevant data is stored in the big data center.
[0061] In one embodiment, see Figure 3 The monitoring unit 103 is responsible for obtaining the load information of the pod replica set, completing the indicator data monitoring, storage, abnormal alarm and visualization. The load information of the node container is collected by the cAdvisor component in the kubelet component, and the custom indicators collect related indicators from the big data center through prometheus. Since the data formats of the two are incompatible, the data collected by prometheus needs to be converted into a format that can be recognized by the k8sapi interface through the prometheus adapter. The evaluation unit 104 evaluates the indicator data.
[0062] In one embodiment, see Figure 2 The above-mentioned evaluation unit 104 is used to perform load evaluation on the device access unit 101 and the data set access unit according to the monitoring result to obtain an evaluation result.
[0063] Specifically, Kubernetes currently only supports CPU and memory scaling policies by default, but not all systems are suitable for using CPU and memory indicators to measure their load. In many cases, the use of CPU and memory cannot truly reflect the actual operation of the business. Using them to expand and shrink containers will lead to inaccurate problems, and even the recycling of containers for unfinished business requests. Based on the characteristics of fixed data collection cycles and large data volumes of urban disaster equipment, this system adopts a threshold responsive scaling method, and selects different threshold indicators for evaluation of the device access unit 101 and the data processing unit 102.
[0064] The service of the device access unit 101 is based on the basic performance indicators of the access device, integrating the number of device accesses and the collection cycle as measurement indicators; the basic performance indicators of the service of the data processing unit 102 integrate the number of tasks in the message middleware backlog queue and the historical average processing capacity indicators of a single processing node as measurement indicators. All existing POD load conditions are evaluated, and the objects to be expanded or reduced are discovered and selected, and then the designated microservices are expanded or reduced to ensure that the load of the replica set is always in the target state and meet the balance between resource demand and supply.
[0065] In one embodiment, see Figure 2 The above-mentioned evaluation unit 104 is used to evaluate the number of service instances that are expanded when the number of concurrent node connections corresponding to the device access unit 101 is not less than a preset upper critical value, or the number of task backlogs of the data processing unit 102 is higher than a preset upper threshold; and the evaluation result is the number of service instances that are reduced when the number of concurrent node connections corresponding to the device access unit 101 is lower than a preset lower critical value, or the number of task backlogs of the data processing unit 102 is lower than a preset lower threshold.
[0066] Specifically, the evaluation process of the device access unit 101 is as follows: the number of concurrent device accesses can truly reflect the load of the actual service, and the maximum number of long connections that the service can handle is the maximum processing capacity of a single access service node. Therefore, the number of concurrent access devices is selected as the evaluation indicator. Due to the differences in the collection cycle and number of different devices, the maximum number of long connections that a single service of different devices can handle will also be different. The maximum number of connections of different devices is obtained by fitting the historical operation data of different devices. When the number of concurrent node connections is greater than or equal to the maximum critical value, the number of service instances is expanded; if it is lower than a certain critical value, the number of service instances is shrunk in a certain way.
[0067] The evaluation process of the data processing unit 102 is as follows: the number of tasks that can be processed by the data processing unit 102 in a service unit time can truly reflect the load of the processing service, so the number of tasks in the message middleware backlog queue is selected as the evaluation indicator, and the maximum and minimum backlog tasks are obtained by fitting the historical processing data. When the number of task backlogs is higher than a certain threshold and exceeds the processing capacity of the existing processing service, the number of processing service instances is expanded; if it is lower than a certain threshold, the number of processing service instances is shrunk in a certain way.
[0068] In one embodiment, see Figure 2 The execution unit 105 is used to calculate the expected number of replicas of the replica set according to the evaluation result, calculate the scaling amount according to the expected number of replicas of the replica set, and perform elastic expansion of the pod according to the scaling amount.
[0069] In one embodiment, see Figure 2 The above-mentioned execution unit 105 is used to calculate the expected number of replicas of the replica set according to the evaluation result, and calculate the scaling amount according to the expected number of replicas of the replica set. When the expected number of replicas of the replica set is greater than the current number of replicas, capacity expansion is performed according to the scaling amount; when the expected number of replicas of the replica set is less than the current number of replicas, capacity reduction is performed according to the scaling amount.
[0070] Specifically, the expected number of replicas of the replica set is calculated based on the evaluation result of the evaluation unit 104, and the expected number of replicas is sent to the replica controller Deployment. The replica controller calculates the scaling amount based on the expected number of replicas; if the expected number of replicas is greater than the current number of replicas, then the capacity is expanded; if it is less than, then the capacity is reduced. Then Kubelet obtains pod creation or deletion information through the API Server, specifically performs creation and deletion work, and adjusts the number of replicas in the specified container set to achieve microservice horizontal expansion and contraction. When the application load is too high, the system automatically increases resource supply to ensure the service quality of the application; when the application load decreases, the system promptly recycles idle resources to reduce application operating costs and improve resource utilization.
[0071] In one embodiment, if Figure 1As shown, the elastically scalable device access system realizes distributed deployment with a highly available kubernetes cluster. Based on the characteristics of fixed data collection cycle and large data volume of disaster equipment, the three units of monitoring, evaluation and execution are expanded on the basis of the original kubernetes architecture. The monitoring unit 103 obtains the performance index data reported by the device access unit 101 and the data processing unit 102. The evaluation unit 104 performs load evaluation based on the service performance sequence index, Pod node index, Node node index, etc. of the monitoring results. The execution unit 105 is responsible for calculating the expected replica set, that is, the expected number of replicas of the replica set, and completing the elastic expansion of the pod. Among them, the master node is the central control node of the cluster, responsible for the management and control of the entire cluster, and responsible for resource scheduling, access control, service interface, and pod life cycle control. The Node node is the above-mentioned distributed node working node. The node is the workload node of the kubernetes cluster. It is managed by the master node and performs the tasks assigned by the master node. The Node node can be dynamically added to the kubernetes cluster during operation, and when a node node goes down, the workload on it will be automatically transferred to other nodes by the master node. The core function of the API server module is to provide functions such as adding, deleting, modifying, and checking various resource objects of kubernetes and watching HTTP rest interfaces. It is the central hub for data interaction and communication between cluster modules. Each functional module in the cluster stores information in the etcd component through the API server. Deployment is responsible for ensuring that the number of copies of the pod associated with a resource object RC in the cluster remains the expected value at any time; Etcd is a persistent, lightweight distributed key-value data storage system used to store cluster configuration data. Kubernetes uses etcd to save the network configuration information of the cluster and the status and original information of various objects. Each node node will run a kubelet process, which executes the tasks sent to each node by the master node and specifically manages the pods on the node and the containers in the pod. Each kubelet process will also register its own information on the API server and regularly return the information of this node to the master node. Kube-proxy is used to solve the problem of external network access to application service programs in the cluster. It runs on the node node as a network proxy for microservices and is responsible for forwarding access requests to microservices to the corresponding set of pod instances.
[0072] The above-mentioned elastically scalable device access system 100 is provided with a device access unit 101, a data processing unit 102, a monitoring unit 103, an evaluation unit 104 and an execution unit 105 on a microservice architecture, and is distributedly deployed in a kubernetes cluster. When the application load is reduced, idle resources are recovered in time to reduce the application operation cost and improve resource utilization. When the maximum carrying capacity of the existing cluster is exceeded, the scaling amount is determined according to the evaluation results, and the scale of the cluster is adjusted to improve the carrying capacity of the cluster, thereby ensuring the user experience and the stability of the platform service.
[0073] In one embodiment, a working method of an elastically scalable device access system 100 is also provided, including:
[0074] The device access unit 101 accesses the device;
[0075] The data processing unit 102 processes the transmission data of the connected device in real time to obtain a processing result;
[0076] The monitoring unit 103 monitors the access index data of the device access unit 101 and the task processing index data of the data processing unit 102 to obtain a monitoring result;
[0077] The evaluation unit 104 performs load evaluation according to the monitoring result to obtain an evaluation result;
[0078] The execution unit 105 calculates the expected number of replicas of the replica set according to the evaluation result, and elastically expands the pod according to the expected number of replicas of the replica set.
[0079] Specifically, the execution unit 105 calculates the expected number of replicas of the replica set according to the evaluation result, and elastically expands the pod according to the expected number of replicas of the replica set, including:
[0080] The execution unit 105 periodically checks the load status of all replicas in the pod replica set according to the evaluation unit 104, automatically adjusts the number of replicas, calculates the expected number of replicas of the replica set according to the scaling strategy, checks the expected number of replicas of the replica set and the current number of replicas, and executes container expansion when the expected number of replicas of the replica set is greater than the current number of replicas; when the expected number of replicas of the replica set is less than the current number of replicas, executes container reduction.
[0081] Deploy the microservice to the kubernetes cluster in the form of a pod and allocate the resources required for its operation, including cpu, memory, and storage. Kubernetes assigns a globally unique virtual IP address to each service, which is called the cluster IP. Once a service is created, its cluster IP will not change throughout its life cycle, so service discovery can be easily achieved. The demonstration application or other services can access the service through the cluster IP plus the port number. Service is equivalent to a microservice in the microservice architecture. It is an abstraction of a group of pods providing services and represents the access entrance of a service. Users or other services can access their abstract pods through this entrance, and the service will automatically forward the request to the pod. HPA tracks and analyzes the load change information of all target pods and uses Deployment control to adjust the number of replicas of the target pod. The execution unit 105 automatically adjusts the number of replicas by periodically checking the load status of all replicas in the pod replica set, ensuring the quality of application services while improving the resource utilization of the cluster. The expected number of replicas is calculated according to the scaling strategy, and the replica controller Deployment checks the expected number of replicas and the current number of real replicas. If the expected value is greater than the real value, it will be expanded, and if the expected value is less than the real value, it will be reduced.
[0082] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the working method of the above-mentioned elastically scalable device access system 100 can refer to the corresponding description in the above-mentioned elastically scalable device access system 100 embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0083] In the several embodiments provided by the present invention, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0084] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0085] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. An elastically scalable device access system, characterized in that: The invention comprises a microservice architecture, wherein the microservice architecture is provided with a device access unit, a data processing unit, a monitoring unit, an evaluation unit and an execution unit. The microservice architecture is used to encapsulate the device access unit and the data processing unit, and supports the access of mainstream device protocols. The application image is constructed for the microservice using a container as a carrier, and is pushed to an image repository, and is distributedly deployed using a kubernetes cluster to obtain distributed node working nodes and a master node; the device access unit and the data processing unit are deployed on the distributed node working nodes; The device access unit is used for device access; the number of device access and the data collection period index are selected as evaluation extension indicators through custom indicators, the access index data belonging to the device access unit, the device data collection period is a fixed value, the number of device access is the number of real-time access devices of the device access layer service in different regions, and the relevant data is stored in the big data center; The data processing unit is used to process the transmission data of the connected device in real time to obtain a processing result; The size of the message middleware backlog queue and the historical average processing capacity index of a single node are selected as evaluation extension indicators, which belong to the task processing index data of the data processing unit. When the message middleware backlog queue size consumes queue data through the data processing service, the information is periodically read and updated to the big data center. The historical average processing capacity of a single node is comprehensively measured by historical processing data and load conditions, and the relevant data is stored in the big data center; The monitoring unit is used to monitor the access index data of the device access unit and the task processing index data of the data processing unit to obtain a monitoring result; The evaluation unit is used to perform load evaluation according to the monitoring result to obtain an evaluation result; The execution unit is used to calculate the expected number of replicas of the replica set according to the evaluation result, and perform elastic expansion of the pod according to the expected number of replicas of the replica set.
2. The elastically scalable device access system according to claim 1, characterized in that: The device access unit is used for device access, converting the private protocol reported by the device into the MQTT standard protocol according to the protocol parsing configuration, and converting the MQTT standard protocol transmitted to the device into the device private protocol to obtain transmission data.
3. The elastically scalable device access system according to claim 2, characterized in that: The data processing unit includes EMQX middleware and kubernetes container; The EMQX middleware is used to buffer the transmission data output by the device access unit; The kubernetes container is used to process the transmission data using flink to obtain a processing result.
4. The elastically scalable device access system according to claim 1, characterized in that: The monitoring unit is used to collect relevant indicator data of the single node of the device access unit and the data processing unit and the relevant POD resources to obtain cluster-level monitoring data, hierarchically aggregate the monitoring data, and store and visualize the hierarchically aggregated monitoring data to obtain monitoring results.
5. The elastically scalable device access system according to claim 1, characterized in that: The evaluation unit is used to perform load evaluation on the device access unit and the data set access unit according to the monitoring result to obtain an evaluation result.
6. The elastically scalable device access system according to claim 5, characterized in that: The evaluation unit is used to evaluate the number of service instances expanded when the number of concurrent connections of the node corresponding to the device access unit is not less than a preset upper critical value, or the number of task backlogs of the data processing unit is higher than the preset upper threshold; and the number of service instances reduced when the number of concurrent connections of the node corresponding to the device access unit is lower than a preset lower critical value, or the number of task backlogs of the data processing unit is lower than the preset lower threshold.
7. The elastically scalable device access system according to claim 1, characterized in that: The execution unit is used to calculate the expected number of replicas of the replica set according to the evaluation result, calculate the scaling amount according to the expected number of replicas of the replica set, and perform elastic capacity expansion of the pod according to the scaling amount.
8. The elastically scalable device access system according to claim 7, characterized in that: The execution unit is used to calculate the expected number of replicas of the replica set according to the evaluation result, and calculate the scaling amount according to the expected number of replicas of the replica set. When the expected number of replicas of the replica set is greater than the current number of replicas, capacity expansion is performed according to the scaling amount; when the expected number of replicas of the replica set is less than the current number of replicas, capacity reduction is performed according to the scaling amount.
9. A working method of an elastically scalable device access system, characterized in that: include: The device access unit accesses the device; The number of device accesses and the data collection period index are selected as evaluation extension indexes through custom indexes, which belong to the access index data of the device access unit. The device data collection period is a fixed value. The number of device accesses is the number of real-time access devices of the device access layer service in different regions. The relevant data is stored in the big data center. The data processing unit processes the transmission data of the connected device in real time to obtain the processing result; The size of the message middleware backlog queue and the historical average processing capacity index of a single node are selected as evaluation extension indicators, which belong to the task processing index data of the data processing unit. When the message middleware backlog queue size consumes queue data through the data processing service, the information is periodically read and updated to the big data center. The historical average processing capacity of a single node is comprehensively measured by historical processing data and load conditions, and the relevant data is stored in the big data center; The monitoring unit monitors the access index data of the device access unit and the task processing index data of the data processing unit to obtain a monitoring result; The evaluation unit performs load evaluation according to the monitoring result to obtain an evaluation result; The execution unit calculates the expected number of replicas of the replica set according to the evaluation result, and elastically expands the pod according to the expected number of replicas of the replica set; The microservice architecture encapsulates the device access unit and the data processing unit, supports the access of mainstream device protocols, uses containers as carriers to build application images for microservices, pushes them to the image repository, and deploys them in a distributed manner using a kubernetes cluster to obtain distributed node working nodes and master nodes. The device access unit and the data processing unit are deployed on the distributed node working nodes.
10. The working method of the elastically scalable device access system according to claim 9, characterized in that: The execution unit calculates the expected number of replicas of the replica set according to the evaluation result, and elastically expands the pod according to the expected number of replicas of the replica set, including: The execution unit periodically checks the load status of all replicas in the pod replica set according to the evaluation unit, automatically adjusts the number of replicas, calculates the expected number of replicas of the replica set according to the scaling policy, checks the expected number of replicas of the replica set and the current number of replicas, and executes container expansion when the expected number of replicas of the replica set is greater than the current number of replicas; when the expected number of replicas of the replica set is less than the current number of replicas, the container is reduced.
Citation Information
Patent Citations
A Kubernetes copy capacity expanding and shrinking method and system
CN109446032A
Online application dynamic capacity expansion and shrinkage method based on micro-service call dependence perception
CN112199150A
Intelligent power plant management and control system based on micro-service architecture
CN112379653A
System capacity expansion method and equipment of cluster and medium
CN113064696A
Internet of Things platform construction method based on micro-service architecture
CN113110914A
