Internet of things gateway-oriented dynamic MQTT Topic intelligent subscription and traffic optimization system and method

Through the intelligent prediction and dynamic resource scheduling module, the MQTT Topic subscription and resource allocation of the IoT gateway are dynamically adjusted, which solves the communication efficiency and resource management challenges of the IoT gateway when processing large amounts of data, and achieves efficient traffic optimization and resource utilization. Ensure the stable operation of the system.

CN118659976APending Publication Date: 2024-09-17山东浪潮智慧建筑科技有限公司
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202410763961.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

When IoT gateways process large amounts of device status updates and environmental monitoring data, there are communication efficiency and resource management challenges. The static subscription mechanism of the traditional MQTT protocol leads to resource occupation and data transmission delays, and lacks the ability to adapt to dynamic changes, making it difficult to cope with The problem of data flood and uneven resource distribution.

Method used

Use the intelligent prediction module to predict Topic activity and data volume, dynamically adjust the MQTT Topic subscription list, and use the dynamic resource scheduling and optimization module to combine time series prediction, cluster analysis and anomaly detection technology to implement dynamic resource scheduling strategies to achieve traffic optimization and Resource balancing.

Benefits of technology

Significantly improves the data processing capabilities and resource utilization efficiency of the IoT system, reduces unnecessary communication and data processing burdens, avoids excessive consumption and waste of resources, reduces operating costs, and ensures the instant transmission of key data and system security Efficient and stable operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118659976A
    Figure CN118659976A
Patent Text Reader

Abstract

The invention provides an Internet of Things gateway-oriented dynamic MQTT Topic intelligent subscription and traffic optimization system and method, and belongs to the technical field of Internet of Things communication. The system comprises an intelligent prediction module, a dynamic MQTT Topic management module and a dynamic resource scheduling and optimizing module. According to the invention, intelligent dynamic adjustment of the MQTT Topic subscription list and adaptive balance of uplink and downlink traffic are realized. Through the prediction model, the Topic activity trend and the gateway resource demand are predicted, the subscription state of non-key or low-frequency Topic is dynamically adjusted, the transmission efficiency of key data is preferentially ensured, and meanwhile, an intelligent caching and batch transmission mechanism is adopted to reduce network requests and optimize network resource utilization. According to the method, the response speed, the data transmission efficiency and the overall stability of the system of Internet of Things communication are effectively improved, the method is suitable for various large-scale Internet of Things deployment scenes, and particularly, a remarkable performance optimization effect is shown under the condition that resources are limited or communication is asymmetric.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a dynamic MQTT Topic intelligent subscription and traffic optimization system and method for an Internet of Things gateway, belonging to the technical field of Internet of Things communications. Background Art

[0002] With the rapid expansion of the Internet of Things (IoT), IoT gateways are becoming increasingly important as a bridge between edge computing and cloud computing. These gateway devices not only need to process massive amounts of data reported from thousands of sensor nodes, but are also responsible for receiving control commands issued by the cloud to achieve remote monitoring and management. However, the asymmetry between data reporting and command reception that is prevalent in IoT scenarios poses severe challenges to the communication efficiency and resource management of gateways.

[0003] Specifically, most IoT applications tend to generate a large amount of device status updates and environmental monitoring data, which are reported to the cloud server through different MQTT Topics in a frequent and irregular manner. In contrast, the control instructions or configuration updates from the cloud to the gateway are relatively few and usually have low time sensitivity. This communication mode causes the uplink to be frequently in a high-load state, while the downlink resources are relatively idle. The traditional MQTT protocol design does not fully consider this asymmetry. Its static subscription mechanism forces the gateway to continuously monitor all possible Topics, regardless of their actual communication activity. This not only takes up valuable network and computing resources, but may also increase data transmission delays, affecting the system's response speed and data processing efficiency.

[0004] In addition, the dynamic nature of the IoT environment means that device access modes, data reporting frequencies, and network conditions may fluctuate over time, and most current MQTT applications lack the ability to adapt to such dynamic changes. For example, during certain periods of time or under certain conditions, the data generation of certain topics may be greatly reduced, and traditional systems cannot release network and computing resources that are no longer necessary in a timely manner. Conversely, during periods of high data generation, the system may not be able to effectively cope with data peaks due to uneven resource allocation, resulting in data loss or network congestion.

