Service traffic period classification method and device based on traffic statistics and electronic equipment

By reading and parsing the quintuples of traffic packets in the network management platform, and using the sliding window algorithm to identify the continuity level of business traffic, the problem of high integration difficulty and imprecise classification in traditional methods is solved, and refined business traffic cycle classification and unified traffic control are achieved.

CN120956673APending Publication Date: 2025-11-14HANG ZHOU LING XIN SHU KE XIN XI JI SHU YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511213020.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Traditional traffic statistics methods are difficult to integrate and maintain in network security management platforms, and they cannot meet the needs of granular business traffic cycle classification.

Method used

By reading traffic packets from the message queue, parsing the quintuples, and using the sliding window algorithm to identify the continuity level of business traffic, the quintuple is adopted as a standardized data exchange language to unify the classification standards of different vendor systems, and the classification granularity is improved by using the sliding window algorithm.

Benefits of technology

It reduces the integration and maintenance difficulty of the network management platform, enables fine-grained classification of business traffic cycles, and improves system compatibility and the accuracy of traffic control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956673A_ABST
    Figure CN120956673A_ABST
Patent Text Reader

Abstract

The invention provides a traffic statistics-based service traffic period classification method and apparatus, and an electronic device. The method comprises the steps of reading a traffic packet in a message queue; analyzing the traffic packet to obtain a quintuple of the traffic packet; matching the quintuple of the traffic packet with the quintuple of the target service according to a preset matching period to obtain a matching result; generating a daily flow statistical bitmap of the target service based on the matching result of each matching period; and based on the daily traffic statistical bitmap of the target service, utilizing a sliding window algorithm to identify the continuity level of the target service traffic in the target statistical period. The flow packet quintuple data is acquired and matched with the quintuple of the target service to count the service flow, so that the flow classification standards of different manufacturer systems are unified, and the integration, operation and maintenance difficulty of a network management platform is reduced; and a sliding window algorithm is adopted, so that the refinement degree of service flow period classification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically, to a method, apparatus, and electronic device for classifying business traffic cycles based on traffic statistics. Background Technology

[0002] In a network security management platform, the platform needs to periodically monitor and statistically analyze the traffic of various application services passing through the boundaries of internal and external networks.

[0003] Traditional traffic statistics typically rely on external data security exchange systems for traffic classification. However, differences in traffic classification standards across different vendors' systems necessitate independent custom development when integrating with multiple vendors' systems, increasing the complexity of platform integration and maintenance. Furthermore, traditional traffic statistics can only roughly determine the periodic continuity of business traffic, failing to meet the needs for refined classification. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a service traffic cycle classification method, device and electronic device based on traffic statistics, so as to improve the precision of service traffic cycle classification and reduce the difficulty of integration and operation and maintenance.

[0005] Firstly, a business traffic cycle classification method based on traffic statistics is provided, the method comprising: Read traffic packets from the message queue; Parse the traffic packet to obtain the five-tuple of the traffic packet; the five-tuple includes: source IP, destination IP, source port, destination port and protocol type; The five-tuple of the traffic package is matched with the five-tuple of the target service according to the preset matching period to obtain the matching result; A daily traffic statistics bitmap for the target service is generated based on the matching results of each matching period; each bit in the traffic statistics bitmap corresponds to a matching period, and each bit indicates whether there is traffic for the target service within that matching period. Based on the daily traffic statistics bitmap of the target business, the continuous level of the target business traffic within the target statistical period is identified using a sliding window algorithm.

[0006] Optionally, generating a daily traffic statistics bitmap for the target business based on the matching results of each matching period includes: The matching results of each matching period are discretized to obtain a binary result; the binary result includes 1 and 0, where 1 indicates that the target service traffic exists in each matching period and 0 indicates that the target service traffic does not exist. The number of statistical points is determined based on the duration of each matching cycle and the duration of 24 hours; A daily traffic statistics bitmap for the target business is generated based on the number of statistical points and the binary results of each statistical point.

