Traffic anomaly detection method and device, electronic equipment and storage medium
By determining the level based on the historical traffic value of the traffic demand period and performing abnormal detection, the false alarm DDOS attack problem caused by the server processing a large number of legal traffic in the prior art is solved, and the accuracy of traffic detection and network transmission efficiency are improved.
Patent Information
- Application Number
- CN202310612214.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2024-11-26
AI Technical Summary
The existing traffic abnormality detection methods calculate high and low thresholds based on the number of visits to the destination address, which can easily lead to false alarms or missed alarms, affecting detection accuracy and network transmission efficiency.
By determining the traffic demand level based on the historical traffic values of multiple traffic demand periods, and traffic abnormality detection is performed according to the level range threshold to reduce false alarms and missed alarms.
It improves the accuracy of traffic detection and network transmission efficiency, reduces the occurrence of error warning information, and enhances the work efficiency of the computer.
Smart Images

Figure CN119030727A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a flow anomaly detection method, device, electronic device, and storage medium. Background Art
[0002] With the development of the network, the number and types of network attacks are also increasing. Therefore, in order to protect network security, it is necessary to detect and prevent network attacks. Traffic anomaly detection is a method of detecting network attacks. It can effectively detect abnormal traffic in the network and maintain network security.
[0003] However, the current method of traffic anomaly detection is a detection method that calculates high and low thresholds based on the number of visits to the destination address. The threshold calculated in this way may affect the detection results. If the calculated threshold is too high, it may cause missed reports; if the calculated threshold is too low, it may cause false positives. For example, if the target server is processing a large amount of legitimate traffic, it may cause a false positive of a Distributed Denial of Service (DDOS) attack, and a warning display may appear, thereby affecting the accuracy of traffic detection and causing administrators to mistakenly block some normal traffic, so that these traffic cannot be transmitted or processed normally, reducing network transmission efficiency. Summary of the invention
[0004] The embodiments of the present application provide a flow anomaly detection method, device, electronic device and storage medium, which can solve the problem that the target server may have false alarms in calculations due to excessive flow, thereby affecting the accuracy of flow detection and reducing network transmission efficiency.
[0005] In order to solve the above technical problems, this application is implemented as follows:
[0006] In the first aspect, an embodiment of the present application provides a method for detecting a flow anomaly, the method comprising: determining a flow demand level corresponding to each flow demand period based on historical flow values of multiple flow demand periods; and performing flow anomaly detection on each flow demand period according to a range threshold corresponding to each flow demand level.
[0007] In an implementation of the first aspect, the traffic demand level corresponding to each traffic demand period is determined based on the historical traffic values of multiple traffic demand periods, including: determining the traffic demand level corresponding to each traffic demand period based on the relationship between the historical traffic value of each traffic demand period and the historical traffic demand average value.
[0008] In an implementation of the first aspect, based on the size relationship between the historical flow value of each flow demand period and the historical flow demand average value, the flow demand level corresponding to each flow demand period is determined, including: when the first historical flow value is greater than the historical flow demand average value and greater than a first threshold, the flow demand level of the flow demand period corresponding to the first historical flow value is determined to be the first level, wherein the first threshold is greater than the historical flow demand average value; when the absolute value of the difference between the second historical flow value and the historical flow demand average value is less than the second threshold, the flow demand level of the flow demand period corresponding to the second historical flow value is determined to be the second level; when the third historical flow value is less than the historical flow demand average value and greater than the third threshold, the flow demand level of the flow demand period corresponding to the third historical flow value is determined to be the third level, wherein the third threshold is less than the historical flow demand average value; when the fourth historical flow value is less than the historical flow demand average value and less than the third threshold, the flow demand level of the flow demand period corresponding to the fourth historical flow value is determined to be the fourth level.
[0009] In an implementation method of the first aspect, before performing traffic anomaly detection on each traffic demand time period according to the range threshold corresponding to each traffic demand level, it also includes: determining the range threshold corresponding to each traffic demand level, wherein the range threshold corresponding to each traffic demand level includes a maximum threshold and a minimum threshold.
[0010] In an implementation method of the first aspect, traffic anomaly detection is performed on each traffic demand time period based on the range thresholds corresponding to each traffic demand level, including: obtaining a target traffic value and a target traffic demand level corresponding to the target traffic demand time period, the target traffic demand time period being any one of multiple traffic demand time periods; when the target traffic value is greater than the maximum threshold corresponding to the target traffic demand level, determining that the traffic is abnormal in the target traffic demand time period.
[0011] In an implementation of the first aspect, the traffic demand level corresponding to each traffic demand period is determined based on the historical traffic values of multiple traffic demand periods, including: determining the traffic demand level corresponding to each traffic demand period based on the historical traffic values of each traffic demand period and the priority of each traffic demand period.
[0012] In an implementation manner of the first aspect, the minimum threshold of the first level is greater than the maximum threshold of the second level, the minimum threshold of the second level is greater than the maximum threshold of the third level, and the minimum threshold of the third level is greater than the maximum threshold of the fourth level.
[0013] In the second aspect, an embodiment of the present application provides a flow anomaly detection device, which includes: a determination module for determining the flow demand level corresponding to each flow demand period based on the historical flow values of multiple flow demand periods; and a detection module for performing flow anomaly detection on each flow demand period according to the range threshold corresponding to each flow demand level.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the flow anomaly detection method as in the first aspect.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a program or instruction and, when executed by a processor, implements the traffic anomaly detection method of the first aspect.
[0016] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, and the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the traffic anomaly detection method as in the first aspect.
[0017] In an embodiment of the present application, a method for detecting traffic anomalies is provided, the method comprising: determining the traffic demand level corresponding to each traffic demand period based on the historical traffic values of multiple traffic demand periods; and performing traffic anomaly detection on each traffic demand period according to the range threshold corresponding to each traffic demand level. The method can solve the problem of false positive DDOS attacks caused by the server processing a large amount of legitimate traffic, reduce the occurrence of false warning information, and thus improve the accuracy of traffic detection, network transmission efficiency, and computer work efficiency.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] Figure 1 A flow chart of a method for detecting abnormal flow rates provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of the relationship between various values and levels in a flow anomaly detection method provided in an embodiment of the present application;
[0022] Figure 3A flow chart of another method for detecting abnormal flow rate provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of a flow anomaly detection device provided in an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0026] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0027] 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 the present application. The singular forms "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.
[0028] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0029] In the description of this specification, it is necessary to understand that the words such as "substantially", "approximately", "approximately", "about", "roughly", "substantially" and the like described in the claims and embodiments of the present application refer to what can be generally recognized within a reasonable process operation range or tolerance range, rather than an exact value.
[0030] In conjunction with the accompanying drawings, a flow anomaly detection method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0031] Figure 1 A flow chart of a method for detecting anomalies in flow provided in an embodiment of the present application.
[0032] like Figure 1As shown, the method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device, wherein the terminal device may be, for example, a vehicle-mounted terminal or a mobile phone terminal. In other words, the method can be executed by software or hardware installed in the electronic device, and the method includes the following steps:
[0033] Step 110: Determine the flow demand level corresponding to each flow demand period based on the historical flow values of multiple flow demand periods.
[0034] Among them, multiple traffic demand periods refer to dividing a time period into multiple traffic demand periods according to the usage and utilization of network traffic within a time period, and the historical traffic values of each traffic demand period may be the same or different. Alternatively, a time period is divided into several hours according to a preset time length, and each hour is a traffic demand period. Optionally, the method for determining multiple traffic demand periods may also include: performing statistics and analysis based on factors such as user access volume and usage time and different business types, so as to determine multiple traffic demand periods.
[0035] Optionally, a method for acquiring historical flow values in multiple flow demand periods may include at least one of the following:
[0036] 1. Visit open data platforms such as Data.gov, Kaggle, UCI, etc., select and download the required open datasets.
[0037] 2. Obtain historical traffic data sets for multiple traffic demand periods through third-party data providers and obtain data through APIs or data interfaces.
[0038] 3. Obtain historical traffic data sets for multiple traffic demand periods through data crawlers, such as Scrapy, to obtain the required data by crawling website data.
[0039] In one implementation of this embodiment, the historical traffic values of multiple traffic demand periods are obtained by accessing an open data platform. Specifically, the access log of the server is monitored to understand the access situation of the server, including the number of visits, access time, access source and other information, so as to obtain the historical traffic values of multiple traffic demand periods.
[0040] Based on the historical traffic values of the multiple traffic demand time periods obtained above, the traffic demand level corresponding to each traffic demand time period is analyzed and determined.
[0041] Specifically, in the actual life and work field, by monitoring the access log of the server, we can understand the access situation of the work attendance punching in the server, including the number of visits, access time, access source and other information, so as to obtain the historical traffic values of the work attendance punching in multiple traffic demand periods, so as to determine the traffic demand level corresponding to the work attendance punching in multiple traffic demand periods based on the historical traffic value analysis of multiple work attendance punching ins. For example, during the day, the traffic demand for clocking in and out at work during the 5:00-7:00 am time period is relatively small, and the corresponding traffic demand level is relatively low; the traffic demand for clocking in and out at work during the 8:00-9:00 am time period is relatively large, and the corresponding traffic demand level is relatively high; the traffic demand for clocking in and out at work during the 9:00-12:00 am and 1:00-5:00 pm time period is relatively small, and the corresponding traffic demand level is relatively low; the traffic demand for clocking in and out at work during the 12:00-1:00 noon time period can be considered almost zero, and the corresponding traffic demand level can be considered as having no level; similarly, the traffic demand for clocking in and out at work during the 5:00-7:00 pm time period is relatively large, and the corresponding traffic demand level is relatively high; the traffic demand for clocking in and out at work during the 7:00-9:00 pm time period is relatively small, and the corresponding traffic demand level is relatively low; the traffic demand for clocking in and out at work during the 9:00-12:00 pm and 0:00-5:00 am time period can be considered almost zero, and the corresponding traffic demand level can be considered as having no level.
[0042] It is understandable that in actual life and work, the flow demand level corresponding to each flow demand period can also be determined according to the historical flow value of each flow demand period in the specific application scenario.
[0043] Step 120: Perform traffic anomaly detection for each traffic demand period according to the range threshold corresponding to each traffic demand level.
[0044] The historical traffic values of multiple traffic demand periods can be obtained from step 110, and the traffic demand level corresponding to each traffic demand period can be analyzed and determined based on the historical traffic values of multiple traffic demand periods obtained. Step 120 is the next step based on step 110. The various traffic demand levels determined in step 110 are analyzed and calculated to obtain the range thresholds corresponding to each traffic demand level, and based on the obtained range thresholds corresponding to each traffic demand level, the traffic anomaly detection of each traffic demand period is implemented. It can also be said that when the traffic value of the traffic demand period appears outside the range threshold, that is, when a DDOS attack occurs in the system, the system can accurately detect this abnormality of the traffic.
[0045] A method for detecting anomalies in traffic provided by an embodiment of the present invention monitors the access log of a server to understand the access situation of the server, including information such as the number of visits, access time, and access source, so as to determine the historical traffic values of multiple traffic demand periods; then, based on the historical traffic values of multiple traffic demand periods, the traffic demand level corresponding to each traffic demand period is determined; then, the corresponding range threshold is calculated according to each of the traffic demand levels, so as to realize traffic anomaly detection for each of the traffic demand periods. The above-mentioned method for detecting anomalies in traffic can solve the problem of false alarms of DDOS attacks caused by the server processing a large amount of legitimate traffic, reduce the occurrence of erroneous warning information, and thus improve the accuracy of traffic detection, network transmission efficiency, and computer work efficiency.
[0046] In one implementation of this embodiment, the traffic demand level corresponding to each traffic demand time period is determined based on the historical traffic values of multiple traffic demand time periods, including: determining the traffic demand level corresponding to each traffic demand time period based on the relationship between the historical traffic value of each traffic demand time period and the historical traffic demand average value.
[0047] In this implementation, it is proposed to determine the flow demand level corresponding to each flow demand period based on the size relationship between the historical flow value of each flow demand period and the historical flow demand average value; wherein the historical flow demand average value is obtained by analyzing the access log data of the monitoring server and calculating the unit time data. Through the above implementation, the flow demand level corresponding to each required flow demand period can be completed, which is helpful for flow anomaly detection, reducing the occurrence of erroneous warning information, and improving the work efficiency of the computer.
[0048] Figure 2 A schematic diagram of the relationship between various values and levels in a flow anomaly detection method provided in an embodiment of the present application.
[0049] like Figure 2As shown, in one embodiment of the present application, based on the size relationship between the historical flow value of each of the flow demand time periods and the historical flow demand average value 230, the flow demand level corresponding to each of the flow demand time periods is determined, including: when the first historical flow value 210 is greater than the historical flow demand average value 230 and greater than a first threshold value 220, then the flow demand level of the flow demand time period corresponding to the first historical flow value 210 is determined to be the first level 211, wherein the first threshold value 220 is greater than the historical flow demand average value 230; when the absolute value of the difference between the second historical flow value 240 and the historical flow demand average value 230 is less than the second threshold value, then Determine that the flow demand level of the flow demand period corresponding to the second historical flow value 240 is the second level 212; when the third historical flow value 250 is less than the historical flow demand average value 230 and greater than the third threshold value 260, determine that the flow demand level of the flow demand period corresponding to the third historical flow value 250 is the third level 213, wherein the third threshold value 260 is less than the historical flow demand average value 230; when the fourth historical flow value 270 is less than the historical flow demand average value 230 and less than the third threshold value 260, determine that the flow demand level of the flow demand period corresponding to the fourth historical flow value 270 is the fourth level 214.
[0050] In one implementation of this embodiment, Figure 2As shown, the first level 211, the second level 212, the third level 213 and the fourth level 214 are determined by the size relationship between the historical flow value of each flow demand period and the historical flow demand average value 230. Specifically, the first historical flow value 210 is determined by comparing the first threshold 220 and the historical flow demand average value 230, and the value greater than the historical flow demand average value 230 and greater than the first threshold 220 is called the first historical flow value 210. According to the first historical flow value 210, the first level 211 of the flow demand level of the flow demand period can be determined; that is, the flow demand level of the flow demand period corresponding to the first historical flow value 210 is the first level 211. Similarly, the value less than the second threshold than the historical flow demand average value 230 is called the second historical flow value 240, and the second level 212 of the flow demand level of the flow demand period can be determined according to the second historical flow value 240; that is, the flow demand level of the flow demand period corresponding to the second historical flow value 240 is the second level 212. A value that is less than the historical traffic demand average value 230 and greater than the third threshold value 260 is called the third historical traffic value 250. According to the third historical traffic value 250, the third level 213 of the traffic demand level in the traffic demand period can be determined; that is, the traffic demand level of the third historical traffic value 250 corresponding to the traffic demand period is the third level 213. A value that is less than the historical traffic demand average value 240 and less than the third threshold value 260 is called the fourth historical traffic value 270. According to the fourth historical traffic value 270, the fourth level 214 of the traffic demand level in the traffic demand period can be determined; that is, the traffic demand level of the fourth historical traffic value 270 corresponding to the traffic demand period is the fourth level 214. It is worth noting that Figure 2 This is an implementation method of the embodiment of the present application. When determining the second historical flow value 240, a value that is greater than the second threshold value than the historical flow demand average value 230 may also be set as the second historical flow value 240.
[0051] In this implementation, the traffic demand level corresponding to each traffic demand period is determined based on the relationship between the historical traffic value of each traffic demand period and the historical traffic demand average value 230, which reduces the high requirements for data and computing resources and solves the problem of data limitations in practical applications.
[0052] In an embodiment of the present application, before performing flow anomaly detection on each of the flow demand time periods according to the range thresholds corresponding to each of the flow demand levels, it also includes: determining the range thresholds corresponding to each of the flow demand levels, wherein the range thresholds corresponding to each of the flow demand levels include a maximum threshold and a minimum threshold.
[0053] Figure 3 A flow chart of another method for detecting anomalies in flow provided in an embodiment of the present application.
[0054] like Figure 3 As shown, in the embodiment of the present application, according to the range threshold corresponding to each of the traffic demand levels, flow anomaly detection is performed on each of the traffic demand time periods, including the following steps:
[0055] Step 310: Obtain the target flow value and target flow demand level corresponding to the target flow demand period.
[0056] The target flow demand period is any one of the multiple flow demand periods.
[0057] Specifically, the traffic demand time periods are divided into units of one day. When analyzing the work attendance punch-in data, the traffic demand time periods can be divided into 5:00-7:00 in the morning, 8:00-9:00 in the morning, 9:00-12:00 in the morning, 12:00-1:00 in the afternoon, 1:00-5:00 in the afternoon, 5:00-7:00 in the afternoon, 7:00-9:00 in the evening, 9:00-12:00 in the evening and 0:00-5:00 in the early morning. The target traffic demand time period can be any one of the above-mentioned multiple traffic demand time periods.
[0058] Step 320: When the target flow value is greater than the maximum threshold corresponding to the target flow demand level, determine that the flow in the target flow demand period is abnormal.
[0059] Through the above implementation method, the traffic demand level corresponding to each required traffic demand period can be completed, which is helpful for traffic anomaly detection, reduces the occurrence of erroneous warning information, and improves the work efficiency of the computer.
[0060] In another implementation of this embodiment, the traffic demand level corresponding to each traffic demand time period is determined based on the historical traffic values of multiple traffic demand time periods, including: determining the traffic demand level corresponding to each traffic demand time period based on the historical traffic values of each traffic demand time period and the priority of each traffic demand time period.
[0061] Specifically, when the traffic in the network suddenly increases in a certain time period, for example, a school requires students to select courses in a certain time period, the number of clicks and views of the school's course selection system in this time period will be higher than that of the same time period before. Therefore, the priority of this time period needs to be increased, where the higher the priority, the higher the corresponding traffic demand level, and the higher the traffic demand level, the higher the corresponding maximum threshold.
[0062] In the above implementation, by reasonably arranging the priority and traffic demand level of each time period, network resources can be flexibly allocated during network peak and off-peak periods to avoid the problem of false positives of traffic detection anomalies. This not only improves network efficiency and performance, but also reduces delays and transmission errors caused by network congestion. At the same time, it also solves the problem that traditional traffic detection methods are limited in practical applications.
[0063] In the embodiment of the present application, the minimum threshold of the first level is greater than the maximum threshold of the second level, the minimum threshold of the second level is greater than the maximum threshold of the third level, and the minimum threshold of the third level is greater than the maximum threshold of the fourth level.
[0064] Through the above implementation, the system specifies the range thresholds corresponding to each of the traffic demand levels; in other words, the system specifies the maximum and minimum thresholds corresponding to each of the traffic demand levels. By setting the maximum and minimum thresholds corresponding to each of the traffic demand levels, network traffic can be effectively managed, network security can be improved, and network resources can be protected from abuse or attacks.
[0065] Figure 4 A schematic diagram of the structure of a flow anomaly detection device provided in an embodiment of the present application.
[0066] like Figure 4 As shown, the device 400 may include: a determination module 410 and a detection module 420.
[0067] In the implementation column of the present application, the determination module 410 is used to determine the traffic demand level corresponding to each traffic demand period based on the historical traffic values of multiple traffic demand periods; the detection module 420 is used to perform traffic anomaly detection on each traffic demand period according to the range threshold corresponding to each traffic demand level.
[0068] In one implementation, the determination module 410 is used to determine the flow demand level corresponding to each of the flow demand time periods based on the size relationship between the historical flow value of each of the flow demand time periods and the historical flow demand average value.
[0069] In one implementation, the determination module 410 is used to determine that the traffic demand level of the traffic demand period corresponding to the first historical traffic value is the first level when the first historical traffic value is greater than the historical traffic demand average value and greater than a first threshold value, wherein the first threshold value is greater than the historical traffic demand average value; when the absolute value of the difference between the second historical traffic value and the historical traffic demand average value is less than a second threshold value, the traffic demand level of the traffic demand period corresponding to the second historical traffic value is determined to be the second level; when the third historical traffic value is less than the historical traffic demand average value and greater than a third threshold value, the traffic demand level of the traffic demand period corresponding to the third historical traffic value is determined to be the third level, wherein the third threshold value is less than the historical traffic demand average value; when the fourth historical traffic value is less than the historical traffic demand average value and less than the third threshold value, the traffic demand level of the traffic demand period corresponding to the fourth historical traffic value is determined to be the fourth level.
[0070] In one implementation, the determination module 410 is further configured to determine a range threshold corresponding to each of the flow demand levels, wherein the range threshold corresponding to each of the flow demand levels includes a maximum threshold and a minimum threshold.
[0071] In one implementation, the detection module 420 is used to obtain a target flow value and a target flow demand level corresponding to a target flow demand period, where the target flow demand period is any one of a plurality of flow demand periods; when the target flow value is greater than a maximum threshold value corresponding to the target flow demand level, the flow in the target flow demand period is determined to be abnormal.
[0072] In one implementation, the determination module 410 is used to determine the flow demand level corresponding to each of the flow demand time periods based on the historical flow value of each of the flow demand time periods and the priority of each of the flow demand time periods.
[0073] In one implementation, the minimum threshold of the first level is greater than the maximum threshold of the second level, the minimum threshold of the second level is greater than the maximum threshold of the third level, and the minimum threshold of the third level is greater than the maximum threshold of the fourth level.
[0074] The flow anomaly detection device provided in the embodiment of the present application can realize Figure 1 To avoid repetition, the various processes implemented in the illustrated method embodiment will not be described again here.
[0075] A flow anomaly detection device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in an electronic device. The embodiment of the present application is not specifically limited.
[0076] A flow anomaly detection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0077] Optional, Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5 As shown, the embodiment of the present application also provides an electronic device 500, including a processor 510, a memory 520, and a program or instruction stored in the memory 520 and executable on the processor 510; when the program or instruction is executed by the processor 510, each process of the above-mentioned flow anomaly detection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0078] An embodiment of the present application also provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned flow anomaly detection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0079] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0080] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, and the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned flow anomaly detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0081] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0082] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0084] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0085] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for detecting traffic anomalies, It is characterized in that The method comprises: Determine the flow demand level corresponding to each flow demand period based on the historical flow values of the plurality of flow demand periods; According to the range threshold corresponding to each of the traffic demand levels, traffic anomaly detection is performed on each of the traffic demand time periods.
2. The method according to claim 1, It is characterized in that The determining the flow demand level corresponding to each flow demand period based on the historical flow values of the plurality of flow demand periods comprises: Based on the size relationship between the historical flow value of each of the flow demand time periods and the historical flow demand average value, the flow demand level corresponding to each of the flow demand time periods is determined.
3. The method according to claim 2, It is characterized in that The determining of the flow demand level corresponding to each flow demand period based on the size relationship between the historical flow value of each flow demand period and the historical flow demand average value includes: When the first historical flow value is greater than the historical flow demand average value and greater than a first threshold, the flow demand level of the flow demand period corresponding to the first historical flow value is determined to be the first level, wherein the first threshold is greater than the historical flow demand average value; When the absolute value of the difference between the second historical flow value and the historical flow demand average value is less than a second threshold, determining that the flow demand level of the flow demand period corresponding to the second historical flow value is the second level; When the third historical flow value is less than the historical flow demand average value and greater than a third threshold, the flow demand level of the flow demand period corresponding to the third historical flow value is determined to be the third level, wherein the third threshold is less than the historical flow demand average value; When the fourth historical flow value is less than the historical flow demand average value and less than the third threshold, it is determined that the flow demand level of the flow demand period corresponding to the fourth historical flow value is the fourth level.
4. The method according to claim 3, It is characterized in that Before performing flow anomaly detection on each flow demand period according to the range threshold corresponding to each flow demand level, the method further includes: Determine a range threshold corresponding to each of the flow demand levels, wherein the range threshold corresponding to each of the flow demand levels includes a maximum threshold and a minimum threshold.
5. The method according to claim 4, It is characterized in that The performing flow anomaly detection on each flow demand period according to the range threshold corresponding to each flow demand level includes: Obtaining a target flow value and a target flow demand level corresponding to a target flow demand period, wherein the target flow demand period is any one of the plurality of flow demand periods; When the target flow value is greater than a maximum threshold corresponding to the target flow demand level, it is determined that the flow in the target flow demand period is abnormal.
6. The method according to claim 1, It is characterized in that The determining the flow demand level corresponding to each flow demand period based on the historical flow values of the plurality of flow demand periods comprises: Based on the historical flow value of each of the flow demand time periods and the priority of each of the flow demand time periods, the flow demand level corresponding to each of the flow demand time periods is determined.
7. The method according to claim 4, It is characterized in that The minimum threshold of the first level is greater than the maximum threshold of the second level, the minimum threshold of the second level is greater than the maximum threshold of the third level, and the minimum threshold of the third level is greater than the maximum threshold of the fourth level.
8. A flow anomaly detection device, It is characterized in that The device comprises: A determination module, configured to determine a flow demand level corresponding to each flow demand period based on historical flow values of multiple flow demand periods; The detection module is used to perform flow anomaly detection on each of the flow demand time periods according to the range threshold corresponding to each of the flow demand levels.
9. An electronic device, It is characterized in that The electronic device includes a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the flow anomaly detection method as described in any one of claims 1 to 7 is implemented.
10. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the flow anomaly detection method as described in any one of claims 1 to 7 is implemented.