[0005] Therefore, the industry is in urgent need of an innovative technical solution that can intelligently identify the actual communication needs of the gateway at different times and conditions, dynamically adjust the subscription list of the MQTT Topic, and achieve effective management and optimization of uplink traffic. At the same time, the solution also needs to integrate the traffic control mechanism to dynamically balance the resource allocation of uplink and downlink links to ensure the instant transmission of key data and the efficient and stable operation of the overall system. In addition, considering the diversity of IoT devices and the complexity of the network environment, this solution should also have good scalability and flexibility, and be widely applicable to various IoT application scenarios. Summary of the invention

[0006] The purpose of the present invention is to provide a dynamic MQTT Topic intelligent subscription and traffic optimization system and method for IoT gateways, which can significantly improve the data processing capability and resource utilization efficiency of IoT systems.

[0007] In order to achieve the above object, the present invention is implemented through the following technical solutions: Intelligent prediction module: It is configured to predict the activity and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions; Dynamic MQTT Topic Management Module: It is configured to dynamically adjust the MQTT Topic subscription list of the IoT gateway according to the activity of each Topic predicted by the intelligent prediction model; Dynamic resource scheduling and optimization module: It is configured to combine the intelligent prediction model to predict the data volume of each topic and the current network status, and implement dynamic resource scheduling strategies.

[0008] Preferably, the intelligent prediction model includes: Time series prediction module: configured to predict the activity and data volume of each topic; Cluster analysis module: It is configured to extract the clustering features of topics and cluster topics using the K-means clustering algorithm; Anomaly detection module: is configured to continuously monitor real-time data streams to identify abnormal data flows or device behaviors.

[0009] Preferably, the dynamic MQTT Topic management module includes: Dynamic Topic Registration and Deregistration Module: configured to create or cancel Topic subscriptions; Dynamic permission control module: It is configured to dynamically adjust the device's Topic access rights based on the device role and permission policy; Adaptive load balancing module: It is configured to deploy MQTT Broker and achieve high availability and load sharing through cluster configuration; develop or integrate load balancing middleware, monitor Broker CPU usage, memory usage and network traffic, and dynamically adjust Topic allocation based on Topic activity; monitor system performance and automatically trigger Topic migration between Brokers based on real-time load conditions; Topic lifecycle management module: It is configured to monitor the activity of each Topic, deregister Topics whose activity is below the set threshold, and record Topic lifecycle events.

[0010] Preferably, the dynamic resource scheduling and optimization module includes: Resource demand prediction module: It is configured to use the CPU, memory, storage and network traffic log data of the gateway based on the Prophet time series model to predict resource requirements in different time windows, including CPU reservation percentage, estimated memory usage, storage requirements and expected network bandwidth; Resource elastic scaling module: is configured to obtain the resource demand of the resource demand prediction module and trigger the dynamic expansion of cloud-side resources based on the prediction results; Edge caching module: is configured to deploy edge caching mechanism on edge computing nodes to optimize the response speed of the IoT system.

[0011] Preferably, the resource elastic scaling module integrates AWS CloudFormation template automatic configuration and AWS Auto Scaling group, sets warning thresholds for CPU usage, memory utilization and network traffic in AWS CloudWatch, and triggers the increase or decrease of instances when the monitoring indicators reach the preset thresholds; sets CloudWatch Alarms to monitor Auto Scaling activities and resource usage.

[0012] Preferably, the edge cache module uses AWS Greengrass service to deploy edge nodes, installs Redis as a cache database on each Greengrass core device, customizes the cache strategy through the Greengrass Lambda function, configures the data type implemented by the local cache, and configures the data expiration time; uses AWS IoT Core and DynamoDB Stream to ensure data consistency between the edge cache and the cloud database, and reduces data transmission by implementing an incremental synchronization strategy; integrates CloudWatch Metrics to monitor the edge cache hit rate, response time, and resource usage, and regularly adjusts the cache strategy and resource allocation based on the monitoring data.

