Network state monitoring method and device, electronic equipment and storage medium
By sorting and filtering network device data based on timestamps and traffic thresholds, the method addresses the inefficiencies of periodic testing in urban rail signal systems, enabling real-time network congestion detection and management.
Patent Information
- Application Number
- CN202510219461.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-15
AI Technical Summary
Existing network monitoring technologies are unable to respond to network congestion in real time, resulting in delays or failures in signal transmission, and rely on periodic testing or post-mortgage analysis inefficient.
By obtaining discrete raw data of network devices, using timestamps and traffic data to build key-value pairs, sorting and filtering traffic thresholds, monitoring network status in real time, and automatically identifying congestion or normal status of network devices.
Real-time monitoring of network equipment traffic is realized, and network status is automatically identified, which improves network status monitoring efficiency and avoids manual monitoring delay.
Smart Images

Figure CN120321142A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network monitoring, and particularly to a method, device, electronic device and storage medium for monitoring network status. Background Art
[0002] During the processes of data communication and signal transmission of various devices in modern urban rail transit signal systems, congestion problems such as continuous overload of network traffic and obstruction of network transmission often occur, which may lead to signal transmission delay or loss, thus affecting the safety and efficiency of the entire rail transit system.
[0003] The Data Communication Subsystem (DCS) in the signal system is responsible for realizing data exchange and communication between various signal devices. It interacts with multiple subsystems, continuously collects data traffic information of each network node such as switches, and simultaneously monitors network traffic in real time. DCS is an important hub to ensure the efficient operation of the urban rail transit signal system, which can monitor wireless network traffic and data exchange in real time and record the pulse traffic when a network storm occurs.
[0004] Most of the existing methods for monitoring network congestion rely on periodic testing or post - event analysis. These methods have a long response time and cannot reflect the immediate changes in network status in real time. For example, relying on network protocols, various metrics of network devices such as bandwidth utilization rate, error rate, and packet loss rate can be collected through the Simple Network Management Protocol (SNMP); or the NetFlow network protocol for collecting IP network traffic information. By analyzing this traffic data, administrators can see the source, destination, and type of network traffic, etc.
[0005] The main principle of the existing network congestion fault monitoring is based on periodic testing or post - event analysis. The defect of this method is that it cannot respond in real time and can only be detected after congestion occurs, and prevention cannot be carried out. Although the monitoring technology based on network protocols can record rich traffic data, it is usually based on polling, which means that data collection depends on a preset polling interval. Temporary congestion occurring between two polls may not be detected. In a high - speed and dynamically changing network environment, this may lead to delays or failures in critical data transmission. At the same time, it requires a large storage space to save data, and complex analysis tools are needed to process these data, which may lead to analysis delays.
[0006] In summary, it can be seen that the existing monitoring efficiency of network congestion is low. Summary of the Invention
[0007] The present invention provides a method, an apparatus, an electronic device and a storage medium for monitoring network status, so as to solve the defect of low monitoring efficiency of network congestion in the prior art and achieve the improvement of the monitoring efficiency of network congestion.
[0008] The present invention provides a method for monitoring network status, including: obtaining a collection data set of network devices according to the original data of discrete network devices, where the collection data in the collection data set includes a timestamp and traffic data; sorting the collection data in the collection data set according to the timestamp to obtain a collection data sequence sorted in time; in the collection data sequence, screening the collection data belonging to the current time period according to a traffic threshold to obtain a to-be-monitored collection data sequence; and obtaining the network status of the network device in the current time period according to the time length of the to-be-monitored collection data sequence and a preset duration.
[0009] According to the method for monitoring network status provided by the present invention, the current time period includes a first start time and a first end time, the to-be-monitored collection data sequence includes a first target collection data sequence composed of first target collection data, the first target collection data is collection data with a traffic data greater than the traffic threshold, the network status includes a network congestion status, the preset duration includes a first duration, in the collection data sequence, screening the collection data belonging to the current time period according to the traffic threshold to obtain a to-be-monitored collection data sequence; obtaining the network status of the network device in the current time period according to the time length of the to-be-monitored collection data sequence and the preset duration, including: determining the collection data sequence belonging to the current time period according to the first start time and the first end time in the collection data sequence; in the collection data sequence belonging to the current time period, starting from the collection data corresponding to the first start time, traversing the collection data to obtain the first target collection data, and sequentially adding at least one first target collection data that is continuous in time to the time dictionary until the first collection data with a traffic data less than or equal to the traffic threshold is traversed, ending the traversal, or until the collection data corresponding to the first end time is traversed, ending the traversal; obtaining the first target collection data sequence of the current time period based on all the first target collection data in the time dictionary; if the time length of the first target collection data sequence of the current time period is greater than the first duration, it is confirmed that the network device is in a network congestion status during the current time period.
[0010] According to the network status monitoring method provided by the present invention, the data sequence to be monitored and collected further includes a second target data sequence composed of second target collected data, where the second target collected data is the collected data with the traffic data less than or equal to the traffic threshold, the network status further includes the network normal status, and the preset duration further includes a second duration. In the collected data sequence, the collected data belonging to the current time period is screened according to the traffic threshold to obtain the data sequence to be monitored and collected; according to the time length of the data sequence to be monitored and collected and the preset duration, the network status of the network device in the current time period is obtained, including: in the collected data sequence, the collected data sequence belonging to the current time period is determined according to the first start time and the first end time; in the collected data sequence belonging to the current time period, starting from the collected data corresponding to the first start time, the collected data is traversed to obtain the second target collected data, and at least one second target collected data that is continuous in time is sequentially added to the time dictionary until the first collected data with the traffic data greater than the traffic threshold is traversed, and the traversal ends, or until the collected data corresponding to the first end time is traversed, and the traversal ends; based on all the second target collected data in the time dictionary, the second target data sequence of the current time period is obtained; if the time length of the second target data sequence of the current time period is greater than the second duration, it is confirmed that the network device is in the network normal status within the current time period, and the second duration is less than the first duration.
[0011] According to the network status monitoring method provided by the present invention, after it is confirmed that the network device is in the network congestion status within the current time period if the time length of the first target data sequence of the current time period is greater than the first duration, it further includes: based on the collection situation of the original data in the next time period, the collected data sequence is updated in real time, and in the updated collected data sequence, the second target collected data that belongs to the next time period and is continuous in time is obtained to obtain the second target data sequence of the next time period; if the time length of the second target data sequence of the next time period is greater than the second duration, it is determined that the network device restores the network normal status in the next time period.
[0012] According to the network status monitoring method provided by the present invention, the original data includes the identification information, time stamp, and traffic data of the network device, and the collected data includes key-value pairs with the time stamp as the key and the traffic data as the value. According to the discrete original data of the network device, the collected data set of the network device is obtained, including: using the time stamp as the key and the traffic data as the value to convert the original data into key-value pairs; according to the identification information, the key-value pairs of the same network device are divided into a collected data set.
[0013] According to the network status monitoring method provided by the present invention, based on the acquisition situation of the original data in the next time period, the acquisition data sequence is updated in real time, including: deleting the acquisition data belonging to the current time period from the acquisition data sequence to obtain a reduced acquisition data sequence; based on the acquisition situation of the original data in the next time period, obtaining the acquisition data in the next time period, and adding the acquisition data in the next time period to the reduced acquisition data sequence to obtain an updated acquisition data sequence.
[0014] According to the network status monitoring method provided by the present invention, if the time length of the first target acquisition data sequence in the current time period is greater than the first duration, after confirming that the network device is in a network congestion state in the current time period, it further includes: based on the acquisition situation of the original data in the next time period, updating the acquisition data sequence in real time, and in the updated acquisition data sequence, obtaining the first target acquisition data belonging to the next time period and continuous in time to obtain the first target acquisition data sequence in the next time period; if the time length of the first target acquisition data sequence in the next time period is greater than the first duration, it is determined that the network device remains in a network congestion state in the next time period.
[0015] The present invention also provides a network status monitoring device, including: an acquisition module, configured to obtain an acquisition data set of a network device according to the original data of discrete network devices, and the acquisition data in the acquisition data set includes a time stamp and traffic data; a sorting module, configured to sort the acquisition data in the acquisition data set according to the time stamp to obtain an acquisition data sequence sorted in time; a monitoring module, configured to screen the acquisition data belonging to the current time period in the acquisition data sequence according to a traffic threshold to obtain a to-be-monitored acquisition data sequence; and obtaining the network status of the network device in the current time period according to the time length of the to-be-monitored acquisition data sequence and a preset duration.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, it implements the network status monitoring method as described in any one of the above.
[0017] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the network status monitoring method as described in any one of the above.
[0018] The network status monitoring method, device, electronic device, and storage medium provided by the present invention obtain a collection data set of network devices according to the original data of discrete network devices. The collection data in the collection data set includes timestamps and traffic data; sort the collection data in the collection data set according to the timestamps to obtain a collection data sequence sorted in time; in the collection data sequence, screen the collection data belonging to the current time period according to a traffic threshold to obtain a collection data sequence to be monitored; obtain the network status of the network device in the current time period according to the time length of the collection data sequence to be monitored and a preset duration. The present invention determines the collection data sequence according to the original data, realizing real-time monitoring of the traffic of network devices. By setting the traffic threshold and the preset duration, the network status of network devices is automatically identified, manual monitoring is avoided, and the monitoring efficiency of the network status is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0020] Figure 1 is one of the flow diagrams of the network status monitoring method provided by the present invention.
[0021] Figure 2 is another flow diagram of the network status monitoring method provided by the present invention.
[0022] Figure 3 is yet another flow diagram of the network status monitoring method provided by the present invention.
[0023] Figure 4 is still another flow diagram of the network status monitoring method provided by the present invention.
[0024] Figure 5 is the structural diagram of the network status monitoring device provided by the present invention.
[0025] Figure 6 is the structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will, in conjunction with the accompanying drawings in the present invention, clearly and completely describe the technical solutions in the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts fall within the scope of protection of the present invention.
[0027] The following will, in conjunction with Figures 1 - 6 describe a method, apparatus, and electronic device for monitoring the network status of the present invention.
[0028] Figure 1 is one of the flow diagrams of the method for monitoring the network status provided by the present invention. As Figure 1 shown, the method for monitoring the network status includes steps S100 to S400, and the specific steps are as follows.
[0029] S100: According to the original data of discrete network devices, obtain the acquisition data set of the network devices. The acquisition data in the acquisition data set includes a timestamp and traffic data.
[0030] Based on the above embodiments, the original data includes the identification information, timestamp, and traffic data of the network device. The acquisition data includes key-value pairs with the timestamp as the key and the traffic data as the value. Obtaining the acquisition data set of the network device according to the original data of the discrete network device includes: using the timestamp as the key and the traffic data as the value to convert the original data into key-value pairs; according to the identification information, dividing the key-value pairs of the same network device into an acquisition data set.
[0031] The original data of each network device is stored discretely according to each network device. Integrate the original data of the discrete network devices and merge multiple pieces of original data into an acquisition data set. Aggregate the original data according to the network device, and extract the timestamp of the original data and the traffic data (traffic value) of the original data that belong to the same network device (device ID) within a set time period as the acquisition data to obtain the acquisition data set. The timestamp and the traffic data correspond one by one, and the timestamp indicates the time of the traffic data. For example, the original data is represented as follows.
[0032] Original data 1: Device ID (0xffff050005ff0029), timestamp (1692895632958), device label (YGBLZ:cq5:MSP30:SafeSwitchA:flow_2), detailed data content (traffic data of port 2), data type 4 (indicating the traffic type), traffic value 2 (indicating the specific traffic size), creation date (1692895632958).
[0033] Original Data 2: Device ID (0xffff050005ff0029), Timestamp (1692925812957), Device Label (YGBLZ:cq5:MSP30:SafeSwitchA:flow_2), Detailed Data Content (flow data of port 2), Data Type 4 (indicating the flow type), Flow Value 2 (indicating the specific flow size), Creation Date (e.g., 1692925812957).
[0034] Using the timestamp as the key and the flow data as the value, convert the original data into key-value pairs. According to the identification information, group the key-value pairs of the same network device into a collection dataset.
[0035] The finally merged collection dataset is as follows. For example, obtaining the collection dataset of device ID (0xffff050005ff0029) includes: Timestamp 1 - Flow Value 1, Timestamp 2 - Flow Value 2, Timestamp 3 - Flow Value 3,..., Timestamp N - Flow Value N. Among them, Timestamp 1 - Flow Value 1 is a key-value pair.
[0036] The present invention standardizes the format of the collected data by converting the original data into key-value pairs, which is beneficial to subsequent automatic analysis of the flow data in the collection dataset.
[0037] Identify the network device according to the device ID and device label, and regard all the original data of the same network device within the set time period as a collection dataset.
[0038] Furthermore, within the query time period, perform basic analysis on the collection dataset of the network device. For example, calculate the average flow, minimum flow, maximum flow, etc. of the network device according to all the collected data within a day.
[0039] S200: Sort the collected data in the collection dataset according to the timestamp to obtain a collection data sequence sorted in time.
[0040] The timestamp represents the time point of the flow data in the collected data. Sort all the collected data in the collection dataset of the network device according to the timestamp to obtain a collection data sequence sorted in time.
[0041] For example, sort each collected data in the collection dataset in ascending order of the timestamp to obtain a collection data sequence. For example, the collection data sequence is as follows.
[0042] Timestamp 1 - Flow Value 1; Timestamp 2 - Flow Value 2; Timestamp 3 - Flow Value 3; ... Timestamp N - Flow Value N.
[0043] S300: In the collected data sequence, filter the collected data belonging to the current time period according to the traffic threshold to obtain the to-be-monitored collected data sequence; obtain the network status of the network device in the current time period according to the time length of the to-be-monitored collected data sequence and the preset duration.
[0044] In the collected data sequence, obtain the collected data belonging to the current time period (starting from the collected data corresponding to the first start time until the collected data corresponding to the first end time). Filter the collected data belonging to the current time period according to the traffic threshold to obtain the to-be-monitored collected data sequence.
[0045] For example, from the collected data belonging to the current time period, find at least one first target collected data whose traffic data is greater than the traffic threshold and is continuous in time to obtain the first target collected data sequence.
[0046] If the collected data in the collected data sequence segment of the current time period is sorted in ascending order of time. Then the to-be-monitored collected data in the obtained to-be-monitored collected data sequence will also be sorted in ascending order of time. According to the timestamps of the first to-be-monitored collected data and the last to-be-monitored collected data in the to-be-monitored collected data sequence, obtain the time length of the to-be-monitored collected data sequence.
[0047] Compare the time length of the to-be-monitored collected data sequence with the preset duration, and then judge the network status of the network device in the current time period.
[0048] The network status monitoring method provided by the embodiments of the present invention obtains the collected data set of the network device according to the original data of the discrete network device. The collected data in the collected data set includes timestamps and traffic data; sort the collected data in the collected data set according to the timestamps to obtain the collected data sequence sorted in time; in the collected data sequence, filter the collected data belonging to the current time period according to the traffic threshold to obtain the to-be-monitored collected data sequence; obtain the network status of the network device in the current time period according to the time length of the to-be-monitored collected data sequence and the preset duration. The present invention determines the collected data sequence according to the original data, realizing real-time monitoring of the network device traffic. By setting the traffic threshold and the preset duration, it realizes automatic identification of the network status of the network device, avoids manual monitoring, and improves the monitoring efficiency of the network status.
[0049] Based on the above embodiments, the current time period includes a first start time and a first end time, the data sequence to be monitored and collected includes a first target data sequence composed of first target collected data, the first target collected data is the collected data with the traffic data greater than the traffic threshold, the network status includes the network congestion status, the preset duration includes a first duration. In the collected data sequence, the collected data belonging to the current time period is screened according to the traffic threshold to obtain the data sequence to be monitored and collected; according to the time length of the data sequence to be monitored and collected and the preset duration, the network status of the network device in the current time period is obtained, including: in the collected data sequence, the collected data sequence belonging to the current time period is determined according to the first start time and the first end time; in the collected data sequence belonging to the current time period, starting from the collected data corresponding to the first start time, the collected data is traversed to obtain the first target collected data, and at least one first target collected data that is continuous in time is successively added to the time dictionary until the first collected data with the traffic data less than or equal to the traffic threshold is traversed, and the traversal ends, or until the collected data corresponding to the first end time is traversed, and the traversal ends; based on all the first target collected data in the time dictionary, the first target data sequence in the current time period is obtained; if the time length of the first target data sequence in the current time period is greater than the first duration, it is confirmed that the network device is in the network congestion status during the current time period.
[0050] Set an iterator. According to the iterator, in the collected data sequence, starting from the collected data corresponding to the first start time, the collected data belonging to the current time period in the collected data sequence is traversed. The first target collected data that is continuous in time and traversed is successively added to the time dictionary, and the traversed collected data is deleted from the collected data sequence. When the first collected data with the traffic data less than or equal to the traffic threshold (the second target collected data) is traversed, the traversal ends. Or, when the collected data corresponding to the first end time is traversed, the traversal ends.
[0051] Insert all the first target collected data in the time dictionary (time dict) into the array of data exceeding the traffic threshold (over threshold arr). According to the array of data exceeding the threshold, the first target data sequence is obtained. At the same time, clear all the first target collected data in the time dictionary.
[0052] If the time length of the first target acquisition data sequence in the current time period is greater than the first duration (e.g., 60s), it indicates that the duration during which the traffic data of the network device continuously exceeds the traffic threshold in the current time period is greater than the first duration. Then, it is determined that the network device is in a network congestion state in the current time period, and the network status parameter of the network device is set to 1. An alarm is generated for the network device and sent to the network administrator. Meanwhile, set the response policy for the alarm. For example, automatically execute some preliminary network adjustment measures, such as adjusting the routing policy, restricting the bandwidth of some non-urgent data, or starting additional network resources, etc.
[0053] If the time length of the first target acquisition data sequence in the current time period is less than or equal to the first duration, it is determined that the network device is in a normal network state in the current time period, and the network status parameter of the network device is set to 0.
[0054] As Figure 2 shown, start the monitoring device for the network status. If the monitoring device for the network status contains a date parameter when starting, determine the query time period (including the query start time and query end time) according to this date parameter. If the monitoring device for the network status does not contain a date parameter when starting, determine the query time period according to the current day's date.
[0055] Judge whether the network device has performed network congestion analysis within the query time period. If the network device has performed network congestion analysis within the query time period, read the end time point of the previous network congestion analysis, and use this end time point as the start time point of the current network congestion analysis. If the network device has not performed network congestion analysis within the query time period, use the start time point of the query time period as the start time point of the current network congestion analysis.
[0056] According to the start time point of the current network congestion analysis and the end time point of the query time period, query the result of the basic analysis to obtain the acquisition data sequence.
[0057] Monitor the traffic data of the acquisition data in the acquisition data sequence according to the traffic threshold to obtain the network congestion state of the network device in the current time period.
[0058] Set the network status parameter of the network device according to the network congestion state of the network device in the current time period.
[0059] As Figure 3As shown, when the network status parameter is 0, it indicates that the network device is in a normal network state. When the network status parameter is 1, it indicates that the network device is in a network congestion state. If the network status parameter in the current time period is 1, and the time length of the second target acquisition data sequence in the next time period is greater than the first duration (for example, 30 s), it is determined that the network device has restored the normal network state, and the network status parameter of the network device is modified to 0. If the network status parameter in the current time period is 0, and the time length of the first target acquisition data sequence in the next time period is greater than the second duration (for example, 60 s), a network congestion alarm is sent, and the network status parameter of the network device is modified to 1.
[0060] In the present invention, by traversing the acquisition data belonging to the current time period, the first target acquisition data with a traffic data greater than the traffic threshold is automatically obtained, improving the efficiency of traffic monitoring of the network device.
[0061] Based on the above embodiments, the acquisition data sequence to be monitored further includes a second target acquisition data sequence composed of second target acquisition data. The second target acquisition data is acquisition data with a traffic data less than or equal to the traffic threshold. The network status further includes a normal network state, and the preset duration further includes a second duration. In the acquisition data sequence, the acquisition data belonging to the current time period is screened according to the traffic threshold to obtain the acquisition data sequence to be monitored; according to the time length of the acquisition data sequence to be monitored and the preset duration, the network status of the network device in the current time period is obtained, including: in the acquisition data sequence, the acquisition data sequence belonging to the current time period is determined according to the first start time and the first end time; in the acquisition data sequence belonging to the current time period, starting from the acquisition data corresponding to the first start time, the acquisition data is traversed to obtain the second target acquisition data, and at least one consecutive second target acquisition data in time is sequentially added to the time dictionary until the first acquisition data with a traffic data greater than the traffic threshold is traversed, and the traversal ends, or until the acquisition data corresponding to the first end time is traversed, and the traversal ends; based on all the second target acquisition data in the time dictionary, the second target acquisition data sequence in the current time period is obtained; if the time length of the second target acquisition data sequence in the current time period is greater than the second duration, it is confirmed that the network device is in a normal network state in the current time period, and the second duration is less than the first duration.
[0062] According to the iterator, in the acquisition data sequence, starting from the acquisition data corresponding to the first start time, the acquisition data belonging to the current time period in the acquisition data sequence is traversed, and the consecutive second target acquisition data in time are sequentially added to the time dictionary, and the traversed acquisition data is deleted from the acquisition data sequence. When the first acquisition data with a traffic data greater than the traffic threshold (the first target acquisition data) is traversed, the traversal ends. Alternatively, when the acquisition data corresponding to the first end time is traversed, the traversal ends.
[0063] Insert all the second target acquisition data in the time dictionary (time dict) into the array (over threshold arr) with a traffic volume exceeding the threshold, and obtain the second target acquisition data sequence based on the array with the threshold exceeded. At the same time, clear all the second target acquisition data in the time dictionary.
[0064] If the time length of the second target acquisition data sequence in the current time period is greater than the second time length (for example, 30 s), it indicates that the duration during which the traffic data of the network device is continuously lower than the traffic threshold in the current time period is greater than the second time length. Then, it is determined that the network device is in a normal network state in the current time period, and the network state parameter of the network device is set to 0.
[0065] Through traversing the acquisition data belonging to the current time period, the present invention realizes automatically obtaining the second target acquisition data with a traffic volume greater than the traffic threshold, improving the efficiency of traffic monitoring of the network device.
[0066] Based on the above embodiments, if the time length of the first target acquisition data sequence in the current time period is greater than the first time length, after confirming that the network device is in a network congestion state in the current time period, it further includes: based on the acquisition situation of the original data in the next time period, updating the acquisition data sequence in real time, and obtaining the second target acquisition data belonging to the next time period and continuous in time in the updated acquisition data sequence to obtain the second target acquisition data sequence of the next time period; if the time length of the second target acquisition data sequence in the next time period is greater than the second time length, it is determined that the network device resumes the normal network state in the next time period.
[0067] Acquire the original data of the next time period, and update the acquisition data sequence in real time according to the original data of the next time period.
[0068] As Figure 4 shown, after performing network congestion monitoring on the network device in the current time period, obtain the updated acquisition data sequence and the network state parameter of the network device in the current time period.
[0069] In the updated collected data sequence, obtain the collected data belonging to the next time period (including the second start time and the second end time) (starting from the collected data corresponding to the second start time until the collected data corresponding to the second end time). From the collected data belonging to the next time period, find at least one second target collected data whose traffic data is less than or equal to the traffic threshold and is continuous in time. According to the time dictionary, obtain the second target collected data sequence of the next time period. Further, if the length of the collected data in the time dictionary is 0 (indicating that there is no collected data), record the timestamp of the last traversed collected data as the starting point for the next traversal, and end the monitoring of the network congestion of the network device.
[0070] According to the timestamp of the first second target collected data and the timestamp of the last second target collected data in the second target collected data sequence of the next time period, obtain the time length of the second target collected data sequence of the next time period.
[0071] If the time length of the second target collected data sequence of the next time period is greater than the second duration (e.g., 30s), it indicates that the duration during which the traffic data of the network device is continuously lower than the traffic threshold in the next time period is greater than the second duration. At this time, it is considered that the network device restores the normal network state in the next time period. If the time length of the second target collected data sequence of the next time period is less than or equal to the second duration (e.g., 30s), at this time, it cannot be determined that the network device restores the normal network state in the next time period, and directly delete this second target collected data sequence in the time dictionary. Perform subsequent monitoring of network congestion.
[0072] If it is monitored that the network device restores the normal network state in the next time period, check whether the network status parameter of the network device is 1. If the network status parameter is 1 at this time, send a prompt message to set the network status parameter to 0 and delete this second target collected data sequence in the time dictionary. If the network status parameter is 0 at this time, there is no need to send a prompt message, and directly delete this first target collected data sequence in the time dictionary. Perform subsequent monitoring of network congestion.
[0073] The embodiment of the present invention determines that the network device restores the normal network through the time length of the second target collected data sequence of the next time period, realizes the real-time monitoring of the change of the network congestion state of the network device, and improves the monitoring efficiency of network congestion.
[0074] Based on the above embodiments, if the time length of the first target acquisition data sequence in the current time period is greater than the first duration, after confirming that the network device is in a network congestion state in the current time period, it further includes: based on the acquisition situation of the original data in the next time period, updating the acquisition data sequence in real time, and in the updated acquisition data sequence, obtaining the first target acquisition data that belongs to the next time period and is continuous in time to obtain the first target acquisition data sequence of the next time period; if the time length of the first target acquisition data sequence in the next time period is greater than the first duration, it is determined that the network device remains in a network congestion state in the next time period.
[0075] After detecting that the network device is in a network congestion state in the current time period, acquire the original data in the next time period, and update the acquisition data sequence in real time according to the original data in the next time period.
[0076] As Figure 4 shown, in the updated acquisition data sequence, starting from the acquisition data corresponding to the second start time, traverse the acquisition data belonging to the next time period, and sequentially add at least one first target acquisition data that is continuous in time to the time dictionary until the first traffic data less than or equal to the traffic threshold (the second target acquisition data) is traversed, and end the traversal, or until the acquisition data corresponding to the second end time is traversed, and end the traversal.
[0077] Obtain the first target acquisition data sequence of the next time period according to all the first target acquisition data in the time dictionary.
[0078] Obtain the time length of the first target acquisition data sequence of the next time period. If the time length of the first target acquisition data sequence in the next time period is greater than the first duration (for example, 60s), it indicates that in the next time period of the network device, the duration of the traffic data continuously higher than the traffic threshold is greater than the first duration. At this time, it is considered that the network device is still in a network congestion state in the next time period. If the time length of the first target acquisition data sequence in the next time period is less than or equal to the first duration (for example, 60s), at this time, it cannot be determined that the network device is still in a network congestion state in the next time period, then directly delete the first target acquisition data sequence in the time dictionary. Take the next time period as the current time period, and circularly monitor the network congestion situation of the network device.
[0079] If it is monitored that the network device is still in a network congestion state in the next time period, check whether the network status parameter of the network device is 0. If the network status parameter is 0 at this time, send a prompt message to set the network status parameter to 1 and delete the first target acquisition data sequence in the time dictionary. If the network status parameter is 1 at this time, there is no need to send a prompt message, directly delete the first target acquisition data sequence in the time dictionary, use the next time period as the current time period, and loop to monitor the network congestion situation of the network device.
[0080] In the embodiment of the present invention, the time length of the first target acquisition data sequence in the next time period is used to determine whether the network device is still in a network congestion state, realizing continuous monitoring of the network congestion state of the network device and improving the monitoring efficiency of network congestion.
[0081] Based on the above embodiment, the acquisition data sequence is updated in real time based on the acquisition situation of the original data in the next time period, including: deleting the acquisition data belonging to the current time period in the acquisition data sequence to obtain a reduced acquisition data sequence; based on the acquisition situation of the original data in the next time period, obtaining the acquisition data in the next time period, and adding the acquisition data in the next time period to the reduced acquisition data sequence to obtain an updated acquisition data sequence.
[0082] After the traffic data monitoring of the current time period is completed, the acquisition data belonging to the current time period is deleted from the acquisition data sequence, and at the same time, according to the original data of the next time period, updated acquisition data is obtained to realize the real-time update of the acquisition data sequence.
[0083] The present invention realizes the real-time update of the acquisition data sequence by deleting the acquisition data of the current time period in real time and adding the acquisition data of the next time period in real time, and further realizes the real-time update of the acquisition data, which is beneficial to improving the monitoring efficiency of network congestion.
[0084] The network status monitoring device provided by the present invention is described below. The network status monitoring device described below can be correspondingly referred to the network status monitoring method described above.
[0085] As Figure 5 shown, a network status monitoring device includes: an acquisition module 501, configured to obtain an acquisition data set of a network device according to the original data of discrete network devices, and the acquisition data in the acquisition data set includes a timestamp and traffic data.
[0086] A sorting module 502, configured to sort the acquisition data in the acquisition data set according to the timestamp to obtain an acquisition data sequence sorted in time.
[0087] The monitoring module 503 is configured to screen the collected data belonging to the current time period in the collected data sequence according to a traffic threshold to obtain a to-be-monitored collected data sequence; and obtain the network status of the network device in the current time period according to the time length of the to-be-monitored collected data sequence and a preset duration.
[0088] The network status monitoring device provided by an embodiment of the present invention obtains a collected data set of a network device according to the original data of discrete network devices. The collected data in the collected data set includes a time stamp and traffic data; sorts the collected data in the collected data set according to the time stamp to obtain a collected data sequence sorted in time; screens the collected data belonging to the current time period in the collected data sequence according to a traffic threshold to obtain a to-be-monitored collected data sequence; and obtains the network status of the network device in the current time period according to the time length of the to-be-monitored collected data sequence and a preset duration. The present invention determines a collected data sequence according to the original data, realizing real-time monitoring of the network device traffic. By setting a traffic threshold and a preset duration, automatic identification of the network status of the network device is realized, manual monitoring is avoided, and the monitoring efficiency of the network status is improved.
[0089] In one embodiment, the current time period includes a first start time and a first end time. The to-be-monitored collected data sequence includes a first target collected data sequence composed of first target collected data. The first target collected data is the collected data whose traffic data is greater than the traffic threshold. The network status includes a network congestion status. The preset duration includes a first duration. The monitoring module 503 is configured to: determine a collected data sequence belonging to the current time period in the collected data sequence according to the first start time and the first end time; in the collected data sequence belonging to the current time period, starting from the collected data corresponding to the first start time, traverse the collected data to obtain the first target collected data, and sequentially add at least one first target collected data that is continuous in time to a time dictionary until the first collected data whose traffic data is less than or equal to the traffic threshold is traversed, ending the traversal, or until the collected data corresponding to the first end time is traversed, ending the traversal; obtain the first target collected data sequence of the current time period based on all the first target collected data in the time dictionary; and if the time length of the first target collected data sequence of the current time period is greater than the first duration, confirm that the network device is in a network congestion status in the current time period.
[0090] In one embodiment, the data sequence of the data to be monitored for acquisition further includes a second target data sequence of the second target acquisition data, the second target acquisition data being acquisition data with a flow rate data less than or equal to a flow rate threshold, the network state further includes a network normal state, the preset duration further includes a second duration, and the monitoring module 503 is configured to: in the data sequence of the data to be acquired, determine the data sequence of the data to be acquired belonging to the current time period according to the first start time and the first end time; in the data sequence of the data to be acquired belonging to the current time period, starting from the acquisition data corresponding to the first start time, traverse the acquisition data to obtain the second target acquisition data, and sequentially add at least one second target acquisition data that is continuous in time to the time dictionary until the first acquisition data with a flow rate data greater than the flow rate threshold is traversed, and end the traversal, or until the acquisition data corresponding to the first end time is traversed, and end the traversal; based on all the second target acquisition data in the time dictionary, obtain the second target data sequence of the current time period; if the time length of the second target data sequence of the current time period is greater than the second duration, confirm that the network device is in the network normal state within the current time period, and the second duration is less than the first duration.
[0091] In one embodiment, the sorting module 502 is further configured to: update the data sequence of the data to be acquired in real time based on the acquisition situation of the original data in the next time period. The monitoring module 503 is further configured to: in the updated data sequence of the data to be acquired, obtain the second target acquisition data that belongs to the next time period and is continuous in time, to obtain the second target data sequence of the next time period; if the time length of the second target data sequence of the next time period is greater than the second duration, determine that the network device resumes the network normal state in the next time period.
[0092] In one embodiment, the original data includes the identification information, time stamp, and flow rate data of the network device, and the data to be acquired includes key-value pairs with the time stamp as the key and the flow rate data as the value. The acquisition module 501 is configured to: use the time stamp as the key and the flow rate data as the value to convert the original data into key-value pairs; according to the identification information, divide the key-value pairs of the same network device into an acquisition data set.
[0093] In one embodiment, the sorting module 502 is further configured to: delete the data to be acquired belonging to the current time period in the data sequence of the data to be acquired, to obtain a reduced data sequence of the data to be acquired; based on the acquisition situation of the original data in the next time period, obtain the data to be acquired in the next time period, and add the data to be acquired in the next time period to the reduced data sequence of the data to be acquired, to obtain the updated data sequence of the data to be acquired.
[0094] In one embodiment, the sorting module 502 is further configured to: update the acquisition data sequence in real time based on the acquisition situation of the raw data in the next time period. The monitoring module 503 is further configured to: in the updated acquisition data sequence, obtain the first target acquisition data belonging to the next time period and continuous in time to obtain the first target acquisition data sequence of the next time period; if the time length of the first target acquisition data sequence of the next time period is greater than the first duration, determine that the network device is in a network congestion state in the next time period.
[0095] Figure 6 Schematic diagram of the physical structure of an electronic device is exemplified, as Figure 6 shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640. Among them, the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the logical instructions in the memory 630 to execute the method for monitoring the network state, and the method includes: obtaining the acquisition data set of the network device according to the raw data of the discrete network device, and the acquisition data in the acquisition data set includes a timestamp and traffic data; sorting the acquisition data in the acquisition data set according to the timestamp to obtain the acquisition data sequence sorted in time; in the acquisition data sequence, screening the acquisition data belonging to the current time period according to the traffic threshold to obtain the acquisition data sequence to be monitored; obtaining the network state of the network device in the current time period according to the time length of the acquisition data sequence to be monitored and the preset duration.
[0096] In addition, when the logical instructions in the above-mentioned memory 630 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc that can store program codes.
[0097] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes the monitoring method of the network state provided by the above-mentioned various methods. The method includes: obtaining a collection data set of network devices according to the original data of discrete network devices, and the collection data in the collection data set includes a timestamp and traffic data; sorting the collection data in the collection data set according to the timestamp to obtain a collection data sequence sorted in time; in the collection data sequence, screening the collection data belonging to the current time period according to a traffic threshold to obtain a collection data sequence to be monitored; and obtaining the network state of the network device in the current time period according to the time length of the collection data sequence to be monitored and a preset time length.
[0098] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0099] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0100] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or equivalently replace some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of the present invention.
Claims
1. A method for monitoring network status, characterized in that, Including: Obtain a collection data set of network devices according to the original data of discrete network devices, where the collection data in the collection data set includes time stamps and traffic data; Sort the collection data in the collection data set according to the time stamps to obtain a collection data sequence sorted in time; In the collection data sequence, filter the collection data belonging to the current time period according to a traffic threshold to obtain a to-be-monitored collection data sequence; according to the time length of the to-be-monitored collection data sequence and a preset duration, obtain the network status of the network device in the current time period.
2. The monitoring method of the network state according to claim 1, wherein The current time period includes a first start time and a first end time, the to-be-monitored collection data sequence includes a first target collection data sequence composed of first target collection data, the first target collection data is collection data with traffic data greater than the traffic threshold, the network status includes a network congestion status, the preset duration includes a first duration, and in the collection data sequence, filter the collection data belonging to the current time period according to the traffic threshold to obtain a to-be-monitored collection data sequence; According to the time length of the to-be-monitored collection data sequence and the preset duration, obtaining the network status of the network device in the current time period includes: In the collection data sequence, determine the collection data sequence belonging to the current time period according to the first start time and the first end time; In the collection data sequence belonging to the current time period, starting from the collection data corresponding to the first start time, traverse the collection data, obtain the first target collection data, and sequentially add at least one consecutive first target collection data in time to a time dictionary until traversing to the first collection data with traffic data less than or equal to the traffic threshold, ending the traversal, or until traversing the collection data corresponding to the first end time, ending the traversal; Based on all the first target collection data in the time dictionary, obtain the first target collection data sequence of the current time period; If the time length of the first target collection data sequence of the current time period is greater than the first duration, confirm that the network device is in the network congestion status during the current time period.
3. The monitoring method of the network state according to claim 2, characterized in that, The to-be-monitored collection data sequence further includes a second target collection data sequence composed of second target collection data, the second target collection data is collection data with traffic data less than or equal to the traffic threshold, the network status further includes a network normal status, the preset duration further includes a second duration, and in the collection data sequence, filter the collection data belonging to the current time period according to the traffic threshold to obtain a to-be-monitored collection data sequence; According to the time length of the to-be-monitored collection data sequence and the preset duration, obtaining the network status of the network device in the current time period includes: In the collection data sequence, determine the collection data sequence belonging to the current time period according to the first start time and the first end time; In the acquisition data sequence belonging to the current time period, starting from the acquisition data corresponding to the first start time, traverse the acquisition data to obtain the second target acquisition data, and sequentially add at least one second target acquisition data that is continuous in time to the time dictionary until the acquisition data with the first traffic data greater than the traffic threshold is traversed, and the traversal ends, or until the acquisition data corresponding to the first termination time is traversed, and the traversal ends; Based on all the second target acquisition data in the time dictionary, obtain the second target acquisition data sequence of the current time period; If the time length of the second target acquisition data sequence of the current time period is greater than the second duration, it is confirmed that the network device is in the network normal state within the current time period, and the second duration is less than the first duration.
4. The monitoring method of network status according to claim 2, characterized in that, After the step of if the time length of the first target acquisition data sequence of the current time period is greater than the first duration, it is confirmed that the network device is in the network congestion state within the current time period, further includes: Based on the acquisition situation of the original data in the next time period, update the acquisition data sequence in real time. In the updated acquisition data sequence, obtain the second target acquisition data that belongs to the next time period and is continuous in time to obtain the second target acquisition data sequence of the next time period; if the time length of the second target acquisition data sequence of the next time period is greater than the second duration, it is determined that the network device restores the network normal state in the next time period.
5. The monitoring method of the network state according to claim 1, characterized in that The original data includes the identification information of the network device, the time stamp, and the traffic data. The acquisition data includes key-value pairs with the time stamp as the key and the traffic data as the value. The method for obtaining the acquisition data set of the network device according to the discrete original data of the network device includes: Taking the time stamp as the key and the traffic data as the value to convert the original data into key-value pairs; According to the identification information, divide the key-value pairs of the same network device into one acquisition data set.
6. The monitoring method of the network state according to claim 4, characterized in that The step of updating the acquisition data sequence in real time based on the acquisition situation of the original data in the next time period includes: Delete the acquisition data belonging to the current time period in the acquisition data sequence to obtain a pruned acquisition data sequence; Based on the acquisition situation of the original data in the next time period, obtain the acquisition data in the next time period, and add the acquisition data in the next time period to the pruned acquisition data sequence to obtain the updated acquisition data sequence.
7. The monitoring method of the network state according to claim 2, wherein After the step of if the time length of the first target acquisition data sequence of the current time period is greater than the first duration, it is confirmed that the network device is in the network congestion state within the current time period, further includes: Based on the acquisition situation of the original data in the next time period, the acquisition data sequence is updated in real time. In the updated acquisition data sequence, the first target acquisition data that belongs to the next time period and is continuous in time is obtained, and the first target acquisition data sequence for the next time period is obtained; if the time length of the first target acquisition data sequence for the next time period is greater than the first duration, it is determined that the network device maintains the network congestion state in the next time period.
8. A monitoring device for network status, characterized in that, Including: An acquisition module, configured to obtain an acquisition data set of a network device according to the original data of discrete network devices, where the acquisition data in the acquisition data set includes a timestamp and traffic data; A sorting module, configured to sort the acquisition data in the acquisition data set according to the timestamp to obtain an acquisition data sequence sorted in time; A monitoring module, configured to screen the acquisition data belonging to the current time period in the acquisition data sequence according to a traffic threshold to obtain a to-be-monitored acquisition data sequence; and obtain the network state of the network device in the current time period according to the time length of the to-be-monitored acquisition data sequence and a preset duration.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the network state monitoring method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the network state monitoring method according to any one of claims 1 to 7.