[0007] Optionally, based on the daily traffic statistics bitmap of the target service, the sliding window algorithm is used to identify the continuity level of the target service traffic within the target statistical period, including: Based on the daily traffic statistics bitmap of the target business, the continuous level of each day within the target statistical period is identified using a sliding window algorithm; the continuous level is divided according to the length of continuous time, including at least 5 minutes continuous, 10 minutes continuous, 30 minutes continuous, 1 hour continuous, 3 hours continuous, 12 hours continuous and 24 hours continuous. Based on the continuity level of each day within the target statistical period, the continuity level corresponding to the maximum continuous duration is determined as the final continuity level within the target statistical period.

[0008] Optionally, based on the daily traffic statistics bitmap of the target service, the continuousness level of each day within the target statistical period is identified using a sliding window algorithm, including: For the daily traffic statistics bitmap of the target business, the continuity level of each day within the target statistical period is identified by sliding the bitmap from small to large according to the preset time window level.

[0009] Optionally, the process of step-by-step sliding recognition is as follows: Identify the continuity level of target business traffic starting from the smallest time window; Determine whether the continuity of the target business traffic identified in the current time window meets the preset continuity conditions; If satisfied, the sliding of time windows for subsequent levels will stop, and the length of the current level's time window will be determined as the continuity level of the target business traffic.

[0010] If the condition is not met, the continuity level of the target business traffic will continue to be identified from the next time window until the preset continuity condition is met.

[0011] Optionally, determining whether the continuity of the target service traffic identified in the current time window meets preset continuity conditions includes: Get the number of breakpoints in the target business traffic identified within the current time window; Determine if the number of discontinuities is less than the preset number of discontinuities; if it is less, the continuity condition is met.

[0012] Optionally, the method further includes: The distribution characteristics of target business traffic are determined based on traffic statistics bitmaps; Based on the distribution characteristics of the target business traffic, the level of the time window and the window length of each level are dynamically adjusted.

[0013] Secondly, a business traffic cycle classification device based on traffic statistics is provided, the device comprising: The read unit is used to read traffic packets from the message queue; The parsing unit is used to parse traffic packets and obtain the five-tuple of the traffic packets; the five-tuple includes: source IP, destination IP, source port, destination port and protocol type; The matching unit is used to match the five-tuple of the traffic packet with the five-tuple of the target service according to a preset matching period to obtain the matching result; The generation unit is used to generate a daily traffic statistics bitmap for the target service based on the matching results of each matching period; wherein, each bit in the traffic statistics bitmap corresponds to a matching period, and each bit indicates whether there is target service traffic within that matching period; The identification unit is used to identify the continuity level of the target service traffic within the target statistical period based on the daily traffic statistics bitmap of the target service and using a sliding window algorithm.

[0014] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements any of the steps of the method described in the first aspect.

[0015] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of any of the methods described in the first aspect.

[0016] This invention provides a method, apparatus, and electronic device for classifying service traffic cycles based on traffic statistics. The method involves reading traffic packets from a message queue; parsing the traffic packets to obtain their quintuples; matching the quintuples of the traffic packets with the quintuples of a target service according to a preset matching period; generating a daily traffic statistics bitmap for the target service based on the matching results of each matching period; and using a sliding window algorithm to identify the continuity level of the target service traffic within the target statistics period based on the daily traffic statistics bitmap. This invention achieves traffic statistics by acquiring traffic packet quintuple data and matching it with the quintuples of the target service, unifying the traffic classification standards of different vendors' systems, reducing the integration and maintenance difficulty of network management platforms, and improving the granularity of service traffic cycle classification by employing the sliding window algorithm.

[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart of a service traffic cycle classification method based on traffic statistics provided in an embodiment of the present invention is shown; Figure 2 This diagram illustrates the structure of a service traffic cycle classification device based on traffic statistics provided in an embodiment of the present invention. Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0021] This invention provides a service traffic period classification method based on traffic statistics, applied to a network management platform, such as... Figure 1 As shown, the method includes the following steps: Step S101: Read traffic packets from the message queue.