[0013] A dynamic MQTT Topic intelligent subscription and traffic optimization method for an Internet of Things gateway, comprising: Establish an intelligent prediction model, collect historical data, and train the model after preprocessing. The historical data includes Topic activity, data volume, and timestamp; Use the trained intelligent prediction model to predict the activity and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions; Dynamically adjust the MQTT Topic subscription list of the IoT gateway based on the activity of each Topic predicted by the intelligent prediction model; unsubscribe from low-activity Topics to reduce unnecessary network monitoring, including monitoring of non-critical or low-activity Topics, monitoring of invalid or abandoned Topics, repeated monitoring, and monitoring of data streams during non-working hours; subscribe to high-activity Topics; Calculate the amount of resources required by the gateway based on the amount of data for each topic predicted by the intelligent prediction model; Cloud-edge collaborative resource allocation connects with the cloud platform through APIs to dynamically adjust cloud-side resources. During peak data traffic periods, cloud instances are started or bandwidth is increased to meet demand. During low traffic periods, excess resources are released. The peak data traffic period is when the predicted data volume exceeds twice the average of the past 30 days, and the low data traffic period is when the data volume is less than 50% of the average of the past 30 days.

[0014] Preferably, the intelligent prediction model includes a time series prediction module and a cluster analysis module; the cluster analysis module adopts a K-means clustering algorithm; The time series prediction module includes the ARIMA model and the LSTM model. The data processing process is as follows: Use the Pandas library to clean data, remove missing or outliers, and construct features based on time series characteristics, including topic activity, data volume, and timestamps; Determine the stationarity of the time series through the ADF test, determine the d value of the ARIMA model, use the ACF and PACF graphs to remove the p and q values, use the statsmodels library to build and train the ARIMA (p, d, q) model, and optimize the parameters through the AIC criterion; The time series data is converted into a supervised learning format, and input and output samples are constructed by a sliding window method; the LSTM model includes an embedding layer, an LSTM layer, and an output layer; the MSE is used as a loss function, and the model is trained by an Adam optimizer; Based on the cross-validation results, weights are assigned to the ARIMA and LSTM models to achieve weighted fusion prediction; The performance of the time series prediction module is evaluated based on the validation set, and the fusion strategy is adjusted based on the results.

[0015] Preferably, the intelligent prediction model is also provided with an anomaly detection mechanism, and the anomaly detection mechanism continuously monitors the real-time data stream. The specific steps are as follows: Calculate the long-term average and standard deviation of each key indicator to establish a statistical baseline of normal behavior; the key indicators include: message frequency, data volume, message interval, network delay, error rate, and device online rate; The standard scores of the data points relative to the mean were calculated, and any data point exceeding three standard deviations was marked as an outlier; The Isolation Forest algorithm is used to identify outliers, and the anomaly score output by the model is used for the final anomaly decision. Negative values ​​represent normal data points, and positive values ​​represent abnormal data points.

[0016] The advantages of the present invention are: The present invention can predict the activity and data volume of different Topics and the expected frequency of cloud control instructions through the intelligent prediction module, thereby optimizing the MQTT Topic subscription list of the Internet of Things gateway, reducing unnecessary communication and data processing, and improving the overall efficiency of the system.

[0017] The dynamic MQTT Topic management module can dynamically adjust the subscription list according to the activity of the Topic, further reducing unnecessary network traffic and data processing burden.

[0018] The dynamic resource scheduling and optimization module can implement dynamic resource scheduling strategies based on predicted resource requirements and current network conditions, avoiding excessive consumption and waste of resources and reducing operating costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0020] Figure 1 It is a schematic diagram of the system structure of the present invention.

[0021] Figure 2 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0022] 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 only 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.

[0023] Example 1 like Figure 1 As shown, a dynamic MQTT Topic intelligent subscription and traffic optimization system for IoT gateways includes: Intelligent prediction module: It is configured to predict the activity and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions.

[0024] Dynamic MQTT Topic Management Module: It is configured to dynamically adjust the MQTT Topic subscription list of the IoT gateway according to the activity of each Topic predicted by the intelligent prediction model.

[0025] Dynamic resource scheduling and optimization module: It is configured to combine the intelligent prediction model to predict the data volume of each topic and the current network status, and implement dynamic resource scheduling strategies.

[0026] As a refinement of the above system, the intelligent prediction model can predict the activity and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions. The model uses time series analysis, clustering algorithms and anomaly detection technology to accurately identify the patterns and trends of data reporting and instruction reception, providing a decision-making basis for subsequent dynamic resource adjustments.

[0027] The intelligent prediction model includes: (1) Time series prediction module: This module is the core component of the intelligent prediction model. Its main task is to accurately predict the activity and data volume of each topic in the future.

