A network anomaly assessment method, device, electronic device and storage medium
By determining the degree of anomaly of a target device in an IoT system and its impact on other devices, and by assessing the overall operating status of the IoT system in conjunction with the network topology, this method solves the problem of the inability to accurately assess the overall operating status of an IoT system in existing technologies, and achieves efficient network anomaly detection.
Patent Information
- Application Number
- CN202111079157.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-15
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-09-15
AI Technical Summary
Existing technologies cannot accurately assess the overall operational status of an IoT system, and even knowing the operational status of a single device cannot determine the operational status of the entire system.
By identifying the target device in the network to be evaluated, assessing the degree of anomaly of the device and its impact on other devices, and quickly determining the target device based on the network topology, the overall network operating status is comprehensively evaluated using the evaluation value formula.
It enables accurate assessment of the overall operational status of IoT systems, improves the efficiency and accuracy of assessment, and can promptly detect network anomalies.
Smart Images

Figure CN115834437B_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the field of security technology, and in particular to a network anomaly assessment method, device, electronic device and storage medium. [Background technology]
[0002] The existing technology can only evaluate the operating status of a single device in the Internet of Things system, but the devices in the Internet of Things system are related to each other. Therefore, even if the operating status of a single device is known, the operating status of the entire Internet of Things system cannot be determined. In other words, the existing technology cannot evaluate the overall operating status of the Internet of Things system. [Summary of the invention]
[0003] The embodiments of the present application provide a network anomaly assessment method, device, electronic device and storage medium, which can improve the problem in the prior art that the overall operating status of the Internet of Things cannot be accurately assessed.
[0004] In a first aspect, an embodiment of the present application provides a method for evaluating network anomalies, the method comprising:
[0005] Determine at least one target device in a network to be evaluated, wherein the network to be evaluated includes at least a first-level device and a second-level device directly connected to the first-level device, the second-level device is used to receive a data packet sent from the first-level device, and the at least one target device includes all the second-level devices;
[0006] Determine an evaluation value corresponding to each target device when processing a data packet, wherein the evaluation value is used to characterize the abnormality degree of the target device and the degree of influence of the target device on other devices when the abnormality occurs, and the abnormality degree and the influence degree are both positively correlated with the evaluation value;
[0007] Determine the total evaluation value of the network to be evaluated based on the evaluation values of each target device;
[0008] If the total evaluation value is greater than a set threshold, it is determined that an abnormality occurs in the network to be evaluated.
[0009] In the embodiment of the present application, at least one target device is determined in the network to be evaluated, and the at least one target device can be considered as a device at an important node in the network to be evaluated. Then, the evaluation value corresponding to each target device when processing a data packet is determined. Since the evaluation value of each target device can characterize the degree of abnormality of the target device itself and the degree of influence of the abnormality of the target device on other devices, the evaluation values of each target device can be aggregated to obtain a total evaluation value for the entire network to be evaluated, and when the total evaluation value is large, it is determined that the network to be evaluated has an abnormality. In other words, in this method, the operating status of the more important devices in the network to be evaluated and the impact on other devices are comprehensively evaluated to achieve the purpose of accurately evaluating the operating status of the entire network.
[0010] Optionally, determining at least one target device in the network to be evaluated includes:
[0011] Obtaining a network topology structure of the network to be evaluated;
[0012] Determine all the first-level devices from the network topology;
[0013] A second-level device directly connected to the first-level device in the network topology is determined as the target device.
[0014] In an embodiment of the present application, by obtaining the network topology structure of the network to be evaluated, all first-level devices can be determined from the network topology structure, and then the second-level devices can be quickly determined based on the connection relationship between the first-level devices and the second-level devices defined by the network topology structure, that is, the target device can be quickly determined.
[0015] Optionally, the network to be evaluated further includes a third-level device directly connected to the second-level device, and the method further includes:
[0016] Part of the third-level devices whose number of directly connected second-level devices exceeds a set threshold among the third-level devices is determined as the target device.
[0017] In an embodiment of the present application, the network to be evaluated also includes third-level devices directly connected to the second-level devices. At this time, the third-level devices with a large number of connected second-level devices can be used as target devices, that is, the more important third-level devices can be used as target devices, so as to more accurately evaluate the entire network to be evaluated.
[0018] Optionally, the total evaluation value is based on the following formula:
[0019] A=∑ i W i *A i
[0020] Among them, A represents the total evaluation value, W i Indicates the degree of impact on other devices when the i-th target device is abnormal, A i Indicates the abnormality level of the i-th target device.
[0021] In the embodiment of the present application, the evaluation values of the target devices may be accumulated to obtain the total evaluation value of the network to be evaluated in a relatively simple manner.
[0022] Optionally, the W i Determined based on the following formula:
[0023] W i =D i *max(N1*N2)
[0024] Among them, D i It represents the number of other devices directly connected to the i-th target device, N1 represents the number of first-level devices directly or indirectly connected to the i-th target device, and N2 represents the number of devices in the link formed with the i-th target device as the first endpoint and any first-level device as the second endpoint.
[0025] In an embodiment of the present application, a more accurate assessment can be made of the impact of an abnormality in the current target device on other devices based on three aspects: the number of other devices directly connected to the current target device, the number of first-level devices directly or indirectly connected, and the maximum length of the link formed between the current target device and any first-level device.
[0026] Optionally, the A i Determined based on the following formula:
[0027]
[0028] Among them, A i Indicates the abnormality degree of the i-th target device, B j It indicates the deviation between the size of the jth data packet processed by the i-th target device and the maximum and minimum values of the data packets processed by the same target device in the historical time period. N3 indicates the number of data packets processed by the i-th target device. It represents the average number of packets sent by each device to the i-th target device among other devices directly connected to the i-th target device. max11 represents the maximum number of packets from the same source IP in the i-th target device. It indicates the proportion of data packets from the same source IP in the i-th target device to the total number of data packets. max12 indicates the maximum number of data packets forwarded to the same destination IP in the i-th target device. It indicates the ratio of the data packets forwarded to the same destination IP in the i-th target device to the total number of data packets. max13 indicates the maximum number of data packets from the same source IP in the i-th target device and forwarded to the same destination IP. It indicates the ratio of the data packets from the same source IP in the i-th target device and forwarded to the same destination IP to the total number of data packets. max23 indicates the maximum number of data packets from the same source port in the i-th target device and forwarded to the same destination port. Indicates the proportion of data packets from the same source port in the i-th target device and forwarded to the same destination port to the total number of data packets, ΔT j represents the average time it takes for the i-th target device to process each data packet, ∑ j ΔT j Indicates the total duration of all data packets processed by the i-th target device.
[0029] In an embodiment of the present application, a more accurate assessment of the degree of abnormality of the current target device can be made based on multiple aspects, such as the degree of deviation of the data packets processed by the current target device compared to the maximum and minimum values of the data packets processed in the historical time period, the proportion of the data packets processed by the current target device that come from the same source IP address, the proportion of the data packets processed by the current target device that are forwarded to the same destination IP address, the proportion of the datagrams processed by the current target device that come from the same source IP address and are forwarded to the same destination IP address, and the total duration of the data packets processed by the current target device.
[0030] Optionally, Bj is determined based on the following formula:
[0031]
[0032] Among them, P j It represents the actual size of the jth data packet in the i-th target device, max3 represents the maximum value of the data packet processed by the i-th target device in the historical time period, and min3 represents the minimum value of the data packet processed by the i-th target device in the historical time period.
[0033] In the embodiment of the present application, the above formula can be used to easily calculate the degree of deviation between the maximum value and the minimum value of any data packet processed by the current target device and the data packets processed in the past.
[0034] In a second aspect, an embodiment of the present application provides a network anomaly assessment device, the device comprising:
[0035] a target device determining unit, configured to determine at least one target device in a network to be evaluated, wherein the network to be evaluated includes at least a first-level device and a second-level device directly connected to the first-level device, wherein the second-level device is configured to receive a data packet sent from the first-level device, and the at least one target device includes all of the second-level devices;
[0036] An evaluation value determination unit, used to determine the evaluation value corresponding to each target device when processing a data packet, wherein the evaluation value is used to characterize the abnormality degree of the target device and the degree of influence of the target device on other devices when the abnormality occurs, and the abnormality degree and the influence degree are both positively correlated with the evaluation value;
[0037] A total evaluation value determining unit, configured to determine a total evaluation value of the network to be evaluated based on the evaluation values of each target device;
[0038] The network evaluation unit is used to determine that an abnormality occurs in the network to be evaluated when the total evaluation value is greater than a set threshold.
[0039] Optionally, the target device determination unit is specifically used to:
[0040] Obtaining a network topology structure of the network to be evaluated;
[0041] Determine all the first-level devices from the network topology;
[0042] A second-level device directly connected to the first-level device in the network topology is determined as the target device.
[0043] Optionally, the network to be evaluated further includes a third-level device directly connected to the second-level device, and the target device determination unit is further configured to:
[0044] Part of the third-level devices whose number of directly connected second-level devices exceeds a set threshold among the third-level devices is determined as the target device.
[0045] Optionally, the total evaluation value is based on the following formula:
[0046] A=∑ i W i *A i
[0047] Among them, A represents the total evaluation value, W i Indicates the degree of impact on other devices when the i-th target device is abnormal, A i Indicates the abnormality degree of the i-th target device.
[0048] Optionally, the W i Determined based on the following formula:
[0049] W i =D i *max(N1*N2)
[0050] Among them, D i It represents the number of other devices directly connected to the i-th target device, N1 represents the number of first-level devices directly or indirectly connected to the i-th target device, and N2 represents the number of devices in the link formed with the i-th target device as the first endpoint and any first-level device as the second endpoint.
[0051] Optionally, the A i Determined based on the following formula:
[0052]
[0053] Among them, A i Indicates the abnormality degree of the i-th target device, B j It indicates the deviation between the size of the jth data packet processed by the i-th target device and the maximum and minimum values of the data packets processed by the same target device in the historical time period. N3 indicates the number of data packets processed by the i-th target device. It represents the average number of packets sent by each device to the i-th target device among other devices directly connected to the i-th target device. max11 represents the maximum number of packets from the same source IP in the i-th target device. It indicates the proportion of data packets from the same source IP in the i-th target device to the total number of data packets. max12 indicates the maximum number of data packets forwarded to the same destination IP in the i-th target device. It indicates the ratio of the data packets forwarded to the same destination IP in the i-th target device to the total number of data packets. max13 indicates the maximum number of data packets from the same source IP in the i-th target device and forwarded to the same destination IP. It indicates the ratio of the data packets from the same source IP in the i-th target device and forwarded to the same destination IP to the total number of data packets. max23 indicates the maximum number of data packets from the same source port in the i-th target device and forwarded to the same destination port. Indicates the proportion of data packets from the same source port in the i-th target device and forwarded to the same destination port to the total number of data packets, ΔT j represents the average time it takes for the i-th target device to process each data packet, ∑ j ΔT j Indicates the total duration of all data packets processed by the i-th target device.
[0054] Optionally, Bj is determined based on the following formula:
[0055]
[0056] Among them, P j It represents the actual size of the jth data packet in the i-th target device, max3 represents the maximum value of the data packet processed by the i-th target device in the historical time period, and min3 represents the minimum value of the data packet processed by the i-th target device in the historical time period.
[0057] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the steps of the method described in any embodiment of the first aspect when executing a computer program stored in the memory.
[0058] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method as described in any embodiment of the first aspect.
[0059] It should be understood that the second to fourth aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be described in detail.
Brief Description of the Drawings
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 An architecture diagram of an Internet of Things system provided in an embodiment of the present application;
[0062] Figure 2 A flowchart of a method for evaluating network anomalies provided in an embodiment of the present application;
[0063] Figure 3 A schematic diagram of the structure of a network anomaly assessment device provided in an embodiment of the present application;
[0064] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. [Specific implementation method]
[0065] In order to better understand the technical solution of this specification, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0066] It should be clear that the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0067] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit this specification. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0068] With the rapid development of the Internet of Things, network threats and other network-related issues are increasing day by day, such as network attacks, data theft, viruses, worms, malicious port scanning activities, etc. Network threats are acting faster, changing faster, and becoming more complex. Currently, despite the perimeter defense, network threats can still penetrate directly through computer networks, so network anomaly assessment is very important.
[0069] The inventors of the present application have found through research that when it is necessary to evaluate the operating status of an IoT system, an additional monitoring device is usually set up outside the IoT system, and the monitoring device analyzes the data of each device in the IoT system separately, so as to obtain the operating status of each device in the IoT system. For example, the operating status of an IoT system is mainly divided into normal operation and abnormal operation. Since the various devices in the IoT system are interrelated, and the above method does not take into account the different importance of different devices in the IoT system, and the impact of abnormalities in different devices on other devices, even if the operating status of a single device is known, it is impossible to accurately evaluate the overall operating status of the IoT system.
[0070] In view of this, an embodiment of the present application provides a method for evaluating network anomalies. In this method, by evaluating the operating status of more important devices in the evaluated network and the impact on other devices, and summarizing the evaluation results of the more important devices, a more accurate evaluation of the overall operating status of the Internet of Things system can be performed.
[0071] For ease of understanding, an application scenario of the embodiment of the present application is first introduced. Figure 1 , is an architecture diagram of an Internet of Things system provided in an embodiment of the present application. Figure 1It includes IoT terminal A, IoT terminal B, IoT terminal C, gateway A, local server A, local server B, cloud server A, cloud server B and cloud server C. Among them, each IoT terminal (IoT terminal A, IoT terminal B, IoT terminal C) can be considered to be mainly used to collect data, such as temperature data, humidity data, pressure data, etc., and there is no special restriction on the specific type of data that can be collected by each IoT terminal. Gateway A is mainly used to forward data, for example, forwarding data from IoT terminal B to local server B and cloud server A. Local server A, local server B, cloud server A, cloud server B and cloud server C are mainly used to directly or indirectly receive data from IoT terminals and process these data. Taking IoT terminal A as an example, the data transmission process in the entire IoT system is explained below.
[0072] The data collected by IoT terminal A can be sent to local server A and local server B respectively. For local server A, after obtaining the data collected from IoT terminal A, local server A can directly send the data to cloud server C via the first link, or send the data to cloud server A via the second link, and finally reach cloud server C via cloud server B. For local server B, after obtaining the data collected from IoT terminal A, local server B can directly process the received data without sending the processed data to other devices. It should be understood that Figure 1 The arrow direction shown in the figure indicates the direction of data transmission.
[0073] The following is an introduction to the technical solution provided by the embodiment of the present application in conjunction with the accompanying drawings. Figure 1 For example, see the application scenario shown in Figure 2 The embodiment of the present invention provides a method for evaluating network anomalies. The method can be applied to a network anomaly evaluation device set outside the Internet of Things system. The device can be a server or other device with computing capabilities. There is no special limitation here. The process of the method is described as follows:
[0074] Step 101: Determine at least one target device in a network to be evaluated, wherein the network to be evaluated includes at least a first-level device and a second-level device directly connected to the first-level device, wherein the second-level device is used to receive a data packet sent from the first-level device, and the at least one target device includes all the second-level devices.
[0075] In the IoT system, different devices have different importance levels. It should be understood that the importance here refers to the impact of abnormalities in the device on the entire IoT system.
[0076] Please continue to see Figure 1 For example, when an abnormality occurs in IoT terminal A, it will only cause IoT terminal A to be unable to collect data, while other parts of the IoT system can still operate normally; when an abnormality occurs in cloud server A, not only the data collected by IoT terminal C cannot be transmitted to cloud server B and cloud server C through cloud server A, but also the data collected by IoT terminal A cannot be transmitted to cloud server B and cloud server C through cloud server A. In other words, when the abnormal device is cloud server A, the impact on the entire IoT system is greater than that on IoT terminal A.
[0077] In view of this, in the embodiment of the present application, when the operation status of the Internet of Things is evaluated as a whole, the more important devices can be used as the basis for evaluation, so as to improve the accuracy of the evaluation. Before this, it is necessary to determine the more important devices from the Internet of Things system.
[0078] As a possible implementation, the network to be evaluated may include at least a first-level device and a second-level device directly connected to the first-level device. It should be understood that the first-level device may be an IoT terminal device, for example, the first-level device may be an IoT terminal A, an IoT terminal B, or an IoT terminal C. The second-level device may be a device for data forwarding or a device for data processing. For example, the second-level device may be a gateway A, a local server A, a local server B, or a cloud server A. Since the second-level device is used to directly receive data packets from the first-level device, that is, in the entire IoT system, the second-level device plays a role in aggregating data packets, therefore, the second-level device is in a relatively important position in the entire IoT system, and the network anomaly evaluation device may use all the second-level devices as the benchmark for evaluation, that is, at least one target device determined from the network to be evaluated should include all the second-level devices.
[0079] Considering that the network to be evaluated may include multiple first-level devices and multiple second-level devices, the efficiency of determining the target device by traversal is obviously low. Therefore, in the embodiment of the present application, the target device can be determined according to the connection relationship between the first-level devices and the second-level devices in the network to be evaluated, thereby improving the efficiency of determining the target device.
[0080] As a possible implementation, the network anomaly evaluation device can obtain the network topology structure corresponding to the network to be evaluated, and then determine all the first-level devices from the network topology structure. It should be understood that the first-level devices all have their own identifications, and all the first-level devices can be determined in the network topology structure based on the identifications of the first-level devices. On this basis, according to the connection relationship between the first-level devices and the second-level devices defined in the network topology structure, all the second-level devices can be quickly determined, so that all the second-level devices are used as target devices.
[0081] In some embodiments, in addition to the first-level device and the second-level device directly connected to the first-level device, the network to be evaluated may also include a third-level device directly connected to the second-level device, that is, the third-level device is indirectly connected to the first-level device. Figure 1 , the third-level devices can be cloud server B and cloud server C. At this time, whether to use the third-level devices as target devices can be determined according to their importance in the IoT system. For example, if some third-level devices are directly connected to multiple second-level devices, it means that these third-level devices need to process data packets sent by multiple second-level devices, that is, these third-level devices are more important in the entire IoT system; if some third-level devices are only directly connected to one or two second-level devices, it means that these third-level devices only need to process data packets sent by one or two second-level devices, that is, these third-level devices are not very important in the entire IoT system, thereby avoiding using all third-level devices as target devices, thereby increasing the amount of calculation when performing network anomaly assessment.
[0082] As a possible implementation, the network anomaly assessment device can determine all third-level devices in the network to be assessed based on the network topology of the network to be assessed, and then select some third-level devices whose number of directly connected second-level devices exceeds a set threshold as target devices.
[0083] For example, see Figure 1 ,The third level devices include cloud servers B and C. The threshold is set to 2. The number of second level devices connected to cloud server B is 2, and the number of second level devices connected to cloud server C is 3, which is greater than the set threshold. Therefore, cloud server C can be used as the target device, but cloud server B does not need to be used as the target device.
[0084] Step 102: Determine the evaluation value corresponding to each target device when processing a data packet. The evaluation value is used to characterize the abnormality degree of the target device and the impact degree of the target device on other devices when the abnormality occurs. The abnormality degree and the impact degree are both positively correlated with the evaluation value.
[0085] After the target device is determined from the network to be evaluated, the operating status of the target device can be evaluated based on the data packets processed by the target device, and the impact of the current status of the target device on the overall IoT system can be evaluated.
[0086] As a possible implementation, the network anomaly evaluation device can determine the evaluation value corresponding to each target device when processing a data packet. The evaluation value is composed of two parts. The first part can characterize the degree of anomaly of the target device itself, and the second part can characterize the degree of impact on other devices when the target device is abnormal. The following specifically describes how to obtain the two parts of the evaluation value respectively.
[0087] First: Calculate the abnormality level of the target device.
[0088] Considering that the abnormality of the target device itself may be related to many factors, for example, the data packet processed by the target device is too large or too small (data packet size abnormality), a large number of data packets processed by the target device come from the same IP address or the same port (data packet source abnormality), or the data packets processed by the target device need to be forwarded to the same destination IP address or the same destination port (data packet destination abnormality), or the target device takes a long time to process the data packet (data packet processing speed abnormality), etc. Therefore, in the embodiment of the present application, the abnormality of the target device can be evaluated from the above multiple aspects, thereby improving the accuracy of the evaluation of the abnormality of the target device.
[0089] As a possible implementation, the abnormality level A of each target device i It can be calculated based on the following formula (1):
[0090]
[0091] Among them, A i Indicates the abnormality degree of the i-th target device, B j It indicates the deviation between the size of the jth data packet processed by the i-th target device and the maximum and minimum values of the data packets processed by the same target device in the historical time period. N3 indicates the number of data packets processed by the i-th target device. It represents the average number of packets sent by each device to the i-th target device among other devices directly connected to the i-th target device. max11 represents the maximum number of packets from the same source IP in the i-th target device. It indicates the proportion of data packets from the same source IP in the i-th target device to the total number of data packets. max12 indicates the maximum number of data packets forwarded to the same destination IP in the i-th target device. It indicates the ratio of the data packets forwarded to the same destination IP in the i-th target device to the total number of data packets. max13 indicates the maximum number of data packets from the same source IP in the i-th target device and forwarded to the same destination IP. It indicates the ratio of the data packets from the same source IP in the i-th target device and forwarded to the same destination IP to the total number of data packets. max23 indicates the maximum number of data packets from the same source port in the i-th target device and forwarded to the same destination port. Indicates the proportion of data packets from the same source port in the i-th target device and forwarded to the same destination port to the total number of data packets, ΔT j represents the average time it takes for the i-th target device to process each data packet, ∑ j ΔT j Indicates the total time it takes for the i-th target device to process all data packets.
[0092] It should be understood that the above-mentioned multiple factors for evaluating the abnormality degree of the target device can be freely combined according to actual conditions, and other factors can also be added according to actual conditions, and there is no special limitation here.
[0093] Second: Calculate the impact of abnormalities on other devices when the target device has an abnormality.
[0094] Considering that the degree of impact on other devices when the target device is abnormal may be related to multiple factors, for example, the number of other devices directly connected to the target device, when the target device is abnormal, all other devices directly connected to it will be affected. The more other devices directly connected to the target device, the greater the degree of impact; or, the number of first-level devices directly or indirectly connected to the target device, when the target device is abnormal, it is definitely impossible to receive or forward data packets from the first-level devices. If the target device is directly or indirectly connected to more first-level devices, a large number of data packets cannot be processed, and the degree of impact is also greater; or, the longer the link formed by the target device and any first-level device, when the target device is abnormal, the more other devices are affected, and at the same time, the longer the above link, the more fragile the entire link can be considered, that is, as long as any device on the link is abnormal, the link will be abnormal. Therefore, in the embodiment of the present application, the degree of impact on other devices when the target device is abnormal can be evaluated based on the above multiple factors, so that the obtained degree of impact is more accurate.
[0095] As a possible implementation method, the degree of impact of each target device on other devices when an abnormality occurs is W i It can be calculated based on the following formula (2):
[0096] W i =D i *max(N1*N2) (2)
[0097] Among them, D i It represents the number of other devices directly connected to the i-th target device, N1 represents the number of first-level devices directly or indirectly connected to the i-th target device, and N2 represents the number of devices in the link formed with the i-th target device as the first endpoint and any first-level device as the second endpoint.
[0098] It should be understood that the above-mentioned multiple factors for evaluating the impact degree when an abnormality occurs in the target device can be freely combined according to actual conditions, and other factors can also be added according to actual conditions, and there is no special limitation here.
[0099] In some embodiments, considering that for any target device, the size of the data packet processed by it should satisfy a certain rule, that is, the size of the data packet processed by any target device should be within an interval formed by a minimum value and a maximum value. If the data packet processed by the target device continues to be a larger data packet (that is, exceeding the historical maximum value) or continues to be a smaller data packet (lower than the historical minimum value), it can be considered that the target device may be abnormal. In the embodiment of the present application, the degree of abnormality of the target device can be measured based on the degree of deviation between the size of the data packet currently processed by the target device and the minimum and maximum values in the historical time period.
[0100] As a possible implementation, the deviation degree between the size of the data packet currently processed by the target device and the minimum value and the maximum value in the historical time period can be calculated based on the following formula (3):
[0101]
[0102] Among them, P j It represents the actual size of the jth data packet in the i-th target device, max3 represents the maximum value of the data packet processed by the i-th target device in the historical time period, and min3 represents the minimum value of the data packet processed by the i-th target device in the historical time period.
[0103] Step 103: Determine the total evaluation value of the network to be evaluated based on the evaluation values of each target device.
[0104] After obtaining the abnormality degree of each target device itself and the degree of impact on other devices, the operating status of each target device can be summarized to obtain the operating status of the entire Internet of Things system.
[0105] As a possible implementation, the network anomaly evaluation device may accumulate the evaluation values of the target devices, thereby obtaining the total evaluation value of the network to be evaluated in a relatively simple manner.
[0106] Specifically, the total evaluation value can be calculated based on the following formula (4):
[0107] A=∑ i W i *A i (4)
[0108] Among them, A represents the total evaluation value, W i Indicates the degree of impact on other devices when the i-th target device is abnormal, A i Indicates the abnormality level of the i-th target device.
[0109] Step 104: If the total evaluation value is greater than the set threshold, it is determined that an abnormality occurs in the network to be evaluated.
[0110] In the embodiment of the present application, since the degree of abnormality of a single target device itself and the degree of impact on other devices when an abnormality occurs are positively correlated with the evaluation value, when the total evaluation value of the Internet of Things system is large, it can be considered that the abnormality of at least one target device has brought a more serious impact on the Internet of Things system. At this time, it can be determined that the entire Internet of Things system has an abnormality.
[0111] As a possible implementation, when the network abnormality evaluation device determines that the total evaluation value of the network to be evaluated is greater than a set threshold, it can be determined that the network to be evaluated is abnormal. It should be understood that the set threshold can be set according to actual conditions and is not particularly limited here.
[0112] See also Figure 3 Based on the same inventive concept, an embodiment of the present application also provides a network anomaly evaluation device, which includes: a target device determination unit 201, an evaluation value determination unit 202, a total evaluation value determination unit 203 and a network evaluation unit 204.
[0113] The target device determining unit 201 is used to determine at least one target device in the network to be evaluated, the network to be evaluated includes at least a first-level device and a second-level device directly connected to the first-level device, the second-level device is used to receive a data packet sent from the first-level device, and the at least one target device includes all the second-level devices;
[0114] An evaluation value determination unit 202 is used to determine the evaluation value corresponding to each target device when processing a data packet. The evaluation value is used to characterize the abnormality degree of the target device and the degree of influence on other devices when the target device is abnormal, and the abnormality degree and the influence degree are positively correlated with the evaluation value.
[0115] A total evaluation value determining unit 203, configured to determine a total evaluation value of the network to be evaluated based on the evaluation values of each target device;
[0116] The network evaluation unit 204 is configured to determine that an abnormality occurs in the network to be evaluated when the total evaluation value is greater than a set threshold.
[0117] Optionally, the target device determination unit 201 is specifically configured to:
[0118] Obtaining the network topology structure of the network to be evaluated;
[0119] Determine all first-level devices from the network topology;
[0120] A second-level device directly connected to the first-level device in the network topology is determined as a target device.
[0121] Optionally, the network to be evaluated further includes a third-level device directly connected to the second-level device, and the target device determination unit 201 is further configured to:
[0122] Part of the third-level devices whose number of directly connected second-level devices exceeds a set threshold among the third-level devices is determined as target devices.
[0123] Optionally, the total evaluation value is based on the following formula:
[0124] A=∑ i W i *A i
[0125] Among them, A represents the total evaluation value, W i Indicates the degree of impact on other devices when the i-th target device is abnormal, A i Indicates the abnormality level of the i-th target device.
[0126] Optional, W i Determined based on the following formula:
[0127] W i =D i *max(N1*N2)
[0128] Among them, D i It represents the number of other devices directly connected to the i-th target device, N1 represents the number of first-level devices directly or indirectly connected to the i-th target device, and N2 represents the number of devices in the link formed with the i-th target device as the first endpoint and any first-level device as the second endpoint.
[0129] Optional, A i Determined based on the following formula:
[0130]
[0131] Among them, A i Indicates the abnormality degree of the i-th target device, B j It indicates the deviation between the size of the jth data packet processed by the i-th target device and the maximum and minimum values of the data packets processed by the same target device in the historical time period. N3 indicates the number of data packets processed by the i-th target device. It represents the average number of packets sent by each device to the i-th target device among other devices directly connected to the i-th target device. max11 represents the maximum number of packets from the same source IP in the i-th target device. It indicates the proportion of data packets from the same source IP in the i-th target device to the total number of data packets. max12 indicates the maximum number of data packets forwarded to the same destination IP in the i-th target device. It indicates the ratio of the data packets forwarded to the same destination IP in the i-th target device to the total number of data packets. max13 indicates the maximum number of data packets from the same source IP in the i-th target device and forwarded to the same destination IP. It indicates the ratio of the data packets from the same source IP in the i-th target device and forwarded to the same destination IP to the total number of data packets. max23 indicates the maximum number of data packets from the same source port in the i-th target device and forwarded to the same destination port. Indicates the proportion of data packets from the same source port in the i-th target device and forwarded to the same destination port to the total number of data packets, ΔT j represents the average time it takes for the i-th target device to process each data packet, ∑ j ΔT j Indicates the total duration of all data packets processed by the i-th target device.
[0132] Optionally, Bj is determined based on the following formula:
[0133]
[0134] Among them, P j It represents the actual size of the jth data packet in the i-th target device, max3 represents the maximum value of the data packet processed by the i-th target device in the historical time period, and min3 represents the minimum value of the data packet processed by the i-th target device in the historical time period.
[0135] See also Figure 4Based on the same inventive concept, an embodiment of the present application provides an electronic device, the electronic device includes at least one processor 301, the processor 301 is used to execute a computer program stored in a memory, and implement the embodiment of the present application as provided in Figure 2 The steps of the network anomaly assessment method are shown.
[0136] Optionally, the processor 301 may specifically be a central processing unit, a specific ASIC, or one or more integrated circuits for controlling program execution.
[0137] Optionally, the electronic device may further include a memory 302 connected to the at least one processor 301, and the memory 302 may include a ROM, a RAM, and a disk memory. The memory 302 is used to store data required by the processor 301 when it is running, that is, it stores instructions that can be executed by the at least one processor 301. The at least one processor 301 executes the instructions stored in the memory 302 to execute the following steps: Figure 2 The method shown. The number of the memory 302 is one or more. The memory 302 is Figure 4 However, it should be noted that the memory 302 is not a mandatory functional module, so Figure 4 Shown by dotted lines.
[0138] The entity devices corresponding to the target device determination unit 201, the evaluation value determination unit 202, the total evaluation value determination unit 203 and the network evaluation unit 204 can all be the aforementioned processor 301. The electronic device can be used to execute Figure 2 Therefore, for the functions that can be realized by each functional module in the electronic device, please refer to Figure 2 The corresponding description in the illustrated embodiment will not be repeated here.
[0139] The present application also provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes Figure 2 The method described.
[0140] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A method for evaluating network anomalies, characterized in that: The method comprises: Determine at least one target device in a network to be evaluated, wherein the network to be evaluated includes at least a first-level device and a second-level device directly connected to the first-level device, the second-level device is used to receive a data packet sent from the first-level device, and the at least one target device includes all the second-level devices; Determine an evaluation value corresponding to each target device when processing a data packet, wherein the evaluation value is used to characterize the abnormality degree of the target device and the degree of influence of the target device on other devices when the abnormality occurs, and the abnormality degree and the influence degree are both positively correlated with the evaluation value; Determine the total evaluation value of the network to be evaluated based on the evaluation values of each target device; If the total evaluation value is greater than a set threshold, it is determined that the network to be evaluated is abnormal; The total evaluation value is based on the following formula: A=∑ i W i *A i Among them, A represents the total evaluation value, W i Indicates the degree of impact on other devices when the i-th target device is abnormal, A i Indicates the abnormality degree of the i-th target device; The A i Determined based on the following formula: Among them, A i Indicates the abnormality degree of the i-th target device, B j It indicates the deviation between the size of the jth data packet processed by the i-th target device and the maximum and minimum values of the data packets processed by the same target device in the historical time period. N3 indicates the number of data packets processed by the i-th target device. It represents the average number of packets sent by each device to the i-th target device among other devices directly connected to the i-th target device. max11 represents the maximum number of packets from the same source IP in the i-th target device. It indicates the proportion of data packets from the same source IP in the i-th target device to the total number of data packets. max12 indicates the maximum number of data packets forwarded to the same destination IP in the i-th target device. It indicates the ratio of the data packets forwarded to the same destination IP in the i-th target device to the total number of data packets. max13 indicates the maximum number of data packets from the same source IP in the i-th target device and forwarded to the same destination IP. It indicates the ratio of the data packets from the same source IP in the i-th target device and forwarded to the same destination IP to the total number of data packets. max23 indicates the maximum number of data packets from the same source port in the i-th target device and forwarded to the same destination port. Indicates the proportion of data packets from the same source port in the i-th target device and forwarded to the same destination port to the total number of data packets, ΔT j represents the average time it takes for the i-th target device to process each data packet, ∑ j ΔT j Indicates the total duration of all data packets processed by the i-th target device.
2. The method according to claim 1, characterized in that Determining at least one target device in the network to be evaluated includes: Obtaining a network topology structure of the network to be evaluated; Determine all the first-level devices from the network topology; A second-level device directly connected to the first-level device in the network topology is determined as the target device.
3. The method according to claim 2, characterized in that The network to be evaluated also includes a third-level device directly connected to the second-level device, and the method further includes: Part of the third-level devices whose number of directly connected second-level devices exceeds a set threshold among the third-level devices is determined as the target device.
4. The method according to claim 1, characterized in that: The W i Determined based on the following formula: W i =D i *max(N1*N2) Among them, D i It represents the number of other devices directly connected to the i-th target device, N1 represents the number of first-level devices directly or indirectly connected to the i-th target device, and N2 represents the number of devices in the link formed with the i-th target device as the first endpoint and any of the first-level devices as the second endpoint.
5. The method according to claim 1, characterized in that The Bj is determined based on the following formula: Among them, P j It represents the actual size of the jth data packet in the i-th target device, max3 represents the maximum value of the data packet processed by the i-th target device in the historical time period, and min3 represents the minimum value of the data packet processed by the i-th target device in the historical time period.
6. A network anomaly assessment device, characterized in that: The device comprises: a target device determining unit, configured to determine at least one target device in a network to be evaluated, wherein the network to be evaluated includes at least a first-level device and a second-level device directly connected to the first-level device, wherein the second-level device is configured to receive a data packet sent from the first-level device, and the at least one target device includes all of the second-level devices; An evaluation value determination unit, used to determine the evaluation value corresponding to each target device when processing a data packet, wherein the evaluation value is used to characterize the abnormality degree of the target device and the degree of influence of the target device on other devices when the abnormality occurs, and the abnormality degree and the influence degree are both positively correlated with the evaluation value; a total evaluation value determining unit, configured to determine a total evaluation value of the network to be evaluated based on the evaluation values of each target device; A network evaluation unit, configured to determine that an abnormality occurs in the network to be evaluated when the total evaluation value is greater than a set threshold; The total evaluation value is based on the following formula: A=∑ i W i *A i Among them, A represents the total evaluation value, W i Indicates the degree of impact on other devices when the i-th target device is abnormal, A i Indicates the abnormality degree of the i-th target device; The A i Determined based on the following formula: Among them, A i Indicates the abnormality degree of the i-th target device, B j It indicates the deviation between the size of the jth data packet processed by the i-th target device and the maximum and minimum values of the data packets processed by the same target device in the historical time period. N3 indicates the number of data packets processed by the i-th target device. It represents the average number of packets sent by each device to the i-th target device among other devices directly connected to the i-th target device. max11 represents the maximum number of packets from the same source IP in the i-th target device. It indicates the proportion of data packets from the same source IP in the i-th target device to the total number of data packets. max12 indicates the maximum number of data packets forwarded to the same destination IP in the i-th target device. It indicates the ratio of the data packets forwarded to the same destination IP in the i-th target device to the total number of data packets. max13 indicates the maximum number of data packets from the same source IP in the i-th target device and forwarded to the same destination IP. It indicates the ratio of the data packets from the same source IP in the i-th target device and forwarded to the same destination IP to the total number of data packets. max23 indicates the maximum number of data packets from the same source port in the i-th target device and forwarded to the same destination port. Indicates the proportion of data packets from the same source port in the i-th target device and forwarded to the same destination port to the total number of data packets, ΔT j represents the average time it takes for the i-th target device to process each data packet, ∑ j ΔT j Indicates the total duration of all data packets processed by the i-th target device.
7. An electronic device, characterized in that: The electronic device comprises at least one processor and a memory connected to the at least one processor, and the at least one processor is configured to implement the steps of the method according to any one of claims 1 to 5 when executing a computer program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