[0022] In this step, the message queue can be Kafka, an Apache Kafka message queue. Kafka is a message broker specifically designed for efficiently processing large volumes of real-time data streams. As a message broker, Kafka acts as an intermediary, allowing different applications or system components to exchange data by sending and receiving messages.

[0023] AS traffic monitoring probes are deployed at key nodes at the network boundary. These probes collect business traffic from these key nodes in real time via bypass mirroring and push the collected traffic packets to the corresponding Kafka message queue. A traffic consumption module is configured within the network management platform to consume the traffic packets from the Kafka message queue.

[0024] The traffic packet contains a key five-tuple (source IP, destination IP, source port, destination port, protocol type), timestamp, and traffic information.

[0025] Step S102: Parse the traffic packet to obtain the quintuple of the traffic packet.

[0026] The network management platform includes a 5-tuple registration and management module. This module parses the traffic packet to obtain its 5-tuple. It also manages the 5-tuple information database for all registered services.

[0027] Step S103: Match the five-tuple of the traffic package with the five-tuple of the target service according to the preset matching period to obtain the matching result.

[0028] In this step, a five-tuple matching and service identification module is set up in the network management platform to match the five-tuple of the traffic packet with the five-tuple of the target service.

[0029] The target business's quintuple is stored in the quintuple information database of registered businesses.

[0030] The matching results are divided into two types: successful matching and unsuccessful matching. If the data in the quintuple of the traffic package is the same as the quintuple of the target business, the matching is successful; otherwise, the matching fails.

[0031] Step S104: Generate a daily traffic statistics bitmap for the target business based on the matching results of each matching period.

[0032] In the traffic statistics bitmap, each bit corresponds to a matching period, and each bit indicates whether the target business traffic exists within that matching period.

[0033] In this step, if a match is successful, it means that the target service traffic exists within the matching period; if a match fails, it means that the target service traffic does not exist within the matching period.

[0034] In one feasible implementation, generating a daily traffic statistics bitmap for the target service based on the matching results of each matching period includes: Step S104A: Discretize the matching results of each matching cycle to obtain a binary result.

[0035] The binary result includes 1 and 0, where 1 indicates that the target service traffic exists within each matching period, and 0 indicates that the target service traffic does not exist.

[0036] Step S104B: Determine the number of statistical points based on the duration of each matching cycle and the duration of 24 hours.

[0037] Step S104C: Generate a daily traffic statistics bitmap for the target business based on the number of statistical points and the binary result of each statistical point.

[0038] In one example, if the matching period is 5 minutes, that is, matching once every 5 minutes, 24 hours a day, then the traffic statistics bitmap will have 288 traffic statistics results. Each bit represents whether there is traffic in a 5-minute period (1 for traffic, 0 for no traffic), which greatly improves the storage and calculation efficiency of business traffic.

[0039] This invention provides a standardized way to describe network connections by setting up a 5-tuple. Regardless of the vendor, any system involving network communication will inevitably involve these five basic elements. Therefore, using the 5-tuple as five key parameters to represent business traffic provides a common language for secure data exchange systems from different vendors. The platform can directly interface with various secure data exchange systems without custom development, greatly reducing integration and maintenance complexity.

[0040] By using 5-tuples, the network management platform can perform effective data exchange and traffic statistics classification without considering the internal workings of different vendors' data exchange systems. This approach enhances system compatibility and interoperability, reducing the workload of custom development required when the platform connects to multiple vendors' systems. Furthermore, 5-tuples accurately identify each session in the network, enabling more precise traffic control and monitoring.

[0041] Step S105: Based on the daily traffic statistics bitmap of the target service, use the sliding window algorithm to identify the continuity level of the target service traffic within the target statistical period.

[0042] In this step, the length of the window can be adjusted to meet the requirements of fine-grained traffic cycle classification, thereby improving the granularity of business traffic cycle classification.

[0043] As can be seen from the above embodiments, the present invention obtains traffic packet five-tuple data and matches it with the five-tuple of the target service to count service traffic, unifying the traffic classification standards of different vendor systems and reducing the integration and maintenance difficulty of the network management platform; and adopts a sliding window algorithm to improve the granularity of service traffic period classification.