[0028] (2) Cluster analysis module: This module conducts in-depth analysis of device behavior patterns and groups devices with similar data generation characteristics. Specifically, it uses the K-means clustering algorithm, including: Feature extraction: Extract the number of daily data transmissions, transmission time distribution, data packet size, etc. of the device as clustering features.

[0029] K-means clustering implementation: determine the K value using the elbow rule, calculate the intra-cluster sum of squares (WCSS) under different K values, and select the "elbow point" where the WCSS growth rate suddenly changes as the optimal K value; model application: use Scikit-learn's KMeans algorithm and set a certain K value to group devices; result evaluation: evaluate clustering quality through silhouette coefficient.

[0030] Strategy application: Based on the clustering results, resource allocation and communication optimization strategies are customized for each group.

[0031] (3) Anomaly detection module: In the IoT environment, abnormal data flow or device behavior may cause network congestion, resource waste, and even security threats. Therefore, the present invention designs a comprehensive anomaly detection mechanism that combines statistical methods and machine learning algorithms to continuously monitor real-time data flows. The detection steps are as follows: Statistical baseline construction: Calculate the long-term average and standard deviation of each key indicator to establish a statistical baseline of normal behavior.

[0032] Z-score processing: The standard score of data points relative to the mean is calculated in real time, and any data point exceeding 3σ is marked as an anomaly.

[0033] Isolation Forest processing: Use Scikit-learn's IsolationForest algorithm to train the model on historical data, set appropriate contamination parameters to represent the proportion of outliers in the data set; apply the model to the real-time data stream and make decisions based on the anomaly score it outputs (usually negative values ​​represent normal and positive values ​​represent abnormal).

[0034] As a refinement of the above system, the dynamic MQTT Topic management module dynamically adjusts the MQTT Topic subscription list of the IoT gateway according to the output of the intelligent prediction model. It automatically cancels the subscription of non-critical topics during the low data generation period to reduce unnecessary network monitoring, and pre-subscribes to topics with high traffic during the peak period to ensure smooth data transmission. Specifically, it includes: (1) Dynamic Topic Registration and Deregistration Module: Set up an API interface to allow devices to send requests to the Broker to create new topics when needed; the device request contains metadata such as the Topic name, QoS level, and intended use, and the Broker executes Topic creation after verification according to preset rules; when the device is offline or no longer needs a specific Topic, the Broker automatically detects and executes the Topic deregistration process, or receives an explicit deregistration request from the device; use a database or memory cache to record the Topic status to ensure that the system can track the life cycle of each Topic in real time.

[0035] (2) Dynamic permission control module: Develop a permission management system. When a device is connected for the first time or its permissions are changed, it requests an access token from the authentication server, which contains information such as the device role and the list of topics allowed to be operated. When the Broker receives a subscription / publish request from the device, it verifies the validity of the token and the scope of permissions to decide whether to approve the operation. The system administrator dynamically adjusts the device role and permission policy through the management interface to affect the device's topic access rights in real time.

[0036] (3) Adaptive load balancing module: deploy multiple MQTT Brokers and configure clusters to achieve high availability and load sharing; develop or integrate ready-made load balancing middleware that dynamically adjusts Topic allocation based on Broker CPU usage, memory usage, and network traffic; implement strategies such as Topic hashing or polling to ensure that Topics are evenly distributed across Brokers, while dynamically rebalancing based on Topic activity; monitor system performance and automatically trigger Topic migration between Brokers based on real-time load conditions to optimize resource usage.

[0037] (4) Topic lifecycle management module: Establish a regular scanning mechanism to check the most recent activity time of each topic and the preset threshold; for topics that have been inactive for more than the set period, automatically send notifications to the relevant devices or administrators to confirm whether to retain them; for topics that are not claimed or confirmed to be no longer in use, the system automatically performs the deregistration operation and clears the relevant records from the storage; record key events in the topic lifecycle, such as creation, activity, and deregistration time, to provide data support for system optimization and auditing.

