A network traffic distribution system based on rule matching
By using a rule-based network traffic distribution system, traffic data is accurately distributed using preset distribution rules and field name combinations. This solves the problems of insufficient flexibility and scalability in existing technologies, and achieves efficient and secure traffic distribution and system reliability.
Patent Information
- Application Number
- CN202411528208.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Existing network traffic distribution methods lack flexibility, scalability, and accurate identification and classification mechanisms, making it difficult to quickly adjust distribution strategies, resulting in low processing efficiency and potentially leading to system failures or data loss.
A rule-based network traffic distribution system is adopted. By extracting the initial field names and intermediate traffic data of the target traffic data, and using preset distribution rules and field name combinations for matching, the target distribution rules and ports are filtered out to ensure that the traffic is accurately distributed to the appropriate processing port.
It improves the accuracy and scalability of network traffic distribution, avoids efficiency problems and security risks caused by blind distribution, ensures that traffic data matches device performance, and improves the operating efficiency and reliability of the network system.
Smart Images

Figure CN119402429B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a network traffic distribution system based on rule matching. BACKGROUND
[0002] With the continuous development and diversification of Internet applications, a large amount of network traffic needs to be reasonably distributed among different devices and systems, and efficient distribution of network traffic is crucial.
[0003] The existing traffic distribution method often relies on IP address or port, and distributes data according to the source IP address, destination IP address or port number of network traffic. In the face of complex and variable network traffic data, the traditional traffic distribution method lacks flexibility, scalability, accurate identification and classification mechanism. When the business requirements change and new traffic types or specific traffic rules need to be processed, it is often difficult to quickly and effectively adjust the distribution strategy, and it is also difficult to accurately distinguish different sources and characteristics of network traffic data, resulting in blindness in distribution, which may cause low processing efficiency, and even may cause system failure or data loss due to incorrect distribution, limiting the ability of users to respond to changing market environment and business requirements.
[0004] Therefore, how to improve the scalability and distribution accuracy of the network traffic distribution system has become a problem to be solved. SUMMARY
[0005] In order to solve the above technical problems, the technical scheme adopted by the present application is a network traffic distribution system based on rule matching, which comprises a processor and a memory storing a computer program, and the memory further stores N target traffic data, a plurality of preset distribution rules, a preset field name combination corresponding to each preset distribution rule, a preset port and a rule number. When the computer program is executed by the processor, the following steps are implemented:
[0006] S1, for any target traffic data, extracting all initial field names corresponding to the current target traffic data, and the first intermediate traffic data corresponding to each initial field name.
[0007] S2, according to all initial field names and the first intermediate traffic data corresponding to each initial field name, obtaining all initial field name combinations corresponding to the current target traffic data, and the second intermediate traffic data corresponding to each initial field name combination.
[0008] S3, filtering out a target distribution rule corresponding to each second intermediate traffic data from all preset distribution rules according to each preset field name combination, the preset distribution rule corresponding to each preset field name combination, each initial field name combination and the second intermediate traffic data corresponding to each initial field name combination.
[0009] S4, matching each second intermediate traffic data and the corresponding target distribution rule to obtain a hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0010] S5, obtaining a target port corresponding to each second intermediate traffic data according to the hit result between each second intermediate traffic data and the corresponding target distribution rule and the preset port corresponding to each target distribution rule.
[0011] S6, distributing the current target traffic data, the device information corresponding to the current target traffic data and the rule number corresponding to the target port according to the target port.
[0012] The application has at least the following beneficial effects: the target distribution rule is filtered out according to the matching result of the initial field name combination corresponding to the target traffic data and the preset field name combination corresponding to the preset distribution rule, the target port is filtered out according to the hit result between the second intermediate traffic data and the corresponding target distribution rule, the traffic can be accurately distributed to the appropriate processing port, the efficiency problem and the security risk caused by blind distribution are avoided, the target traffic data, the device information and the rule number corresponding to the target port are distributed to the port together, the type of traffic processed by each target port can be accurately determined, the traffic data distribution is better matched with the performance and characteristics of the device, the target traffic data is reasonably allocated to the port corresponding to the efficient processing device, the misdistribution of traffic data is avoided, the network management personnel can clearly understand from which device what kind of traffic data is distributed to which port according to what rule, the operation efficiency and the reliability of the entire network system are improved, and when the business demand changes, only the corresponding preset distribution rule and field name combination need to be adjusted or added, so that the new target traffic data can be rule-filtered and matched, thereby improving the scalability and distribution accuracy of the network traffic distribution system. BRIEF DESCRIPTION OF DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0014] Figure 1A flowchart of a processor executing a computer program to implement a network traffic distribution system based on rule matching is provided for Embodiment One of the present application. DETAILED DESCRIPTION
[0015] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0016] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It can be understood that the above-described terms for distinguishing similar objects can be interchanged under appropriate circumstances, so that the present application can also be implemented in other embodiments in addition to the above-described illustrated embodiments or described embodiments. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0017] Embodiment One
[0018] Embodiment One provides a network traffic distribution system based on rule matching, which comprises a processor and a memory storing a computer program, and further stores N target traffic data, device information corresponding to the target traffic data, a plurality of preset distribution rules, a preset field name combination corresponding to each preset distribution rule, a preset port, and a rule number. When the computer program is executed by the processor, the following steps are implemented, as shown in Figure 1
[0019] S1, for any target traffic data, extracting all initial field names corresponding to the current target traffic data, and a first intermediate traffic data corresponding to each initial field name.
[0020] The target traffic data refers to various data generated and transmitted at a network user end and a server end, which needs to be reasonably transmitted through the traffic distribution system. The target traffic data can include packet header information and data load. The packet header information includes key information such as source IP address, destination IP address, source port, destination port, protocol type (such as TCP, UDP), and the like, which is used to determine the source, destination and transmission mode of the data in the network. The data load is the core content of the network traffic data, that is, the data to be actually transmitted, which can be various types of data such as text, image, audio, video, application data, etc. Taking online video service as an example, the video stream data is the data load part of the network traffic data, and the size and format of the data load depend on the specific application scenario and the network service used.
[0021] For example, the target traffic data can include data generated by the user when accessing a website, using a mobile application, etc. Taking an e-commerce user as an example, when the user browses goods on an e-commerce website, the data generated by each click and search operation of the user will form network traffic. These data include the user's request information, such as the instruction to view a certain product detail page, and the data content includes the user's IP address, request time, requested web page URL, etc. The target traffic data can also include related data such as response data and push data generated by the server. Taking an online game server as an example, the server needs to continuously send game scene update data, other player operation data, etc. to the player client, and the size, frequency and importance of the data are different. When transmitted in the network, it forms network traffic and needs to be reasonably transmitted to the client through the traffic distribution system.
[0022] The device information can include device number, slot number and board card number, which are used to identify the physical transmission line condition of the target traffic data. When the target traffic data is transmitted on the physical line, the device number can be used to track the device path of the target traffic data, the slot number can be used to help determine the specific module path of the target traffic data, and the board card number can be used to indicate the processing path of the target traffic data inside the device.
[0023] The preset distribution rule and the corresponding preset field name combination are used to determine whether the target traffic data meets the output rule of the corresponding port. The specific preset distribution rule and the corresponding preset field name combination can be set by the implementer according to the actual situation.
[0024] For example, the preset distribution rule in this embodiment can include a five-tuple-based distribution rule, and the corresponding preset field name combination can include a source IP address, a destination IP address, a source port, a destination port, and a protocol type. The preset distribution rule based on a feature code can include a source IP address feature code, a destination IP address feature code, a source port feature code, a destination port feature code, a network layer protocol feature code, a transport layer protocol feature code, an application layer protocol feature code, a text content feature code, and a binary content feature code. The preset distribution rule based on an authentication account can include an account type, an authentication state, an authentication manner, a department to which the account belongs, and an account permission level. The preset distribution rule based on audio and video can include a protocol type and an audio and video encoding format. The preset distribution rule based on an attachment type carried by an HTTP message can include a data type and a file extension name. The preset distribution rule based on a domain name can include a domain name and a domain name suffix. The preset distribution rule based on a model can include a model identifier and a model parameter.
[0025] Therefore, the embodiment performs field extraction and corresponding data extraction on the target traffic data, obtains all initial field names corresponding to the target traffic data and first intermediate traffic data corresponding to each initial field name, as a preset distribution rule for screening, and determines a target port as a basis for data distribution transmission.
[0026] The first intermediate traffic data refers to data representing the specific content of the corresponding initial field name.
[0027] In a specific embodiment, the target traffic data is obtained through the following steps:
[0028] S01, obtaining original traffic data and a preset data packet quantity threshold M, where M is an integer greater than 0.
[0029] S02, determining the first M packet traffic data in the original traffic data as the target traffic data.
[0030] The preset data packet quantity threshold M can be set according to actual conditions. For example, M can be set to be not greater than the number of target devices. In the network traffic distribution scenario, the target device can be a network flow distributor, which mainly plays a role in collecting, filtering, converging, and load balancing of target traffic data.
[0031] S2, obtaining all initial field name combinations corresponding to the current target traffic data and second intermediate traffic data corresponding to each initial field name combination according to all initial field names and the first intermediate traffic data corresponding to each initial field name.
[0032] In an embodiment, S2 comprises the following steps:
[0033] S21, randomly combining all initial field names to obtain all initial field name combinations corresponding to the current target traffic data.
[0034] S22, combining the first intermediate traffic data corresponding to each initial field name in each initial field name combination to obtain the second intermediate traffic data corresponding to each initial field name combination.
[0035] Each preset distribution rule can correspond to a single or multiple field names. Therefore, all initial field names are randomly combined to obtain initial field name combinations, which are matched with the preset field name combinations corresponding to the preset distribution rules to filter the target distribution rules corresponding to the target traffic data from the preset distribution rules.
[0036] Meanwhile, the first intermediate traffic data corresponding to each initial field name in each initial field name combination is combined to obtain the second intermediate traffic data corresponding to each initial field name combination, which is matched with the corresponding target distribution rules as the basis for distributing the target traffic data.
[0037] According to all initial field names and the first intermediate traffic data corresponding to each initial field name, all initial field name combinations corresponding to the current target traffic data and the second intermediate traffic data corresponding to each initial field name combination are obtained, which can deeply explore the characteristics of the target traffic data, provide a basis for filtering the target distribution rules corresponding to the target traffic data and distributing the target traffic data, and ensure that the target traffic data is accurately distributed to the appropriate processing port, improve the distribution accuracy of the network traffic distribution system, and avoid the efficiency problems and security risks caused by blind distribution.
[0038] S3, according to each preset field name combination, each preset field name combination corresponding to the preset distribution rule, each initial field name combination and each initial field name combination corresponding to the second intermediate traffic data, filtering the target distribution rule corresponding to each second intermediate traffic data from all preset distribution rules.
[0039] In an embodiment, S3 comprises the following steps:
[0040] S31, for any initial field name combination, matching the current initial field name combination and each preset field name combination to obtain the matching result between the current initial field name combination and each preset field name combination, wherein the matching result includes matching and non-matching.
[0041] S32, if the matching result between the current initial field name combination and the current preset field name combination is matched, determining the preset distribution rule corresponding to the current preset field name combination as the target distribution rule corresponding to the second intermediate traffic data corresponding to the current initial field name combination.
[0042] S33, traversing all initial field name combinations and all preset field name combinations to obtain the target distribution rule corresponding to each second intermediate traffic data.
[0043] When all field names in the initial field name combination are consistent with all field names in the current preset field name combination, it can be determined that the matching result between the current initial field name combination and the current preset field name combination is matched, and the preset distribution rule corresponding to the current preset field name combination can be determined as the target distribution rule corresponding to the second intermediate traffic data corresponding to the current initial field name combination. Thus, the target distribution rule can be used to perform hit judgment on the corresponding second intermediate traffic data, serving as a basis for distributing the target traffic data, which can ensure that the target traffic data is accurately distributed to the appropriate processing port, improve the distribution accuracy of the network traffic distribution system, and avoid the efficiency problems and security risks caused by blind distribution.
[0044] S4, matching each second intermediate traffic data and the corresponding target distribution rule to obtain the hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0045] The specific content of the target distribution rule includes the requirements for the traffic data. Taking the distribution rule based on the authentication account as an example, the specific content can be that the account type is a personal account, the authentication state is authenticated, the authentication method is mobile phone authentication, the department belongs to A department, and the account permission level is general permission.
[0046] Therefore, by matching each second intermediate traffic data and the corresponding target distribution rule, it can be determined whether each second intermediate traffic data meets the requirements in the corresponding target distribution rule, thereby obtaining the hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0047] The hit result includes a hit and a miss, and correspondingly, if the second intermediate traffic data meets the requirement in the corresponding target distribution rule, the hit result between the second intermediate traffic data and the corresponding target distribution rule is determined as a hit, and the target traffic data can be output through the preset port corresponding to the target distribution rule. If the second intermediate traffic data does not meet the requirement in the corresponding target distribution rule, the hit result between the second intermediate traffic data and the corresponding target distribution rule is determined as a miss, and the target traffic data does not need to be output through the preset port corresponding to the target distribution rule.
[0048] The above, for each second intermediate traffic data and the corresponding target distribution rule are matched, and the hit result between each second intermediate traffic data and the corresponding target distribution rule is obtained as the basis for distributing the target traffic data, which can ensure that the target traffic data is accurately distributed to the appropriate processing port, improve the distribution accuracy of the network traffic distribution system, and avoid the efficiency problem and security risk caused by blind distribution.
[0049] S5, according to the hit result between each second intermediate traffic data and the corresponding target distribution rule, and the preset port corresponding to each target distribution rule, the target port corresponding to each second intermediate traffic data is obtained.
[0050] In a specific embodiment, the hit result includes a hit and a miss, and S5 includes the following steps:
[0051] S51, for any second intermediate traffic data, if the hit result between the current second intermediate traffic data and the corresponding target distribution rule is a hit, the preset port corresponding to the target distribution rule corresponding to the current second intermediate traffic data is determined as the target port corresponding to the current second intermediate traffic data.
[0052] S52, all second intermediate traffic data are traversed to obtain the target port corresponding to each second intermediate traffic data.
[0053] S6, according to the target port, the current target traffic data, the device information corresponding to the current target traffic data and the rule number corresponding to the target port, the distribution is performed.
[0054] In a specific embodiment, the memory further stores the data amount and the data input time corresponding to each target traffic data, and the data processing rate and the initial data amount corresponding to each target port, and S6 further includes the following steps:
[0055] S61, according to the data input time corresponding to each target traffic data and a plurality of target ports, the N target traffic data corresponding data input queue and the 0th target traffic data queue corresponding to each target port are obtained.
[0056] S62, initialize i = 1;
[0057] S63, according to a plurality of target ports corresponding to each target traffic data, an output port corresponding to the i-1th target traffic data, and an i-1th target traffic data queue corresponding to each target port, obtain an i-th target traffic data queue corresponding to each target port;
[0058] S64, for any target port, according to the i-th target traffic data queue corresponding to the current target port, the data amount corresponding to each target traffic data, the data processing rate corresponding to the current target port, and the initial data amount, obtain the output end time corresponding to each target traffic data in the i-th target traffic data queue corresponding to the current target port at the current target port;
[0059] S65, according to the output end time corresponding to the i-th target traffic data in the data input queue at each corresponding target port, obtain the output port corresponding to the i-th target traffic data;
[0060] S66, according to the output port corresponding to the i-th target traffic data, update i = i + 1, return to execute step S63 until i = N, and obtain the output port corresponding to the 1st to Nth target traffic data respectively;
[0061] S67, according to each output port, distribute the corresponding target traffic data, the corresponding device information and the corresponding rule number.
[0062] The data input time refers to the time when the target traffic data is called to be output from the port, which can represent the order of the target traffic data accepted by the port for screening processing.
[0063] The data processing rate refers to the amount of data that the corresponding port can process per unit time, which is usually measured in units of bits per second (bps), kilobits per second (kbps), megabits per second (Mbps), or gigabits per second (Gbps), and reflects the ability of the corresponding port in data transmission and processing.
[0064] The initial data amount refers to the amount of data that has not been processed among the traffic data being processed by each port when the first target traffic data is called for distribution and output. Correspondingly, before processing the newly input target traffic data, the port needs to process the data corresponding to the initial data amount first.
[0065] After the output port corresponding to the i-th target traffic data is determined, the value of i is updated to i+1, and then the step S400 is returned to execute, so that the first to the N-th target traffic data can be processed in turn, and in each iteration, the output port of the next target traffic data is recalculated according to the previous calculation result and the current network state, including the data processing rate of each port, the data amount and input time of each target traffic data and other factors, so as to ensure that the entire network traffic distribution control process covers all target traffic data.
[0066] In an embodiment, S61 comprises the following steps:
[0067] S610, sorting the N target traffic data in the order from early to late according to the data input time, and obtaining the data input queue corresponding to the N target traffic data.
[0068] S620, obtaining all target traffic data corresponding to each target port according to the target port corresponding to each target traffic data.
[0069] S630, for any target port, sorting all target traffic data corresponding to the current target port in the order from early to late according to the data input time, and obtaining the 0-th target traffic data queue corresponding to the current target port.
[0070] According to the above, the target traffic data is sorted in the order from early to late according to the data input time, and the port screening and distribution control of the earlier input target traffic data is given priority, which avoids the accumulation of subsequent data in the waiting process of early data, reduces the queuing waiting time of early data, and further speeds up the network interaction process.
[0071] In an embodiment, when i=1, the 0-th target traffic data and the output port corresponding to the 0-th target traffic data are both empty.
[0072] When i=1, it is clear that the 0-th target traffic data and the output port corresponding to the 0-th target traffic data are both empty, which is the initial state of the entire process, providing a reference for subsequent iteration operations.
[0073] In an embodiment, S63 comprises the following steps:
[0074] S631, determining the i-1-th target traffic data queue corresponding to the output port corresponding to the i-1-th target traffic data as the i-th target traffic data queue corresponding to the output port corresponding to the i-1-th target traffic data.
[0075] S632, determining, as non-output ports corresponding to the i-1th target traffic data, target ports corresponding to the i-1th target traffic data except for the output port corresponding to the i-1th target traffic data according to the target ports corresponding to each target traffic data and the output port corresponding to the i-1th target traffic data.
[0076] S633, deleting the i-1th target traffic data from the i-1th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data to obtain the i th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data.
[0077] When transitioning from the i-1th step to the i th step, the queue of the output port corresponding to the previous target traffic data naturally continues to the next iteration step without new operation. For the non-output port corresponding to the previous target traffic data, the target traffic data queue corresponding to the non-output port is updated by removing the target traffic data that has been processed in other ports (i.e. the output port corresponding to the i-1th target traffic data) to ensure that the queue data of each port accurately reflects the current traffic processing, so that the target traffic data queue corresponding to each target port can be accurately obtained in each iteration step (i from 1 to N), which provides an important data basis for determining the output end time of each target traffic data at the port and subsequent traffic data distribution control operations, thereby improving the accuracy and efficiency of network traffic distribution and the quality of network services.
[0078] In a specific embodiment, S64 includes the following steps:
[0079] S641, for any target traffic data in the i th target traffic data queue corresponding to the current target port, determining, as the reference data amount corresponding to any target traffic data, the sum of the data amount corresponding to any target traffic data, the data amount corresponding to all target traffic data sorted before any target traffic data in the i th target traffic data queue, and the initial data amount corresponding to the current target port according to the i th target traffic data queue corresponding to the current target port and the data amount corresponding to each target traffic data.
[0080] S642, obtaining the output end time corresponding to any target traffic data at the current target port according to the reference data amount and the data processing rate corresponding to the current target port.
[0081] The ratio of the reference data amount and the data processing rate corresponding to the current target port is determined as the output end time corresponding to any target traffic data at the current target port.
[0082] The output end time of each target flow data in the i th target flow data queue corresponding to any target port is determined by comprehensively considering the target flow data queue, the data volume, the port data processing rate and the initial data volume, which is of great significance for accurately controlling the processing and distribution order of the target flow data at each port, and can realize accurate estimation of the processing time of the target flow data, thereby providing a data basis for improving the accuracy and efficiency of network flow distribution.
[0083] In an embodiment, S65 comprises the following steps:
[0084] S651, comparing the output end time of the i th target flow data in the data input queue at each corresponding target port, and determining the target port corresponding to the minimum output end time as the output port of the i th target flow data.
[0085] Since the data processing rate, initial data volume and existing target flow data queue of each target port are different, the processing end time of the same target flow data by different target ports is different.
[0086] By comparing the output end times, the target port corresponding to the minimum output end time is determined as the output port of the i th target flow data, so as to select the target port that can complete the processing and output of the i th target flow data fastest, thereby reducing the transmission delay of the target flow data in the network to the greatest extent and improving the overall processing efficiency of network flow.
[0087] By comprehensively considering the output end time of the target flow data at each target port, the optimal output port is selected to realize efficient distribution and rapid processing of the target flow data, thereby improving the accuracy and efficiency of network flow distribution.
[0088] In an embodiment, the memory further stores device information corresponding to each target flow data, and S67 further comprises the following steps:
[0089] S671, obtaining target distribution data corresponding to each target flow data according to each target flow data, device information corresponding to each target flow data and rule numbers corresponding to each output port;
[0090] S672, distributing the target distribution data corresponding to each output port to the corresponding output port.
[0091] In an embodiment, S671 comprises the following steps:
[0092] S6711, obtain a preset first data combination template, wherein the first data combination template comprises a first position corresponding to the target traffic data, a second position corresponding to the device information, and a third position corresponding to the rule number.
[0093] S6712, fill each target traffic data, device information corresponding to each target traffic data, and a rule number corresponding to each output port into the first data combination template, and obtain target distribution data corresponding to each target traffic data.
[0094] The rule number corresponding to the target distribution rule corresponding to the output port can accurately determine the type of traffic processed by each output port, avoid misdistribution of traffic data, and ensure that each output port receives traffic data that meets its processing capacity and business requirements.
[0095] Different devices can have different processing capabilities, storage capacities, and network interface speeds.
[0096] Therefore, by distributing target traffic data, device information, and rule numbers corresponding to output ports to ports, traffic data distribution can be better matched with the performance and characteristics of the device, and target traffic data can be reasonably allocated to ports corresponding to efficient processing devices. At the same time, network management personnel can clearly understand which device sends which traffic data to which port according to which rule, improving the operation efficiency and reliability of the entire network system.
[0097] In one embodiment, the memory also stores reference traffic data corresponding to each target traffic data, and S671 further comprises the following steps:
[0098] S6713, delete the corresponding reference traffic data from each target traffic data to obtain the to-be-distributed traffic data corresponding to each target traffic data;
[0099] S6714, according to the to-be-distributed traffic data corresponding to each target traffic data and the device information, and the rule number corresponding to each output port, obtain the target distribution data corresponding to each target traffic data.
[0100] In one embodiment, S6714 comprises the following steps:
[0101] S6715, obtain a preset second data combination template, wherein the second data combination template comprises a fourth position corresponding to the to-be-distributed traffic data, a second position corresponding to the device information, and a third position corresponding to the rule number;
[0102] S6716, fill in the second data combination template with the to-be-distributed traffic data corresponding to each target traffic data, the device information, and the rule number corresponding to each output port, to obtain target distribution data corresponding to each target traffic data.
[0103] The reference traffic data can be data transmitted in a network tunnel technology, which is a technology of transmitting data of one protocol by encapsulating in a data packet of another protocol. The tunnel data can contain sensitive information within an enterprise or user privacy data. Therefore, in order to improve the security of data transmission, the tunnel data is deleted in the distribution process of the target traffic data, and the remaining to-be-distributed traffic data, device information, and rule number corresponding to each target port are collectively distributed to the corresponding target port.
[0104] The above-mentioned distribution of the target traffic data, device information, and rule number corresponding to the target port to the port can accurately determine the type of traffic processed by each target port, better match the traffic data distribution with the performance and characteristics of the device, reasonably allocate the target traffic data to the port corresponding to the efficient processing device, avoid misdistribution of traffic data, and facilitate network management personnel to clearly understand from which device what kind of traffic data is distributed to which port according to what rule, thereby improving the operation efficiency and reliability of the entire network system.
[0105] The above-mentioned distribution of the target traffic data, device information, and rule number corresponding to the target port to the port can accurately determine the type of traffic processed by each target port, better match the traffic data distribution with the performance and characteristics of the device, reasonably allocate the target traffic data to the port corresponding to the efficient processing device, avoid misdistribution of traffic data, and facilitate network management personnel to clearly understand from which device what kind of traffic data is distributed to which port according to what rule, thereby improving the operation efficiency and reliability of the entire network system.
[0106] While certain specific embodiments of the application have been described in detail herein for the purposes of exemplification, numerous other variations and modifications will be apparent to persons skilled in the art. Alterations and modifications of detail can be made by those skilled in the art, having the benefit of the above description, without departing from the spirit and scope of the application. It is intended that all such alterations and modifications be included within the scope of the application whose limits are to be determined only by the appended claims.
Claims
1. A rule matching based network traffic distribution system, characterized in that, The rule matching-based network traffic distribution system comprises a processor and a memory storing a computer program, the memory further storing N target traffic data, device information corresponding to the target traffic data, data volume and data input time corresponding to each target traffic data, data processing rate and initial data volume corresponding to each target port, a plurality of preset distribution rules and a preset field name combination corresponding to each preset distribution rule, a preset port and a rule number, and when the computer program is executed by the processor, the following steps are implemented: S1, for any target traffic data, extracting all initial field names corresponding to the current target traffic data and first intermediate traffic data corresponding to each initial field name; S2, according to all initial field names and first intermediate traffic data corresponding to each initial field name, obtaining all initial field name combinations corresponding to the current target traffic data and second intermediate traffic data corresponding to each initial field name combination, wherein S2 comprises the following steps: S21, randomly combining all initial field names to obtain all initial field name combinations corresponding to the current target traffic data; S22, according to first intermediate traffic data corresponding to each initial field name, combining first intermediate traffic data corresponding to all initial field names in each initial field name combination to obtain second intermediate traffic data corresponding to each initial field name combination; S3, according to each preset field name combination, a preset distribution rule corresponding to each preset field name combination, each initial field name combination and second intermediate traffic data corresponding to each initial field name combination, screening target distribution rules corresponding to each second intermediate traffic data from all preset distribution rules; S4, matching each second intermediate traffic data and the corresponding target distribution rule to obtain a hit result between each second intermediate traffic data and the corresponding target distribution rule; S5, according to the hit result between each second intermediate traffic data and the corresponding target distribution rule and the preset port corresponding to each target distribution rule, obtaining a target port corresponding to each second intermediate traffic data; S6, distributing the current target traffic data, device information corresponding to the current target traffic data and the rule number corresponding to the target port according to the target port, wherein S6 further comprises the following steps: S61, according to the data input time corresponding to each target traffic data and a plurality of target ports, obtaining data input queues corresponding to the N target traffic data and a 0th target traffic data queue corresponding to each target port; S62, initializing i=1; S63, according to a plurality of target ports corresponding to each target traffic data, an output port corresponding to an (i-1)th target traffic data and an (i-1)th target traffic data queue corresponding to each target port, obtaining an ith target traffic data queue corresponding to each target port; S64, for any target port, according to the i-th target traffic data queue corresponding to the current target port, the data volume corresponding to each target traffic data, the data processing rate corresponding to the current target port and the initial data volume, obtaining the output end time corresponding to each target traffic data in the i-th target traffic data queue corresponding to the current target port at the current target port; S65, according to the output end time corresponding to the i-th target traffic data at each target port corresponding to the data input queue, obtaining the output port corresponding to the i-th target traffic data; S66, according to the output port corresponding to the i-th target traffic data, updating i=i+1, returning to step S63 until i=N, respectively obtaining the output port corresponding to the first to N-th target traffic data; S67, according to each output port, distributing the corresponding target traffic data, the corresponding device information and the corresponding rule number.
2. The rule matching based network traffic distribution system of claim 1, wherein, The target traffic data is obtained by the following steps: S01, obtaining the original traffic data and the preset packet quantity threshold M, wherein M is an integer greater than 0; S02, determining the first M packet traffic data in the original traffic data as the target traffic data.
3. The rule matching based network traffic distribution system of claim 1, wherein, S3 includes the following steps: S31, for any initial field name combination, matching the current initial field name combination and each preset field name combination to obtain the matching result between the current initial field name combination and each preset field name combination, wherein the matching result includes matching and non-matching; S32, for any preset field name combination, if the matching result between the current initial field name combination and the current preset field name combination is matching, determining the preset distribution rule corresponding to the current preset field name combination as the target distribution rule corresponding to the second intermediate traffic data corresponding to the current initial field name combination; S33, traversing all initial field name combinations and all preset field name combinations to obtain the target distribution rule corresponding to each second intermediate traffic data.
4. The rule-match-based network traffic distribution system of claim 1, wherein, The hit result includes hit and miss, and S5 includes the following steps: S51, for any second intermediate traffic data, if the hit result between the current second intermediate traffic data and the corresponding target distribution rule is hit, determining the preset port corresponding to the target distribution rule corresponding to the current second intermediate traffic data as the target port corresponding to the current second intermediate traffic data; S52, traversing all second intermediate traffic data to obtain the target port corresponding to each second intermediate traffic data.
5. The rule-match-based network traffic distribution system of claim 1, wherein, The memory also stores the device information corresponding to each target traffic data, and S67 further includes the following steps: S671, according to each target traffic data, the device information corresponding to each target traffic data and the rule number corresponding to each output port, obtaining the target distribution data corresponding to each target traffic data; S672, distributing the target distribution data corresponding to each output port to the corresponding output port.
6. The rule matching based network traffic distribution system of claim 5, wherein, S671 further includes the following steps: S6711, obtain a preset first data combination template, wherein the first data combination template comprises a first position corresponding to target traffic data, a second position corresponding to device information, and a third position corresponding to a rule number; S6712, fill each target traffic data, device information corresponding to each target traffic data, and a rule number corresponding to each output port into the first data combination template, and obtain target distribution data corresponding to each target traffic data.
7. The rule matching based network traffic distribution system of claim 5, wherein, The memory also stores reference traffic data corresponding to each target traffic data, and S671 further comprises the following steps: S6713, delete the corresponding reference traffic data from each target traffic data, and obtain to-be-distributed traffic data corresponding to each target traffic data; S6714, according to the to-be-distributed traffic data corresponding to each target traffic data and the device information, and the rule number corresponding to each output port, obtain the target distribution data corresponding to each target traffic data.
8. The rule matching based network traffic distribution system of claim 7, wherein, S6714 comprises the following steps: S6715, obtain a preset second data combination template, wherein the second data combination template comprises a fourth position corresponding to to-be-distributed traffic data, a second position corresponding to device information, and a third position corresponding to a rule number; S6716, fill the to-be-distributed traffic data corresponding to each target traffic data and the device information, and the rule number corresponding to each output port into the second data combination template, and obtain the target distribution data corresponding to each target traffic data.
Citation Information
Patent Citations
Filtering method and device for traffic message
CN109672669A
Mass internet traffic processing system and method based on dynamic rule driving
CN115473819A