[0044] Based on the above embodiments, and using the daily traffic statistics bitmap of the target service, the sliding window algorithm is used to identify the continuity level of the target service traffic within the target statistical period, including: Step S105A: Based on the daily traffic statistics bitmap of the target business, use the sliding window algorithm to identify the continuity level of each day within the target statistical period.

[0045] In this step, the continuity level is divided according to the length of continuous time, including at least 5 minutes continuous, 10 minutes continuous, 30 minutes continuous, 1 hour continuous, 3 hours continuous, 12 hours continuous and 24 hours continuous.

[0046] In one example, the traffic statistics bitmap has 288 bits, meaning it's analyzed every five minutes. Five consecutive minutes of analysis indicates that all 288 bits contain the target business traffic. Ten consecutive minutes of analysis indicates that at least one bit in every two bits contains the target business traffic.

[0047] Step S105B: Based on the continuity level of each day within the target statistical period, determine the continuity level corresponding to the maximum continuous duration as the final continuity level within the target statistical period.

[0048] In one example, the statistical period includes: 7 days, 15 days, 30 days, 6 months, and 12 months.

[0049] For example, if the target statistical period is 7 days, the continuity assessment results for each day within those 7 days are combined with a more lenient approach. The specific rule is: the most lenient window within the 7 days is used (i.e., the most lenient continuity level within the 7 days is used as the final classification label for the target business within that target statistical period). For example, if there are 5 days with 5 minutes of continuity, 1 day with 10 minutes of continuity, and 1 day with 30 minutes of continuity within 7 days, then the final continuity level for the target business over the 7-day period is 30 minutes of continuity.

[0050] This invention employs a lenient merging strategy in multi-day statistics, using the most lenient continuity level within the period as the final classification label. This ensures the stability and business applicability of the business traffic period classification results, facilitating subsequent applications in various scenarios such as business profiling, anomaly detection, and resource allocation.

[0051] Based on the above embodiments, and using the daily traffic statistics bitmap of the target service, the sliding window algorithm is used to identify the continuity level of each day within the target statistical period, including: Step S105A1: For the daily traffic statistics bitmap of the target business, slide the preset time window level from small to large to identify the continuity level of each day within the target statistical period.

[0052] In this embodiment of the invention, the preset time window is multiple windows such as 5 minutes, 10 minutes, 30 minutes, 1 hour, 3 hours, 12 hours, and 24 hours.

[0053] There is a progressive relationship between strict and lenient windows. If a certain business meets the continuity condition of a stricter window (such as a 5-minute window), then it must also meet the continuity conditions of all more lenient windows (such as 10 minutes, 30 minutes, 1 hour, etc.).

[0054] Therefore, if a service meets the 5-minute continuity requirement, it will be classified under the continuity categories of all windows, including 5 minutes, 10 minutes, 30 minutes, 1 hour, 3 hours, 12 hours, and 24 hours. If it only meets the 30-minute window continuity requirement, it will be classified under the continuity categories of 30 minutes, 1 hour, 3 hours, 12 hours, and 24 hours.

[0055] In this step, a byte array is used as a bitmap to store daily business traffic statistics points, and a sliding window algorithm is combined to determine the continuity of traffic across multiple windows and periods. This significantly improves the storage and computation efficiency of large-scale traffic data and supports fine-grained, automated traffic period classification.

[0056] In one feasible implementation, the process of step-by-step sliding recognition is as follows: Step A: Identify the continuity level of the target business traffic starting from the smallest time window.

[0057] Step B: Determine whether the continuity of the target business traffic identified in the current time window meets the preset continuity conditions.

[0058] Step C: If satisfied, stop sliding the time window of subsequent levels and determine the length of the current level's time window as the continuity level of the target business traffic.

[0059] This invention employs short-circuit optimization during the identification process: if the target service already meets a relatively strict window (e.g., 5 minutes) continuity condition, it is automatically determined to meet all more lenient windows (e.g., 10 minutes and above), eliminating the need for repeated traversal and calculation. This mechanism significantly improves processing efficiency under large data volumes and is suitable for high-concurrency and large-scale business scenarios.