[0038] As a refinement of the above system, the dynamic resource scheduling and optimization module combines the prediction results and the current network status to implement dynamic resource scheduling strategies, including on-demand allocation of CPU, memory, and bandwidth resources. Through cloud-edge collaborative optimization, efficient utilization and flexible allocation of resources are achieved. Specifically, it includes: (1) Resource demand prediction module: Resource demand prediction is the prerequisite for dynamic resource scheduling and optimization. This link focuses on future predictions based on data traffic and accurately estimates the resource demand of the IoT gateway in different time windows. Specifically, the prediction steps are as follows: Data collection and cleaning: Use the Fluentd tool to collect the CPU, memory, storage, and network traffic logs of the IoT gateway, and use the Pandas library for data cleaning and preprocessing.

[0039] Model selection and training: We use the Facebook open-source Prophet time series model because it is good at handling seasonal trends and easy to adjust parameters. We use cross-validation in the Python sklearn library to select the best parameters and then train the model.

[0040] Implement predictions: Build an automated script to use the trained Prophet model to predict resource requirements for the next 24 hours every day, and output a detailed resource requirement report, including CPU reservation percentage, estimated memory usage, storage requirements, and expected network bandwidth.

[0041] (2) Resource elastic scaling module: The resource elastic scaling mechanism is an automated adjustment strategy designed to cope with the ever-changing load conditions in IoT systems. When resource demand forecasts indicate an upcoming data peak, the system automatically triggers dynamic expansion of cloud resources. Specifically, it includes: API integration and configuration: Use AWS CloudFormation templates to automate configuration and integration with AWS Auto Scaling groups to ensure that the number of EC2 instances can be automatically adjusted as needed.

[0042] Threshold setting and rule creation: Set warning thresholds for CPU usage, memory utilization, and network traffic in AWS CloudWatch, and create corresponding Auto Scaling policies. When the monitoring indicators reach the preset thresholds, they trigger the increase or decrease of instances.

[0043] Real-time monitoring and feedback loop: Set up CloudWatch Alarms to monitor Auto Scaling activities and resource usage to ensure that resource adjustments are effective, and perform manual intervention through email notifications when necessary.

[0044] (3) Edge caching module: The built-in edge caching strategy is a key part of optimizing the response speed of the IoT system. By deploying a caching mechanism at the edge computing node close to the data source, the time it takes for data to travel back and forth to the cloud can be significantly reduced, improving the immediacy of data processing and command response. Specifically, it includes: Edge node deployment: AWS Greengrass service is used to deploy edge nodes, which provides secure cloud management, automated software updates, and data synchronization capabilities.

[0045] Cache software implementation: Install Redis on each Greengrass core device as a cache database, and use its built-in Least Recently Used (LRU) strategy to automatically eliminate infrequently used data.

[0046] Policy configuration and optimization: Customize caching policies through Greengrass Lambda functions, implement local caching for specific types of data (such as device status updates and popular queries), and configure data expiration time to keep content fresh.

[0047] Data synchronization mechanism: AWS IoT Core and DynamoDB Stream are used to ensure data consistency between edge cache and cloud database, and unnecessary data transmission is reduced by implementing incremental synchronization strategy.

[0048] Performance monitoring and tuning: Integrate CloudWatch Metrics to monitor edge cache hit rate, response time, and resource usage, and regularly adjust cache strategy and resource allocation based on monitoring data to ensure optimal performance.

[0049] Example 2 like Figure 2 As shown, a dynamic MQTT Topic intelligent subscription and traffic optimization method for an IoT gateway includes: S1: Establish an intelligent prediction model, collect historical data, and train the model after preprocessing. The historical data includes Topic activity, data volume, and timestamp.

[0050] S2: Use the trained intelligent prediction model to predict the activity (i.e., data generation frequency) and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions.

[0051] S3: Dynamically adjust the MQTTTopic subscription list of the IoT gateway based on the activity of each Topic predicted by the intelligent prediction model; unsubscribe from low-activity Topics, reduce unnecessary network monitoring, and subscribe to high-activity Topics.

[0052] S4: Calculates the amount of resources required by the gateway based on the amount of data for each topic predicted by the intelligent prediction model, including CPU, memory, and network bandwidth requirements.

[0053] S5: Cloud-edge collaborative resource allocation, connecting with the cloud platform through API, dynamically adjusting cloud-side resources, starting cloud instances or increasing bandwidth to meet demand during peak data traffic periods, and releasing excess resources during low traffic periods.

