A method, device, medium and equipment for network traffic distribution control
By dynamically calculating and distributing network traffic data, the problems of data congestion and idleness in traditional methods are solved, efficient network traffic distribution and rapid processing are achieved, and the quality of network services is improved.
Patent Information
- Application Number
- CN202411528212.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Traditional network traffic distribution methods fail to effectively consider the characteristics and dynamic changes of traffic data, resulting in data congestion or idleness on the port, reducing network transmission efficiency and stability.
By obtaining information such as the data quantity, input time and data processing rate of the target traffic data, dynamically calculate the target traffic data queue and output end time of each target port, and prioritize the distribution of input earlier data to avoid data backlog.
It realizes efficient distribution and rapid processing of target traffic data, reduces queueing time, improves network interaction efficiency, and ensures the quality of network services.
Smart Images

Figure CN119276798B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and particularly to a method, device, medium and equipment for controlling network traffic distribution. Background Art
[0002] In today's world, the management of network traffic has become crucial. With the development of the digital age and the continuous increase in network applications, the data traffic in the network shows the characteristics of diversification and high volume. Network traffic data needs to be processed and transmitted through different ports. How to reasonably distribute the traffic data plays an important role in the process of network data transmission.
[0003] Traditional network traffic distribution methods are often relatively simple. For example, based on static routing or simple load balancing strategies, they do not fully consider the characteristics of the traffic data itself and its dynamic changes. In the face of complex network environments and diverse traffic data, if reasonable distribution control cannot be carried out according to the real-time situation of the traffic data, it may lead to data congestion on some ports, while other ports are idle or not fully utilized. This unbalanced traffic distribution will not only reduce the network transmission efficiency and operation stability, increase the delay of data transmission, but also may affect the quality of network services.
[0004] Therefore, how to improve the efficiency of network traffic distribution has become an urgent problem to be solved. Summary of the Invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is a method for controlling network traffic distribution, and the method for controlling network traffic distribution includes the following steps:
[0006] S100, obtaining N target traffic data, the data volume corresponding to each target traffic data, the data input time, and a plurality of target ports, as well as the data processing rate and the initial data volume corresponding to each target port, where N is an integer greater than 1.
[0007] S200, obtaining the data input queue corresponding to the N target traffic data and the 0th target traffic data queue corresponding to each target port according to the data input time corresponding to each target traffic data and the plurality of target ports.
[0008] S300, initializing i = 1.
[0009] S400, obtaining the ith target traffic data queue corresponding to each target port according to the plurality of target ports corresponding to each target traffic data, the output port corresponding to the (i - 1)th target traffic data, and the (i - 1)th target traffic data queue corresponding to each target port.
[0010] S500. For any target port, based on 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, 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.
[0011] S600. Based on the output end time corresponding to the i-th target traffic data in each corresponding target port in the data input queue, obtain the output port corresponding to the i-th target traffic data.
[0012] S700. Based on the output port corresponding to the i-th target traffic data, update i = i + 1, and return to execute step S400 until i = N, and respectively obtain the output ports corresponding to the 1st to Nth target traffic data.
[0013] S800. Distribute each target traffic data to the corresponding output port.
[0014] The present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and at least one instruction or at least one program segment is loaded and executed by a processor to implement the above network traffic distribution control method.
[0015] The present invention also provides an electronic device, including a processor and the above non-transitory computer-readable storage medium.
[0016] The present invention has at least the following beneficial effects: Sort the target traffic data according to the order of the data input time corresponding to the target traffic data from early to late, and preferentially perform port screening and distribution control on the target traffic data with earlier input, avoiding the backlog of early data by subsequent data during the waiting for processing, reducing the queuing waiting time of early data, thereby accelerating the network interaction process, and accurately obtaining the target traffic data queue corresponding to each target port in each iterative step. By comprehensively considering factors such as the target traffic data queue, data volume, port data processing rate, and initial data volume, determine the output end time of each target traffic data in the i-th target traffic data queue corresponding to any target port at this port, which can accurately estimate the processing time of the target traffic data, so as to select the optimal output port to achieve the efficient distribution and rapid processing of the target traffic data, and improve the efficiency of network traffic distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0018] Figure 1 It is a flowchart of a network traffic distribution control method provided in Embodiment 1 of the present invention. Specific implementation manners
[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above accompanying drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It can be understood that, under appropriate circumstances, the above terms for distinguishing similar objects can be interchanged so that the present invention can also implement other embodiments other than the 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 may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0021] Embodiment 1
[0022] Embodiment 1 of the present invention provides a network traffic distribution control method. The network traffic distribution control method includes the following steps, as Figure 1 shown:
[0023] S100. Obtain N target traffic data, the data volume corresponding to each target traffic data, the data input time, and a plurality of target ports, as well as the data processing rate and the initial data volume corresponding to each target port, where N is an integer greater than 1.
[0024] Among them, the target traffic data refers to various data generated and transmitted at the network user side and the server side, which need to be reasonably transmitted through the traffic distribution method. The target traffic data may include data packet header information and data payload. Among them, the data packet header information contains key information such as source IP address, destination IP address, source port, destination port, protocol type (such as TCP, UDP), etc., which is used to determine the source, destination and transmission method of the data in the network. The data payload 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 program data, etc. Taking the online video service as an example, the video stream data is the data payload part in the network traffic data, and the size and format of the data payload depend on the specific application scenario and the network service adopted.
[0025] For example, the target traffic data may include data generated when users access websites, use mobile applications, etc. Taking e-commerce users as an example, when users browse products 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 request to view the details page of a certain product, and its data content contains the user's IP address, request time, the URL of the requested web page, etc. The target traffic data may also include relevant 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 data such as game scene update data and operation data of other players to the player client. The size, frequency and importance of the data are different, and they form network traffic when transmitted in the network and need to be reasonably transmitted to the client through the traffic distribution method.
[0026] The data input time refers to the time when the target traffic data is called to be output from the port, which can characterize the order of the target traffic data received by the port for screening and processing.
[0027] The data processing rate refers to the amount of data that the corresponding port can process per unit time, usually measured in units such as bits per second (bps), kilobits per second (kbps), megabits per second (Mbps) or gigabits per second (Gbps), which reflects the ability of the corresponding port in data transmission and processing.
[0028] The initial data volume refers to the amount of unprocessed data in 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 gradually, the port needs to first process the data corresponding to the initial data volume.
[0029] In a specific embodiment, several target ports corresponding to each target traffic data are obtained through the following steps:
[0030] S10. Obtain N target traffic data, the device information corresponding to each target traffic data, several preset distribution rules, the preset field name combinations corresponding to each preset distribution rule, and the preset ports.
[0031] S20. For any target traffic data, extract all the initial field names corresponding to the target traffic data, and the first intermediate traffic data corresponding to each initial field name.
[0032] S30. Based on all the initial field names and the first intermediate traffic data corresponding to each initial field name, obtain all the initial field name combinations corresponding to the target traffic data, and the second intermediate traffic data corresponding to each initial field name combination.
[0033] S40. Based on 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, screen out the target distribution rule corresponding to each second intermediate traffic data from all the preset distribution rules.
[0034] S50. Match each second intermediate traffic data with the corresponding target distribution rule to obtain the hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0035] S60. Based on 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, obtain the target port corresponding to each second intermediate traffic data.
[0036] S70. Based on the target port corresponding to each second intermediate traffic data, obtain several target ports corresponding to the target traffic data.
[0037] Among them, the device information may include the device number, slot number, and board card number, which are used to identify the physical transmission line situation of the target traffic data. When the target traffic data is transmitted on the physical line, the device path passed by the target traffic data can be traced through the device number, the specific module path passed by the target traffic data can be determined through the slot number, and the processing path of the target traffic data inside the device can be indicated through the board card number.
[0038] The preset distribution rules and their corresponding preset field name combinations are used to determine whether the target traffic data conforms to the output rules of the corresponding ports. The specific preset distribution rules and the corresponding preset field name combinations can be set by the implementer according to the actual situation.
[0039] For example, the preset distribution rules in this embodiment may include distribution rules based on quintuples, and the corresponding preset field name combinations may include source IP address, destination IP address, source port, destination port, and protocol type. Distribution rules based on signature codes, and the corresponding preset field name combinations may include source IP address signature code, destination IP address signature code, source port signature code, destination port signature code, network layer protocol signature code, transport layer protocol signature code, application layer protocol signature code, text content signature code, and binary content signature code. Distribution rules based on authenticated accounts, and the corresponding preset field name combinations may include account type, authentication status, authentication method, department, and account privilege level. Distribution rules based on audio and video, and the corresponding preset field name combinations may include protocol type and audio and video encoding format. Distribution rules based on the attachment type carried in the HTTP message, and the corresponding preset field name combinations may include data type and file extension name. Distribution rules based on domain names, and the corresponding preset field name combinations may include domain name and domain name suffix. Distribution rules based on models, and the corresponding preset field name combinations may include model identifier and model parameters.
[0040] Therefore, field extraction and corresponding data extraction are performed on the target traffic data to obtain all the initial field names corresponding to the target traffic data, as well as the first intermediate traffic data corresponding to each initial field name, so as to screen the preset distribution rules, thereby determining the target port to control data distribution and transmission.
[0041] The first intermediate traffic data refers to the data representing the specific content of the corresponding initial field name.
[0042] Each preset distribution rule may correspond to a single or multiple field names. Therefore, in this embodiment, all the initial field names can be randomly combined to obtain initial field name combinations, which are used to match the preset field name combinations corresponding to the preset distribution rules, so as to screen out the target distribution rules corresponding to the target traffic data from the preset distribution rules.
[0043] At the same time, according to the first intermediate traffic data corresponding to each initial field name, the first intermediate traffic data corresponding to all the initial field names in each initial field name combination are combined to obtain the second intermediate traffic data corresponding to each initial field name combination, which is used to match the corresponding target distribution rule and serves as the basis for controlling the distribution of the target traffic data.
[0044] The specific content of the target distribution rule includes requirements for traffic data. Taking the distribution rule based on authenticated accounts as an example, the specific content may be that the account type is a personal account, the authentication status is authenticated, the authentication method is mobile phone number authentication, the department is department A, and the account privilege level is general privilege.
[0045] Therefore, each second intermediate traffic data is matched with the corresponding target distribution rule to determine whether each second intermediate traffic data meets the requirements in the corresponding target distribution rule, so as to obtain the hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0046] The hit result includes hit and miss. Correspondingly, if the second intermediate traffic data meets the requirements in the corresponding target distribution rule, it is determined that the hit result between the second intermediate traffic data and the corresponding target distribution rule is 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 requirements in the corresponding target distribution rule, it is determined that the hit result between the second intermediate traffic data and the corresponding target distribution rule is a miss, and there is no need to output the target traffic data through the preset port corresponding to the target distribution rule.
[0047] In a specific embodiment, S40 includes the following steps:
[0048] S401: For any initial field name combination, match the current initial field name combination with each preset field name combination to obtain the matching result between the current initial field name combination and each preset field name combination, where the matching result includes match and mismatch.
[0049] S402: 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 a match, the preset distribution rule corresponding to the current preset field name combination is determined as the target distribution rule corresponding to the second intermediate traffic data corresponding to the current initial field name combination.
[0050] S403: Traverse all initial field name combinations and all preset field name combinations to obtain the target distribution rule corresponding to each second intermediate traffic data.
[0051] Among them, when all the field names in the initial field name combination are the same as all the 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 a match, 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 judge the hit of the corresponding second intermediate traffic data, which serves as the basis for distributing the target traffic data, ensuring that the target traffic data is accurately distributed to the appropriate processing port, improving the distribution accuracy of the network traffic distribution system, and avoiding the efficiency problems and security risks caused by blind distribution.
[0052] In a specific embodiment, the hit result includes hit and miss, and S60 includes the following steps:
[0053] S601, 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, then determine 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.
[0054] S602, traverse all the second intermediate traffic data to obtain the target port corresponding to each second intermediate traffic data.
[0055] S200, according to the data input time corresponding to each target traffic data and several target ports, obtain the data input queue corresponding to N target traffic data and the 0th target traffic data queue corresponding to each target port.
[0056] In a specific embodiment, S200 includes the following steps:
[0057] S210, sort the N target traffic data in ascending order of the data input time to obtain the data input queue corresponding to the N target traffic data.
[0058] S220, according to the target port corresponding to each target traffic data, obtain all the target traffic data corresponding to each target port.
[0059] S230, for any target port, sort all the target traffic data corresponding to the current target port in ascending order of the data input time to obtain the 0th target traffic data queue corresponding to the current target port.
[0060] As described above, sorting in ascending order of the data input time corresponding to the target traffic data gives priority to screening ports and controlling distribution for target traffic data with earlier input times, avoiding early data from being backlogged by subsequent data during the waiting for processing, reducing the queuing waiting time for early data, and thus accelerating the network interaction process.
[0061] S300, initialize i = 1.
[0062] S400, according to several target ports corresponding to each target traffic data, the output port corresponding to the (i - 1)th target traffic data, and the (i - 1)th target traffic data queue corresponding to each target port, obtain the ith target traffic data queue corresponding to each target port.
[0063] In a specific embodiment, when i = 1, both the 0th target traffic data and the output port corresponding to the 0th target traffic data are empty.
[0064] Among them, when i = 1, it is clear that both the 0th target traffic data and the output port corresponding to the 0th target traffic data are empty, serving as the initial state of the entire process and providing a benchmark for subsequent iterative operations.
[0065] In a specific embodiment, S400 includes the following steps:
[0066] S410, determine the (i - 1)th target traffic data queue corresponding to the output port corresponding to the (i - 1)th target traffic data as the ith target traffic data queue corresponding to the output port corresponding to the (i - 1)th target traffic data.
[0067] S420, according to several target ports corresponding to each target traffic data and the output port corresponding to the (i - 1)th target traffic data, determine the target ports other than the output port corresponding to the (i - 1)th target traffic data as the non - output ports corresponding to the (i - 1)th target traffic data.
[0068] S430, delete the (i - 1)th target traffic data from the (i - 1)th target traffic data queue corresponding to the non - output port corresponding to the (i - 1)th target traffic data, and obtain the ith target traffic data queue corresponding to the non - output port corresponding to the (i - 1)th target traffic data.
[0069] Among them, when transitioning from the (i - 1)th step to the ith step, for the output port corresponding to the previous target traffic data, its queue naturally continues to the next iterative step without the influence of new operations. 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 at other ports (i.e., the output port corresponding to the (i - 1)th target traffic data), so as to ensure that the queue data of each port accurately reflects the current traffic processing situation, so that the target traffic data queue corresponding to each target port can be accurately obtained in each iterative step (i from 1 to N), providing an important data basis for subsequent traffic data distribution control operations such as determining the output end time of each target traffic data at the port, thereby improving the efficiency of network traffic distribution and the quality of network services.
[0070] S500, for any target port, according to the ith 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, obtain the output end time corresponding to each target traffic data in the ith target traffic data queue corresponding to the current target port.
[0071] In a specific embodiment, S500 includes the following steps:
[0072] S510. For any target traffic data in the \(i\)-th target traffic data queue corresponding to the current target port, based on the \(i\)-th target traffic data queue corresponding to the current target port and the data volume corresponding to each target traffic data, the sum of the data volume corresponding to any target traffic, the data volumes corresponding to all target traffic data sorted before any target traffic data in the \(i\)-th target traffic data queue, and the initial data volume corresponding to the current target port is determined as the reference data volume corresponding to any target traffic data.
[0073] S520. Based on the reference data volume and the data processing rate corresponding to the current target port, obtain the output end time corresponding to any target traffic data at the current target port.
[0074] Among them, the ratio of the reference data volume to 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.
[0075] As described above, by comprehensively considering factors such as the target traffic data queue, data volume, port data processing rate, and initial data volume, the output end time of each target traffic data in the \(i\)-th target traffic data queue corresponding to any target port at that port is determined, which is of great significance for accurately controlling the processing and distribution order of target traffic data at each port, can achieve an accurate estimation of the processing time of target traffic data, and provides a data basis for improving the efficiency of network traffic distribution.
[0076] S600. Based on 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.
[0077] In a specific embodiment, S600 includes the following steps:
[0078] S610. Compare the output end times corresponding to the \(i\)-th target traffic data in the data input queue at each corresponding target port, and determine the target port corresponding to the minimum output end time as the output port corresponding to the \(i\)-th target traffic data.
[0079] Among them, since the data processing rate, initial data volume, and the current situation of the target traffic data queue of each target port are different, there will be differences in the processing end times of the same target traffic data for different target ports.
[0080] By comparing these output end times, the target port corresponding to the minimum output end time is determined as the output port for the i-th target traffic data, so as to select the target port that can enable the i-th target traffic data to be processed and output the fastest, which can minimize the transmission delay of the target traffic data in the network and improve the overall processing efficiency of network traffic.
[0081] As described above, by comprehensively considering the output end times corresponding to the target traffic data at each target port, the optimal output port is selected to achieve the efficient distribution and fast processing of the target traffic data, thereby improving the efficiency of network traffic distribution.
[0082] S700, according to the output port corresponding to the i-th target traffic data, update i = i + 1, and return to execute step S400 until i = N, and the output ports corresponding to the 1st to Nth target traffic data are obtained respectively.
[0083] Among them, after determining the output port corresponding to the i-th target traffic data, by updating the value of i to i + 1 and then returning to execute step S400, the 1st to Nth target traffic data can be processed in sequence, and in each iteration, based on the previous calculation results and the current network status, including factors such as the data processing rate of each port, the data volume and input time of each target traffic data, etc., the output port of the next target traffic data is recalculated to ensure that the entire network traffic distribution control process covers all target traffic data.
[0084] S800, distribute each target traffic data to the corresponding output port.
[0085] Among them, according to the output port corresponding to each determined target traffic data, the target traffic data is distributed to the corresponding port, realizing the final allocation of the target traffic data, ensuring that each target traffic data can reach the port most suitable for processing it, thereby realizing efficient network traffic processing.
[0086] In a specific embodiment, S800 further includes the following steps:
[0087] S810, obtain the device information corresponding to each target traffic data and the rule number corresponding to each preset distribution rule.
[0088] S820, according to the preset port and rule number corresponding to each preset distribution rule, obtain the rule number corresponding to each output port.
[0089] S830, for any target traffic data, according to the current target traffic data, the device information corresponding to the current target traffic data, and the rule number corresponding to the output port corresponding to the current target traffic data, obtain the target distribution data corresponding to the output port.
[0090] S840 distributes the target distribution data corresponding to each output port to the corresponding output port.
[0091] In a specific embodiment, S830 includes the following steps:
[0092] S831, obtain a preset data combination template, where the data combination template includes 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] S832, fill the current target traffic data, the device information corresponding to the current target traffic data, and the rule number corresponding to the output port corresponding to the current target traffic data into the data combination template to obtain the target distribution data corresponding to the output port.
[0094] Among them, through the rule number corresponding to the output port, the traffic type processed by each output port can be accurately determined, avoiding the misdistribution of traffic data, so as to ensure that the traffic data received by each output port meets its processing capacity and business requirements.
[0095] Different devices may have different processing capabilities, storage capacities, and network interface speeds.
[0096] Therefore, by distributing the target traffic data together with the device information and the rule number corresponding to the output port to the output port, it is possible to better match the traffic data distribution with the performance and characteristics of the device, reasonably allocate the target traffic data to the ports corresponding to high-efficiency processing devices, and at the same time facilitate network administrators to clearly understand which traffic data sent from which device is distributed to which port according to what rules, improving the operation efficiency and reliability of the entire network system.
[0097] As described above, sorting according to the order of the data input time corresponding to the target traffic data from early to late, preferentially screening and distributing and controlling the target traffic data with earlier input, avoiding the backlog of early data by subsequent data during the waiting for processing, reducing the queuing waiting time of early data, thereby accelerating the network interaction process, and accurately obtaining the target traffic data queue corresponding to each target port in each iteration step. By comprehensively considering factors such as the target traffic data queue, data volume, port data processing rate, and initial data volume, determining the output end time of each target traffic data in the i-th target traffic data queue corresponding to any target port at this port, it is possible to accurately estimate the processing time of the target traffic data, so as to select the optimal output port to achieve the efficient distribution and rapid processing of the target traffic data, improving the efficiency of network traffic distribution.
[0098] It should be noted that for the information interaction, execution process, etc. between the above modules, since they are based on the same concept as the method embodiment of the present invention, for their specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details will not be elaborated here.
[0099] Embodiment 2
[0100] Embodiment 2 of the present invention provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the steps:
[0101] S100, obtain N target traffic data, the data volume corresponding to each target traffic data, the data input time, and a plurality of target ports, as well as the data processing rate and the initial data volume corresponding to each target port, where N is an integer greater than 1.
[0102] S200, according to the data input time corresponding to each target traffic data and a plurality of target ports, obtain the data input queues corresponding to the N target traffic data and the 0th target traffic data queue corresponding to each target port.
[0103] S300, initialize i = 1.
[0104] S400, according to a plurality of target ports corresponding to each target traffic data, the output port corresponding to the (i - 1)th target traffic data, and the (i - 1)th target traffic data queue corresponding to each target port, obtain the ith target traffic data queue corresponding to each target port.
[0105] S500, for any target port, according to the ith 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, obtain the output end time corresponding to each target traffic data in the ith target traffic data queue of the current target port at the current target port.
[0106] S600, according to the output end time corresponding to the ith target traffic data in the data input queue at each corresponding target port, obtain the output port corresponding to the ith target traffic data.
[0107] S700, according to the output port corresponding to the ith target traffic data, update i = i + 1, and return to execute step S400 until i = N, and respectively obtain the output ports corresponding to the 1st to Nth target traffic data.
[0108] S800, distribute each target traffic data to the corresponding output port.
[0109] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronization Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0111] Embodiment III
[0112] Embodiment III of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium in Embodiment V of the present invention.
[0113] The above are only the preferred embodiments of the present invention, and there is no limitation to the present invention in any form. Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to the equivalent embodiments by using the disclosed technical content within the scope of the technical solution of the present invention. However, as long as it does not depart from the content of the technical solution of the present invention, any simple modification, equivalent change, and modification made to the above embodiments according to the technical essence of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A network traffic distribution control method, characterized in that: The network traffic distribution control method comprises the following steps: S100, obtaining N target flow data, the data volume corresponding to each target flow data, the data input time and a number of target ports, and the data processing rate and initial data volume corresponding to each target port, wherein N is an integer greater than 1, and the number of target ports corresponding to each target flow data is obtained by the following steps: S10, obtaining N target traffic data, device information corresponding to each target traffic data, a number of preset distribution rules, and a preset field name combination and a preset port corresponding to each preset distribution rule; S20, for any target flow data, extracting all initial field names corresponding to the target flow data and first intermediate flow data corresponding to each initial field name; S30, acquiring all initial field name combinations corresponding to the target flow data and second intermediate flow data corresponding to each initial field name combination according to all initial field names and first intermediate flow data corresponding to each initial field name combination; S40, 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, filter out the target distribution rule corresponding to each second intermediate traffic data from all the preset distribution rules; S50, matching each second intermediate flow data with a corresponding target distribution rule, and obtaining a hit result between each second intermediate flow data and the corresponding target distribution rule; S60, acquiring a target port corresponding to each second intermediate flow data according to a hit result between each second intermediate flow data and a corresponding target distribution rule, and a preset port corresponding to each target distribution rule; S70, acquiring a plurality of target ports corresponding to the target flow data according to the target port corresponding to each second intermediate flow data; S200, acquiring the data input queues corresponding to the N target flow data and the 0th target flow data queue corresponding to each target port according to the data input time and a number of target ports corresponding to each target flow data; S300, initialize i=1; S400, according to a number of target ports corresponding to each target flow data, an output port corresponding to the i-1th target flow data, and an i-1th target flow data queue corresponding to each target port, an i-th target flow data queue corresponding to each target port is obtained; S500, 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, 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; S600, acquiring the output port corresponding to the i-th target flow data according to the output end time corresponding to each corresponding target port of the i-th target flow data in the data input queue; S700, according to the output port corresponding to the i-th target flow data, update i=i+1, return to execute step S400, until i=N, and obtain the output ports corresponding to the 1st to Nth target flow data respectively; S800, distribute each target flow data to the corresponding output port.
2. The network traffic distribution control method according to claim 1, characterized in that: S800 also includes the following steps: S810, obtaining device information corresponding to each target traffic data and a rule number corresponding to each preset distribution rule; S820, acquiring a rule number corresponding to each output port according to the preset port and the rule number corresponding to each preset distribution rule; S830, for any target traffic data, according to the current target traffic data, the device information corresponding to the current target traffic data, and the rule number corresponding to the output port corresponding to the current target traffic data, obtain the target distribution data corresponding to the output port; S840, distribute the target distribution data corresponding to each output port to the corresponding output port.
3. The network traffic distribution control method according to claim 1, characterized in that: S200 includes the following steps: S210, sorting the N target flow data in order of data input time from earliest to latest, and acquiring data input queues corresponding to the N target flow data; S220, acquiring all target flow data corresponding to each target port according to the target port corresponding to each target flow data; S230, for any target port, sort all target flow data corresponding to the current target port in order of data input time from earliest to latest, and obtain the 0th target flow data queue corresponding to the current target port.
4. The network traffic distribution control method according to claim 1, characterized in that: When i=1, the output ports corresponding to the 0th target flow data and the 0th target flow data are both empty.
5. The network traffic distribution control method according to claim 4, characterized in that: S400 includes the following steps: S410, determining the i-1th target flow data queue corresponding to the output port corresponding to the i-1th target flow data as the i-th target flow data queue corresponding to the output port corresponding to the i-1th target flow data; S420, according to a number of target ports corresponding to each target flow data and an output port corresponding to the i-1th target flow data, determining a target port other than the output port corresponding to the i-1th target flow data as a non-output port corresponding to the i-1th target flow data; S430, delete 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, and obtain the i-th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data.
6. The network traffic distribution control method according to claim 1, characterized in that: S500 includes the following steps: S510, for any target traffic data in the i-th target traffic data queue corresponding to the current target port, according to the i-th target traffic data queue corresponding to the current target port and the data volume corresponding to each target traffic data, the sum of the data volume corresponding to the any target traffic data, the data volume corresponding to all target traffic data in the i-th target traffic data queue that are sorted before the any target traffic data, and the initial data volume corresponding to the current target port is determined as the reference data volume corresponding to the any target traffic data; S520: Obtain the output end time corresponding to any target flow data at the current target port according to the reference data volume and the data processing rate corresponding to the current target port.
7. The network traffic distribution control method according to claim 1, characterized in that: S600 includes the following steps: S610, comparing the output end time corresponding to the i-th target traffic 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 corresponding to the i-th target traffic data.
8. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the network traffic distribution control method as described in any one of claims 1-7.
9. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 8.
Citation Information
Patent Citations
Network traffic control method and network equipment thereof
CN107196877A
Network traffic control method and device, network equipment and storage medium
CN116506370A