[0060] Step D: If not satisfied, continue to identify the continuity level of the target business traffic from the next time window until the preset continuity conditions are met.

[0061] If a power outage or other event causes a network outage, resulting in a break in the target service's daily traffic statistics bitmap, such as a 30-minute power outage causing six consecutive bits to be devoid of target service traffic, then the identified service traffic continuity level will be 30 minutes continuous. This result makes the determined continuity level unreasonable.

[0062] Therefore, based on the above embodiments, determining whether the continuity of the target service traffic identified in the current time window meets the preset continuity conditions includes: Step B1: Obtain the number of breakpoints in the target business traffic identified in the current time window.

[0063] Step B2: Determine whether the number of discontinuities is less than the preset number of discontinuities. If it is less, the continuity condition is met.

[0064] In a specific example, if the preset number of breakpoints is 6 and the current time window is 5 minutes, if the number of breakpoints identified in a day is 4, which is less than 6, the target service's cycle is still determined to be 5 minutes continuous. This method allows for a certain degree of error tolerance in traffic statistics classification, making the cycle classification more reasonable and accurate.

[0065] Based on the above embodiments, the method further includes: Step E: Determine the distribution characteristics of the target service traffic based on the traffic statistics bitmap.

[0066] Step F: Based on the distribution characteristics of the target business traffic, dynamically adjust the level of the time window and the window length of each level.

[0067] The preset time window level and size are fixed and cannot be adjusted, leading to some redundant calculations. For example, if traffic distribution characteristics show that the target service traffic has five consecutive statistical points with a value of "0", "0" indicates that there is no target service traffic for 25 consecutive minutes, meaning there is at least 25 minutes of discontinuity. If a 5-minute window is continued for identification, the result will inevitably be discontinuous. Therefore, automatically adjusting the length of the minimum level window to 25 or 30 minutes can reduce some redundant calculations and improve identification efficiency.

[0068] This invention introduces an adaptive dynamic grading system with a time window, dynamically adjusting the judgment criteria based on business traffic characteristics and automatically skipping redundant calculations in multi-level judgments. This enhances the system's intelligence and real-time processing capabilities, adapts to different business traffic patterns, and ensures efficient and accurate classification results.

[0069] Based on the same inventive concept, embodiments of the present invention provide a service traffic cycle classification device based on traffic statistics, such as... Figure 2As shown, the device includes: The reading unit 201 is used to read traffic packets from the message queue.

[0070] The parsing unit 202 is used to parse traffic packets and obtain the five-tuple of the traffic packets; the five-tuple includes: source IP, destination IP, source port, destination port and protocol type.

[0071] The matching unit 203 is used to match the five-tuple of the traffic package with the five-tuple of the target service according to a preset matching period to obtain the matching result.

[0072] The generation unit 204 is used to generate a daily traffic statistics bitmap for the target service based on the matching results of each matching period. Each bit in the traffic statistics bitmap corresponds to a matching period, and each bit indicates whether target service traffic exists within that matching period. The identification unit 205 is used to identify the continuity level of the target service traffic within the target statistical period based on the daily traffic statistics bitmap of the target service and using a sliding window algorithm.

[0073] Based on the same technical concept, embodiments of the present invention also provide an electronic device, such as... Figure 3 As shown, it includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.

[0074] Memory 303 is used to store computer programs; When the processor 301 executes the program stored in the memory 303, it implements the steps of the service traffic period classification method based on traffic statistics.