[0054] Peak period: when it is predicted that data traffic will reach a peak and the predicted data volume exceeds twice the average of the past 30 days; Trough period: on the contrary, when the predicted data shows that the traffic has entered a trough period, that is, the data volume is less than 50% of the average of the past 30 days, the system automatically releases cloud instance resources that are no longer required and reduces bandwidth configuration to reduce unnecessary cost expenditure and achieve effective resource utilization and cost optimization.

[0055] As a refinement of the above steps, the intelligent prediction model in step S1 includes a time series prediction module and a cluster analysis module; the cluster analysis module adopts a K-means clustering algorithm; S1-1: The time series prediction module includes the ARIMA model and the LSTM model. The data processing process is as follows: S1-1-1: Use the Pandas library to clean data, remove missing or outliers, and construct features based on time series characteristics, including topic activity, data volume, and timestamp.

[0056] S1-1-2: Determine the stationarity of the time series through the ADF test, determine the d value of the ARIMA model, use the ACF and PACF graphs to remove the p and q values, use the statsmodels library to build and train the ARIMA (p, d, q) model, and optimize the parameters using the AIC criterion.

[0057] S1-1-3: Convert the time series data into a supervised learning format, and construct input and output samples through a sliding window method; the LSTM model includes an embedding layer, an LSTM layer, and an output layer; use MSE as a loss function and train the model through the Adam optimizer.

[0058] S1-1-4: Based on the cross-validation results, weights are assigned to the ARIMA and LSTM models to achieve weighted fusion prediction.

[0059] S1-1-5: Evaluate the performance of the time series prediction module based on the validation set and adjust the fusion strategy based on the results.

[0060] S1-2: The intelligent prediction model is also provided with an anomaly detection mechanism, and the anomaly detection mechanism continuously monitors the real-time data stream. The specific steps are as follows: S1-2-1: Calculate the long-term average and standard deviation of each key indicator to establish a statistical baseline of normal behavior; specifically, the key indicators include: Message frequency: The rate at which the number of messages received by each Topic changes over time.

[0061] Data volume: The size of each message or the cumulative amount of data received over a period of time, which is used to evaluate the load of data transmission.

[0062] Message interval: The time interval between two consecutive messages, which helps to identify the regularity of data sending.

[0063] Network latency: The average time from when a message is sent to when it is received, reflecting the network status. Error rate: The ratio of data transmission errors or unconfirmed messages, used to monitor communication quality. Device online rate: The ratio of devices connected to the gateway that are actively online, used to evaluate the stability of the network connection. A significant drop may mean device failure or network coverage issues.

[0064] S1-2-2: Calculate the standard score of the data points relative to the mean, and mark any data point exceeding three times the standard deviation as an outlier; S1-2-3: The Isolation Forest algorithm is used to identify outliers. The anomaly score output by the model is used for the final anomaly decision. Negative values ​​represent normal data points, and positive values ​​represent abnormal data points.

[0065] As a refinement of the above steps, in step S3, when a Topic is predicted to be low in activity in the short term, the UNSUBSCRIBE command of MQTT is used to dynamically unsubscribe to reduce unnecessary network monitoring; before the predicted activity increases, the SUBSCRIBE command is used to subscribe in advance to ensure that data is not lost. A priority label is set for each Topic, and urgent or important Topics are always subscribed. The algorithm is used to dynamically adjust the bandwidth allocation of the uplink and downlink to ensure the transmission priority of key data and the smoothness of the overall network.

[0066] The specific operation involves intelligently identifying and unsubscribing those topics with low predicted activity. Here, low activity can be defined based on the frequency threshold of the model output. For example, a topic with a predicted frequency of less than 10 messages per day is considered low activity. This approach aims to reduce unnecessary network bandwidth usage and processor resource consumption, that is, to avoid excessive network monitoring burden (reducing "network I / O operations" and "CPU wake-up cycles").

[0067] The unnecessary network monitoring includes: Monitoring of non-critical or low-activity topics: If the data transmission frequency of a topic is extremely low, or the transmitted data is not necessary for the current business operation, continuous monitoring will occupy unnecessary system resources, such as CPU cycles, memory and network bandwidth.

[0068] Monitoring invalid or abandoned topics: There may be topics in the system that are no longer used but have not been removed from the subscription list. Continuing to monitor these topics will only increase the burden.

[0069] Duplicate monitoring: Multiple monitoring systems or components monitor the same data stream at the same time, resulting in a waste of resources and possible data parsing conflicts.

