Network interruption detection method in Internet of Things environment
By adopting a network interrupt detection method with double cache and sliding window mechanism in the Internet of Things environment, dynamically adjusting window parameters and performing incremental aggregation processing with historical calculation results, the problem of insufficient network interrupt detection in the existing technology is solved, and efficient , accurate network status monitoring and real-time response.
Patent Information
- Application Number
- CN202411536069.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art network interrupt detection relies on static delay threshold comparison in the Internet of Things environment, which lacks adaptability to rapid changes in network conditions, resulting in insufficient data processing in complex environments, which may cause false positives or missed reports, reducing network management efficiency and Accuracy, increase maintenance difficulty and cost.
Adopt the double cache strategy and sliding window mechanism to dynamically adjust the window size and step size, combine historical calculation results to perform incremental aggregation processing, judge network status in real time, and use Mqtt Broker to route and process data to reduce resource consumption and improve data processing speed and system stability.
Effectively optimize the data processing process, improve the accuracy and real-timeness of network monitoring, reduce resource consumption, ensure that the system efficiently processes information when the data volume fluctuates greatly, improves the system's response ability and reliability, and enhances the continuous stability of the network The ability to run.
Smart Images

Figure CN119276751A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer networks, and in particular to a network interruption detection method in an Internet of Things environment. Background Art
[0002] The network interruption delay detection algorithm usually sends a probe data packet to the target device or server regularly through the program background. When the target device or server receives the probe data packet, it will immediately return a response packet. The system measures the time from sending the probe packet to receiving the response packet, that is, the round-trip time (RTT). The system then compares the measured RTT with the preset delay threshold. If the RTT is less than or equal to the threshold, it means that the network is normal; if it is greater than the threshold, it indicates that the network may be interrupted.
[0003] However, in the prior art, the detection of network interruptions mainly relies on static delay threshold comparisons. This method lacks adaptability to rapidly changing network conditions and performs poorly in environments with diverse devices. Since only a single data point of round-trip time (RTT) is used for judgment, it is difficult to fully and accurately evaluate the status of the entire network. Especially when the network environment is complex or there are many devices, the limitations of this technology lead to incomplete data processing, which may cause false alarms or omissions, thereby reducing the efficiency and accuracy of network management. These deficiencies increase the difficulty and cost of network maintenance, and also affect the final user experience. Summary of the invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a network interruption detection method in an Internet of Things environment.
[0005] In order to achieve the above object, the present invention adopts the following technical solution, a network interruption detection method under the Internet of Things environment, comprising the following steps:
[0006] S1, providing a configuration page, in which the user fills in the configuration information of the IoT device and submits it, and storing the key information of the IoT device in a relational database;
[0007] After completing the configuration information, submit the information and verify the data; if there is a unique identifier conflict, a warning prompt will appear; otherwise, it will be stored in the relational database, and a double cache strategy will be used. After the information in the relational database is modified, the background will immediately trigger data synchronization to synchronize the modified or updated information to the memory database. When the subsequent program reads the configuration, it will read from the memory database;
[0008] S2, IoT device data access, uses a bridge program to route the data under each IoT device topic to the Mqtt Broker;
[0009] S3, IoT device data reception and processing, the network interruption detection program subscribes to all topics on the Mqtt Broker, and each topic is processed when receiving topic message data:
[0010] S4, when receiving topic message data, based on the sliding window mechanism, divide the data according to the preset time slices to generate an initial data window set;
[0011] S5, based on the initial data window set, calculating the data generation rate and historical network interruption frequency of each device, calling the adaptive window adjustment algorithm, dynamically adjusting the size and sliding step of the sliding window, and generating a dynamic sliding window parameter set;
[0012] S6, using the dynamic sliding window parameter set, performing incremental aggregation processing on the initial data window set; for the newly entered device data fragments, calling the historical calculation results in the cache to avoid repeated calculations, and merging to generate an incremental aggregation data result set;
[0013] S7, based on the incremental aggregate data result set, determine the network status of the corresponding device; if the device data is received within the delay time, set the device status to normal network, and update the network recovery time in the relational database; if the device data is not received within the interruption time, modify the device status to network interruption, read the device restart command, device management user information and group message push robot interface information, send a restart command to the device, push the network interruption information to the device administrator and device group, and the program ends.
[0014] Preferably, in S1, the configuration information includes:
[0015] Unique device identifier, which is used to correspond to a device one by one, and the same identifier cannot exist; the device is a device that is refined under the IoT device;
[0016] Heartbeat sending interval, which is the time for sending heartbeat packets for each IoT device;
[0017] Transmission delay threshold, used to identify network outages;
[0018] The device restart command is a restart command of the IoT device, which is a character string that complies with the IoT device protocol;
[0019] Device management user information, personal information of the administrator who manages the device;
[0020] Group message push robot interface information, which is the interface of the robot in the work group.
[0021] Preferably, step S4 is as follows:
[0022] When receiving topic message data, divide the data into time slices according to the predetermined time interval, define the window to which each data belongs by time stamp, and generate a time slice data window set;
[0023] Using the time slice data window set, setting a certain start and end timestamp for each window, distinguishing the data windows by identifying time boundaries, and obtaining the time-delimited data windows;
[0024] The time-defined data windows are archived, an index is created for each window, the data access path is optimized through the index, the data is retrieved and accessed quickly, and an initial data window set is generated.
[0025] Preferably, step S5 is specifically as follows:
[0026] Extract data from the initial data window set, calculate the data generation rate and network interruption frequency of the device, organize and tabulate the collected information, and generate a device performance statistical report;
[0027] Based on the device performance statistical report, determine the size and step size of the current data window, adjust the sliding window parameters according to the data flow and interruption frequency, and obtain the adjusted sliding window parameters;
[0028] The adjusted sliding window parameters are applied, the data processing flow is reconfigured, the data window configuration is updated to match the changes in the real-time data stream, and a dynamic sliding window parameter set is generated.
[0029] Preferably, step S6 is specifically as follows: using the dynamic sliding window parameter set, incrementally aggregate the data in the indexed data window set, integrating newly entered data segments, and generating a preliminary incremental aggregate data result set.
[0030] Compare the preliminary incremental aggregation data result set with historical data, use the calculation results in the cache to avoid repeated processing, update the aggregation data through comparison, and obtain optimized data aggregation results.
[0031] The optimized data aggregation results are merged, the data information is integrated, the integrity and consistency of the data are checked, and an incremental aggregation data result set is generated.
[0032] Compared with the prior art, the advantages and positive effects of the present invention are:
[0033] The present invention responds to changes in data volume by dynamically adjusting the size and step size of the sliding window, thereby effectively optimizing the data processing process. This method not only reduces resource consumption, but also ensures that the system can efficiently process information when the amount of data fluctuates greatly. The use of cached historical calculation results to avoid repeated calculations significantly improves the data processing speed and resource utilization, making the system run more efficiently. The dual caching strategy of configuration information accelerates data access, shortens response time, and improves the stability and reliability of the system. In addition, automatic identification of network interruptions and real-time updating of device status greatly improves the accuracy and real-time performance of network monitoring. These measures enhance the responsiveness and reliability of the system as a whole, which is extremely critical for maintaining the continuous and stable operation of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic diagram of the steps of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0036] See also Figure 1 The present invention provides a technical solution, a network interruption detection method in an Internet of Things environment, comprising the following steps:
[0037] S1, providing a configuration page, in which the user fills in the configuration information of the IoT device and submits it, and storing the key information of the IoT device in a relational database;
[0038] After completing the configuration information, submit the information and verify the data; if there is a unique identifier conflict, a warning prompt will appear; otherwise, it will be stored in the relational database, and a double cache strategy will be used. After the information in the relational database is modified, the background will immediately trigger data synchronization to synchronize the modified or updated information to the memory database. When the subsequent program reads the configuration, it will read from the memory database;
[0039] Specifically, a user interface is designed to allow users to enter key configuration information of IoT devices, such as device unique identifier, heartbeat sending interval, transmission delay threshold, etc. After the user submits this information through the interface, the system first performs data format and legitimacy checks, such as checking whether the unique identifier already exists, to ensure the uniqueness of each device. The data that passes the inspection is encoded and sent to the server via a secure HTTP(S) connection;
[0040] After receiving the data, the server stores it in a relational database, such as MySQL or PostgreSQL. During the storage process, if a unique identifier conflict is detected, the system will trigger a warning prompt to the user, requiring the identifier to be changed. If there is no conflict, after the data is successfully stored, a double cache strategy is triggered. This strategy ensures that when the data in the relational database is updated, the corresponding changes are immediately synchronized to an in-memory database such as Redis, which can speed up the subsequent reading of configuration data and optimize system performance;
[0041] S2, IoT device data access, uses a bridge program to route the data under each IoT device topic to the Mqtt Broker;
[0042] Specifically, IoT devices send data through network connections. The bridge program in the system is responsible for receiving data from each device and routing the data to an Mqtt Broker according to preset rules. This process includes parsing and forwarding data under the device topic to ensure accurate transmission of data to the message broker for subsequent processing;
[0043] S3, IoT device data reception and processing, the network interruption detection program subscribes to all topics on the Mqtt Broker, and each topic is processed when receiving topic message data:
[0044] Specifically, the network interruption detection program subscribes to all device topics on the MQTT Broker. Whenever topic data arrives, the program immediately captures the data and performs preliminary processing. The processing includes verifying the integrity of the data, recording the receiving time, and performing preliminary classification of the data in preparation for subsequent in-depth analysis and processing;
[0045] S4, when receiving topic message data, based on the sliding window mechanism, divide the data according to the preset time slices to generate an initial data window set;
[0046] S5, based on the initial data window set, calculating the data generation rate and historical network interruption frequency of each device, calling the adaptive window adjustment algorithm, dynamically adjusting the size and sliding step of the sliding window, and generating a dynamic sliding window parameter set;
[0047] S6, using the dynamic sliding window parameter set, performing incremental aggregation processing on the initial data window set; for the newly entered device data fragments, calling the historical calculation results in the cache to avoid repeated calculations, and merging to generate an incremental aggregation data result set;
[0048] S7, based on the incremental aggregate data result set, determine the network status of the corresponding device; if the device data is received within the delay time, set the device status to normal network, and update the network recovery time in the relational database; if the device data is not received within the interruption time, modify the device status to network interruption, read the device restart command, device management user information and group message push robot interface information, send a restart command to the device, push the network interruption information to the device administrator and device group, and the program ends.
[0049] The configuration information includes:
[0050] Unique device identifier, which is used to correspond to a device one by one, and the same identifier cannot exist; the device is a device that is refined under the IoT device;
[0051] Heartbeat sending interval, which is the time for sending heartbeat packets for each IoT device;
[0052] Transmission delay threshold, used to identify network outages;
[0053] The device restart command is a restart command of the IoT device, which is a character string that complies with the IoT device protocol;
[0054] Device management user information, personal information of the administrator who manages the device;
[0055] Group message push robot interface information, which is the interface of the robot in the work group.
[0056] In this embodiment, step S4 is specifically as follows:
[0057] When receiving topic message data, divide the data into time slices according to the predetermined time interval, define the window to which each data belongs by time stamp, and generate a time slice data window set;
[0058] Using the time slice data window set, setting a certain start and end timestamp for each window, distinguishing the data windows by identifying time boundaries, and obtaining the time-delimited data windows;
[0059] The time-defined data windows are archived, an index is created for each window, the data access path is optimized through the index, the data is retrieved and accessed quickly, and an initial data window set is generated.
[0060] Specifically, when topic message data is received, the data is divided and allocated to the corresponding time slices according to the predetermined time interval. This process first requires the establishment of a time stamp for each data point, which is usually achieved by sending a timestamp from the device or receiving a timestamp. The time stamp helps the system identify which time slice the data belongs to, so as to accurately allocate the data to the corresponding time slice data window set.
[0061] In the specific implementation, the system first defines the length of a time slice, such as 5 minutes or 10 minutes, and then dynamically allocates the continuous data stream to each time window according to this time interval. For example, if the selected time slice is 5 minutes, all data from 00:00 to 00:05 will be concentrated in one window. Each window is assigned a certain start and end timestamp, which is used to identify and distinguish different data windows in data processing and query.
[0062] Once the data is assigned to a specific time window, the next step is to archive these time-bounded data windows. The main purpose of archiving is to optimize the storage and access of data. To this end, the system creates an index for each data window. The establishment of an index makes data retrieval more efficient because the index allows the system to quickly locate the data in a specific time window without traversing the entire database.
[0063] This processing strategy optimized by time stamping and indexing not only improves the speed of data retrieval, but also facilitates subsequent data analysis and processing. For example, when performing network outage detection or data trend analysis, the system can quickly extract data windows within a specific time period and perform necessary calculations and evaluations.
[0064] To summarize this execution process, it includes five key steps: data reception, time stamping, window allocation, index creation, and archiving. These steps together constitute an efficient and orderly data management system, ensuring the accuracy and response speed of data processing, and providing solid data support for network status monitoring in the IoT environment.
[0065] In this embodiment, step S5 is specifically as follows:
[0066] Extract data from the initial data window set, calculate the data generation rate and network interruption frequency of the device, organize and tabulate the collected information, and generate a device performance statistical report;
[0067] Based on the device performance statistical report, determine the size and step size of the current data window, adjust the sliding window parameters according to the data flow and interruption frequency, and obtain the adjusted sliding window parameters;
[0068] The adjusted sliding window parameters are applied, the data processing flow is reconfigured, the data window configuration is updated to match the changes in the real-time data stream, and a dynamic sliding window parameter set is generated.
[0069] Specifically, the data in each time window can be quickly retrieved through the established index. This data includes the device's sending timestamp, data packet size, and sending frequency. With this data, the system can calculate the data generation rate of each device in different time windows, that is, the amount of data sent by the device per unit time. In addition, the system will also monitor and record the situation where data is not received in each time window, so as to calculate the network interruption frequency, that is, the number and duration of device data transmission interruptions within a certain period of time.
[0070] Next, the system organizes and tabulates the collected information to generate a device performance statistics report. This report details the average data generation rate, network interruption frequency, and other key performance indicators for each device. The report also includes a time series analysis of the data generation rate and network interruption frequency, which is presented in the form of a chart, making the device operation trend clear at a glance.
[0071] Based on the device performance statistics report, the system administrator or automated script will evaluate whether the current data window size and step size are appropriate. If the data flow is large or the network is frequently interrupted, the window size may need to be reduced to update the data more frequently, thereby reflecting changes in network conditions more quickly. On the contrary, if the data flow is smooth and there are few interruptions, the window size can be increased to reduce the processing load. The system will adjust the parameters of the sliding window, such as the window size and step size, based on these evaluations.
[0072] The adjusted sliding window parameters are then applied to the data processing pipeline. The system reconfigures the data window settings to ensure that they match the changes in the real-time data stream.
[0073] Finally, the generated dynamic sliding window parameter set will be applied to the entire data processing system to ensure that the system can flexibly adapt to changes in network conditions, thereby maintaining the optimal state of device performance and network stability. This process not only optimizes the data processing process, but also improves the response speed to network anomalies, which is a key part of IoT device management.
[0074] In this embodiment, step S6 is specifically as follows: using the dynamic sliding window parameter set, incrementally aggregate the data in the indexed data window set, integrating newly entered data fragments, and generating a preliminary incremental aggregate data result set.
[0075] Compare the preliminary incremental aggregation data result set with historical data, use the calculation results in the cache to avoid repeated processing, update the aggregation data through comparison, and obtain optimized data aggregation results.
[0076] The optimized data aggregation results are merged, the data information is integrated, the integrity and consistency of the data are checked, and an incremental aggregation data result set is generated.
[0077] Specifically, first, the system performs incremental aggregation on the data in the indexed data window set according to the newly adjusted sliding window parameters. During this process, the system takes into account the newly incoming data fragments, which are composed of the data sent by the device in the new time window. The system summarizes the data in each time window and calculates aggregate metrics such as total data volume and average data rate. In addition, the start and end times of the data window are checked to ensure that the data fragments are correctly classified.
[0078] Next, the system compares the preliminary incremental aggregated data result set with historical data. The key to this step is to use cached calculation results, which may include aggregated data or key indicator calculations for previous time windows. By comparing with the data in the cache, the system can avoid repeated processing of the same data and improve processing efficiency. The system will check the differences in time and magnitude between the new data and historical data, and update the aggregated data accordingly, such as correcting data fluctuation anomalies or updating change trends.
[0079] Further merging the optimized data aggregation results is a key step to ensure data integrity and consistency. At this stage, the system centrally processes the aggregation results of all related data windows and merges the data. During the merging process, the system will check the consistency of the data, such as timestamp alignment, data format standardization, etc., to ensure that there is no data loss or error. At the same time, data integrity checks are performed, such as verifying the integrity of data records, to ensure the accuracy and reliability of data aggregation results.
[0080] After completing the above steps, the system generates the final incremental aggregate data result set, which contains the aggregated data of all data windows after optimization, providing a comprehensive view of device performance and network status.
[0081] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A network interruption detection method in an Internet of Things environment, characterized in that: The following steps are involved: S1, providing a configuration page, in which the user fills in the configuration information of the IoT device and submits it, and storing the key information of the IoT device in a relational database; After completing the configuration information, submit the information and verify the data; If there is a unique identifier conflict, a warning prompt will appear; Otherwise, it is stored in a relational database and a double cache strategy is used. When the information in the relational database is modified, the background immediately triggers data synchronization to synchronize the modified or updated information to the memory database. When the subsequent program reads the configuration, it reads from the memory database. S2, IoT device data access, uses a bridge program to route the data under each IoT device topic to MqttBroker; S3, IoT device data reception and processing, the network interruption detection program subscribes to all topics on the Mqtt Broker, and each topic is processed when receiving topic message data: S4, when receiving topic message data, based on the sliding window mechanism, divide the data according to the preset time slices to generate an initial data window set; S5, based on the initial data window set, calculating the data generation rate and historical network interruption frequency of each device, calling the adaptive window adjustment algorithm, dynamically adjusting the size and sliding step of the sliding window, and generating a dynamic sliding window parameter set; S6, performing incremental aggregation processing on the initial data window set using the dynamic sliding window parameter set; For newly entered device data fragments, call the historical calculation results in the cache to avoid repeated calculations and merge them to generate an incremental aggregate data result set; S7, judging the network status of the corresponding device based on the incremental aggregated data result set; If the device data is received within the delay time, the device status is set to normal network, and the network recovery time in the relational database is updated; If no device data is received within the interruption time, the device status is changed to network interruption, the device restart command, device management user information and group message push robot interface information are read, a restart command is sent to the device, and the network interruption information is pushed to the device administrator and device group, and the program ends.
2. The method for detecting network interruption in an Internet of Things environment according to claim 1, characterized in that: In S1, the configuration information includes: Unique device identifier, which is used to correspond to a device one by one, and the same identifier cannot exist; the device is a device that is refined under the IoT device; Heartbeat sending interval, which is the time for sending heartbeat packets for each IoT device; Transmission delay threshold, used to identify network outages; The device restart command is a restart command of the IoT device, which is a character string that complies with the IoT device protocol; Device management user information, personal information of the administrator who manages the device; Group message push robot interface information, which is the interface of the robot in the work group.
3. The network interruption detection method in the Internet of Things environment according to claim 1 is characterized in that: The S4 steps are as follows: When receiving topic message data, divide the data into time slices according to the predetermined time interval, define the window to which each data belongs by time stamp, and generate a time slice data window set; Using the time slice data window set, setting a certain start and end timestamp for each window, distinguishing the data windows by identifying time boundaries, and obtaining the time-delimited data windows; The time-defined data windows are archived, an index is created for each window, the data access path is optimized through the index, the data is retrieved and accessed quickly, and an initial data window set is generated.
4. The method for detecting network interruption in an Internet of Things environment according to claim 1, characterized in that: The S5 steps are as follows: Extract data from the initial data window set, calculate the data generation rate and network interruption frequency of the device, organize and tabulate the collected information, and generate a device performance statistical report; Based on the device performance statistical report, determine the size and step size of the current data window, adjust the sliding window parameters according to the data flow and interruption frequency, and obtain the adjusted sliding window parameters; The adjusted sliding window parameters are applied, the data processing flow is reconfigured, the data window configuration is updated to match the changes in the real-time data stream, and a dynamic sliding window parameter set is generated.
5. The network interruption detection method in the Internet of Things environment according to claim 1 is characterized in that: Step S6 is specifically as follows: using the dynamic sliding window parameter set, incrementally aggregate the data in the indexed data window set, integrate newly entered data fragments, and generate a preliminary incremental aggregate data result set.
6. The method for detecting network interruption in an Internet of Things environment according to claim 5, characterized in that: Also includes: Compare the preliminary incremental aggregation data result set with historical data, use the calculation results in the cache to avoid repeated processing, update the aggregation data through comparison, and obtain optimized data aggregation results.
7. The method for detecting network interruption in an Internet of Things environment according to claim 6, characterized in that: Also includes: The optimized data aggregation results are merged, the data information is integrated, the integrity and consistency of the data are checked, and an incremental aggregation data result set is generated.
Citation Information
Cited By
Multi-party secure transaction method based on cross-border e-commerce business rules
CN120689048A
Real-time fault judgment method and system based on ADAS hardware-in-loop simulation platform
CN121349037A