[0075] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0076] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0077] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0078] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0079] The computer program product for the business traffic period classification method based on traffic statistics provided in this embodiment of the invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0080] The device for classifying service traffic cycles based on traffic statistics provided in this embodiment of the invention can be specific hardware on a device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this embodiment of the invention are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0081] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0082] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0083] In addition, the functional units in the embodiments provided by the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0084] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0085] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0086] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. All should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A business traffic cycle classification method based on traffic statistics, characterized in that, The method includes: Read traffic packets from the message queue; Parse the traffic packet to obtain the five-tuple of the traffic packet; the five-tuple includes: source IP, destination IP, source port, destination port and protocol type; The five-tuple of the traffic package is matched with the five-tuple of the target service according to a preset matching period to obtain the matching result; A daily traffic statistics bitmap for the target service is generated based on the matching results of each matching period; wherein, each bit in the traffic statistics bitmap corresponds to a matching period, and each bit indicates whether there is target service traffic within that matching period. Based on the daily traffic statistics bitmap of the target service, the continuity level of the target service traffic within the target statistical period is identified using a sliding window algorithm.

2. The method according to claim 1, characterized in that, The generation of the daily traffic statistics bitmap for the target service based on the matching results of each matching period includes: The matching results of each matching period are discretized to obtain a binary result; wherein, the binary result includes 1 and 0, where 1 indicates that the target service traffic exists in each matching period, and 0 indicates that the target service traffic does not exist; The number of statistical points is determined based on the duration of each matching cycle and the duration of 24 hours; A daily traffic statistics bitmap for the target service is generated based on the number of statistical points and the binary result of each statistical point.

3. The method according to claim 1, characterized in that, The step of identifying the continuity level of the target service traffic within the target statistical period using a sliding window algorithm based on the daily traffic statistics bitmap of the target service includes: Based on the daily traffic statistics bitmap of the target service, the continuous level of each day within the target statistical period is identified using a sliding window algorithm; the continuous level is divided according to the length of continuous time, including at least 5 minutes continuous, 10 minutes continuous, 30 minutes continuous, 1 hour continuous, 3 hours continuous, 12 hours continuous and 24 hours continuous. Based on the continuity level of each day within the target statistical period, the continuity level corresponding to the maximum continuous duration is determined as the final continuity level within the target statistical period.

4. The method according to claim 3, characterized in that, The step of identifying the continuity level of each day within the target statistical period using a sliding window algorithm based on the daily traffic statistics bitmap of the target service includes: For the daily traffic statistics bitmap of the target service, the continuity level of each day within the target statistical period is identified by sliding the data level from small to large according to the preset time window level.

5. The method according to claim 4, characterized in that, The process of step-by-step sliding recognition is as follows: Identify the continuity level of the target service traffic starting from the smallest time window; Determine whether the continuity of the target business traffic identified in the current time window meets the preset continuity conditions; If satisfied, stop sliding the time window of subsequent levels and determine the length of the current level's time window as the continuity level of the target business traffic; If the condition is not met, the continuity level of the target business traffic will continue to be identified from the next time window until the preset continuity condition is met.

6. The method according to claim 5, characterized in that, The step of determining whether the continuity of the target service traffic identified in the current time window meets the preset continuity conditions includes: Get the number of breakpoints in the target business traffic identified within the current time window; Determine whether the number of discontinuities is less than the preset number of discontinuities; if it is less, the continuity condition is met.

7. The method according to claim 4, characterized in that, The method further includes: The distribution characteristics of target business traffic are determined based on traffic statistics bitmaps; Based on the distribution characteristics of the target service traffic, the level of the time window and the window length of each level are dynamically adjusted.

8. A business traffic cycle classification device based on traffic statistics, characterized in that, The device includes: The read unit is used to read traffic packets from the message queue; The parsing unit is used to parse the traffic packet to obtain the five-tuple of the traffic packet; the five-tuple includes: source IP, destination IP, source port, destination port and protocol type; The matching unit is used to match the five-tuple of the traffic packet with the five-tuple of the target service according to a preset matching period to obtain the matching result; The generation unit is used to generate a daily traffic statistics bitmap for the target service based on the matching results of each matching period; wherein, each bit in the traffic statistics bitmap corresponds to a matching period, and each bit indicates whether there is target service traffic within that matching period; The identification unit is used to identify the continuity level of the target service traffic within the target statistical period based on the daily traffic statistics bitmap of the target service and using a sliding window algorithm.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the steps of the method described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-7.