[0070] Data flow monitoring during non-working hours: During business non-operating hours (such as late at night or on weekends), if it is known that no important data will be transmitted, continuous monitoring may not be necessary unless there are special monitoring requirements or security considerations.

[0071] Example 3 The disclosed embodiment also provides a dynamic MQTT Topic intelligent subscription and traffic optimization device for an Internet of Things gateway, including a processor and a memory. Optionally, the device may also include a communication interface and a bus. Among them, the processor, the communication interface, and the memory can communicate with each other through the bus. The communication interface can be used for information transmission. The processor can call the logic instructions in the memory to execute the dynamic MQTT Topic intelligent subscription and traffic optimization method for an Internet of Things gateway of the above embodiment.

[0072] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0073] As a computer-readable storage medium, the memory can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes functional applications and data processing by running the program instructions / modules stored in the memory, that is, the dynamic MQTT Topic intelligent subscription and traffic optimization method for the IoT gateway in the above embodiment is implemented.

[0074] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory may include a high-speed random access memory and may also include a non-volatile memory.

[0075] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A dynamic MQTT Topic intelligent subscription and traffic optimization system for IoT gateways, characterized in that: include: Intelligent prediction module: It is configured to predict the activity and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions; Dynamic MQTT Topic Management Module: It is configured to dynamically adjust the MQTT Topic subscription list of the IoT gateway according to the activity of each Topic predicted by the intelligent prediction model; Dynamic resource scheduling and optimization module: It is configured to combine the intelligent prediction model to predict the data volume of each topic and the current network status, and implement dynamic resource scheduling strategies.

2. According to claim 1, the dynamic MQTT Topic intelligent subscription and traffic optimization system for the Internet of Things gateway is characterized in that: The intelligent prediction model includes: Time series prediction module: configured to predict the activity and data volume of each topic; Cluster analysis module: It is configured to extract the clustering features of topics and cluster topics using the K-means clustering algorithm; Anomaly detection module: is configured to continuously monitor real-time data streams to identify abnormal data flows or device behaviors.

3. According to claim 1, the dynamic MQTT Topic intelligent subscription and traffic optimization system for the Internet of Things gateway is characterized in that: The dynamic MQTT Topic management module includes: Dynamic Topic Registration and Deregistration Module: configured to create or cancel Topic subscriptions; Dynamic permission control module: It is configured to dynamically adjust the device's Topic access rights based on the device role and permission policy; Adaptive load balancing module: It is configured to deploy MQTT Broker and achieve high availability and load sharing through cluster configuration; develop or integrate load balancing middleware, monitor Broker CPU usage, memory usage and network traffic, and dynamically adjust Topic allocation based on Topic activity; monitor system performance and automatically trigger Topic migration between Brokers based on real-time load conditions; Topic lifecycle management module: It is configured to monitor the activity of each Topic, deregister Topics whose activity is below the set threshold, and record Topic lifecycle events.

4. According to claim 1, the dynamic MQTT Topic intelligent subscription and traffic optimization system for the Internet of Things gateway is characterized in that: Dynamic resource scheduling and optimization modules include: Resource demand prediction module: It is configured to use the CPU, memory, storage and network traffic log data of the gateway based on the Prophet time series model to predict resource requirements in different time windows, including CPU reservation percentage, estimated memory usage, storage requirements and expected network bandwidth; Resource elastic scaling module: is configured to obtain the resource demand of the resource demand prediction module and trigger the dynamic expansion of cloud-side resources based on the prediction results; Edge caching module: is configured to deploy edge caching mechanism on edge computing nodes to optimize the response speed of the IoT system.

5. According to claim 4, the dynamic MQTT Topic intelligent subscription and traffic optimization system for the Internet of Things gateway is characterized in that: The resource elastic scaling module integrates AWS CloudFormation template automatic configuration and AWS Auto Scaling group, sets warning thresholds for CPU usage, memory utilization and network traffic in AWS CloudWatch, and triggers the increase or decrease of instances when the monitoring indicators reach the preset thresholds; sets CloudWatch Alarms to monitor Auto Scaling activities and resource usage.

6. According to claim 4, the dynamic MQTT Topic intelligent subscription and traffic optimization system for the Internet of Things gateway is characterized in that: The edge cache module uses AWS Greengrass service to deploy edge nodes, installs Redis as a cache database on each Greengrass core device, customizes the cache strategy through Greengrass Lambda function, configures the data type implemented by local cache, and configures the data expiration time; uses AWS IoT Core and DynamoDB Stream to ensure data consistency between the edge cache and the cloud database, and reduces data transmission by implementing an incremental synchronization strategy; integrates CloudWatch Metrics to monitor the edge cache hit rate, response time, and resource usage, and regularly adjusts the cache strategy and resource allocation based on the monitoring data.

7. A method for dynamic MQTT Topic intelligent subscription and traffic optimization for an Internet of Things gateway using the system described in any of claims 1-6, characterized in that: include: Establish an intelligent prediction model, collect historical data, and train the model after preprocessing. The historical data includes Topic activity, data volume, and timestamp; Use the trained intelligent prediction model to predict the activity and data volume of different topics in the future time period, as well as the expected frequency of cloud control instructions; Dynamically adjust the MQTT Topic subscription list of the IoT gateway based on the activity of each Topic predicted by the intelligent prediction model; Unsubscribe from low-activity topics and reduce unnecessary network monitoring, including monitoring of non-critical or low-activity topics, monitoring of invalid or abandoned topics, repeated monitoring, and monitoring of data streams during non-working hours; subscribe to high-activity topics; Calculate the amount of resources required by the gateway based on the amount of data for each topic predicted by the intelligent prediction model; Cloud-edge collaborative resource allocation connects with the cloud platform through APIs to dynamically adjust cloud-side resources. During peak data traffic periods, cloud instances are started or bandwidth is increased to meet demand. During low traffic periods, excess resources are released. The peak data traffic period is when the predicted data volume exceeds twice the average of the past 30 days, and the low data traffic period is when the data volume is less than 50% of the average of the past 30 days.

8. The method for dynamic MQTT Topic intelligent subscription and traffic optimization for IoT gateway according to claim 7, characterized in that: The intelligent prediction model includes a time series prediction module and a cluster analysis module; the cluster analysis module adopts a K-means clustering algorithm; The time series prediction module includes the ARIMA model and the LSTM model. The data processing process is as follows: Use the Pandas library to clean data, remove missing or outliers, and construct features based on time series characteristics, including topic activity, data volume, and timestamps; Determine the stationarity of the time series through the ADF test, determine the d value of the ARIMA model, use the ACF and PACF graphs to remove the p and q values, use the statsmodels library to build and train the ARIMA (p, d, q) model, and optimize the parameters through the AIC criterion; The time series data is converted into a supervised learning format, and input and output samples are constructed by a sliding window method; the LSTM model includes an embedding layer, an LSTM layer, and an output layer; the MSE is used as a loss function, and the model is trained by an Adam optimizer; Based on the cross-validation results, weights are assigned to the ARIMA and LSTM models to achieve weighted fusion prediction; The performance of the time series prediction module is evaluated based on the validation set, and the fusion strategy is adjusted based on the results.

9. The method for dynamic MQTT Topic intelligent subscription and traffic optimization for IoT gateway according to claim 8, characterized in that: The intelligent prediction model is also equipped with an anomaly detection mechanism, which continuously monitors the real-time data stream. The specific steps are as follows: Calculate the long-term average and standard deviation of each key indicator to establish a statistical baseline of normal behavior; the key indicators include: message frequency, data volume, message interval, network delay, error rate, and device online rate; The standard scores of the data points relative to the mean were calculated, and any data point exceeding three standard deviations was marked as an outlier; The Isolation Forest algorithm is used to identify outliers, and the anomaly score output by the model is used for the final anomaly decision. Negative values ​​represent normal data points, and positive values ​​represent abnormal data points.

10. A dynamic MQTT Topic intelligent subscription and traffic optimization device for an Internet of Things gateway, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the dynamic MQTT Topic intelligent subscription and traffic optimization method for the Internet of Things gateway as described in any one of claims 7-9 when running the program instructions.

Citation Information

Cited By

  • Networking configuration method and device, electronic equipment and storage medium

    CN119449845A

  • Network configuration methods, devices, electronic equipment and storage media

    CN119449845B

  • Disaster recovery method for third-party payment system and third-party payment system

    CN119621444A

  • Data distribution system of B / S architecture real-time data visualization system

    CN119629175A

  • Method and system for optimizing eBPF monitoring service based on dynamic subscription mechanism

    CN119906757A